Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7f8212

Browse files
author
Fabian Pedregosa
committed
Some Python 2.5 fixes.
1 parent 18382c3 commit e7f8212

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

sklearn/cross_val.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
warnings.warn('sklearn.cross_val namespace is deprecated in version 0.9'
33
' and will be removed in version 0.11.'
44
' Please use sklearn.cross_validation instead.')
5-
from .cross_validation import *
5+
from cross_validation import *

sklearn/datasets/samples_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def make_classification(n_samples=100, n_features=20, n_informative=2,
136136
y = np.zeros(n_samples)
137137

138138
# Build the polytope
139-
from itertools import product
139+
from ..utils.fixes import product
140140
C = np.array(list(product([-class_sep, class_sep], repeat=n_informative)))
141141

142142
if not hypercube:

sklearn/neighbors/classification.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ def predict(self, X):
232232
return mode.flatten().astype(np.int)
233233

234234

235-
@deprecated("deprecated in v0.9; will be removed in v0.11; "
236-
"use KNeighborsClassifier or RadiusNeighborsClassifier instead")
237235
class NeighborsClassifier(NeighborsBase, KNeighborsMixin,
238236
RadiusNeighborsMixin, SupervisedIntegerMixin,
239237
ClassifierMixin):
@@ -341,3 +339,9 @@ def predict(self, X):
341339
pred_labels = [self._y[ind] for ind in neigh_ind]
342340
return np.asarray([stats.mode(pi) for pi in pred_labels],
343341
dtype=np.int)
342+
343+
NeighborsClassifier = deprecated(
344+
"deprecated in v0.9; will be removed in v0.11; "
345+
"use KNeighborsClassifier or RadiusNeighborsClassifier instead")(
346+
NeighborsClassifier)
347+

0 commit comments

Comments
 (0)