10000 Merge pull request #3 from ogrisel/jakevdp-neighbors-refactor · ogrisel/scikit-learn@f75ee72 · GitHub
[go: up one dir, main page]

Skip to content

Commit f75ee72

Browse files
committed
Merge pull request #3 from ogrisel/jakevdp-neighbors-refactor
Jakevdp neighbors refactor
2 parents 0d4fa9e + db4f4e4 commit f75ee72

File tree

11 files changed

+46
-23
lines changed

11 files changed

+46
-23
lines changed

AUTHORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ People
9393

9494
* Robert Layton
9595

96-
* Gilles Louppe
96+
* `Gilles Louppe <http://www.montefiore.ulg.ac.be/~glouppe>`_
9797

9898
If I forgot anyone, do not hesitate to send me an email to
9999
fabian.pedregosa@inria.fr and I'll include you in the list.

scikits/learn/cross_val.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import warnings
2+
warnings.warn('scikits.learn namespace is deprecated, please use sklearn instead')
3+
from sklearn.cross_val import *

scikits/learn/datasets/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import warnings
2+
warnings.warn('scikits.learn is deprecated, please use sklearn')
3+
from sklearn.datasets.base import *

scikits/learn/feature_extraction/__init__.py

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import warnings
2+
warnings.warn('scikits.learn namespace is deprecated, please use sklearn instead')
3+
from sklearn.feature_extraction.image import *
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import warnings
2+
warnings.warn('scikits.learn namespace is deprecated, please use sklearn instead')
3+
from sklearn.feature_extraction.text import *
4+

sklearn/datasets/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def __init__(self, **kwargs):
3131
dict.__init__(self, kwargs)
3232
self.__dict__ = self
3333

34+
3435
def get_data_home(data_home=None):
3536
"""Return the path of the scikit-learn data dir.
3637
@@ -54,11 +55,13 @@ def get_data_home(data_home=None):
5455
makedirs(data_home)
5556
return data_home
5657

58+
5759
def clear_data_home(data_home=None):
5860
"""Delete all the content of the data home cache."""
5961
data_home = get_data_home(data_home)
6062
shutil.rmtree(data_home)
6163

64+
6265
def load_files(container_path, description=None, categories=None,
6366
load_content=True, shuffle=True, random_state=None):
6467
"""Load text files with categories as subfolder names.
@@ -173,6 +176,7 @@ def load_files(container_path, description=None, categories=None,
173176
target=target,
174177
DESCR=description)
175178

179+
176180
def load_iris():
177181
"""Load and return the iris dataset (classification).
178182
@@ -216,6 +220,7 @@ def load_iris():
216220
feature_names=['sepal length (cm)', 'sepal width (cm)',
217221
'petal length (cm)', 'petal width (cm)'])
218222

223+
219224
def load_digits(n_class=10):
220225
"""Load and return the digits dataset (classification).
221226
@@ -265,6 +270,7 @@ def load_digits(n_class=10):
265270
images=images,
266271
DESCR=descr)
267272

273+
268274
def load_diabetes():
269275
"""Load and return the diabetes dataset (regression).
270276
@@ -280,6 +286,7 @@ def load_diabetes():
280286
target = np.loadtxt(join(base_dir, 'diabetes_target.csv.gz'))
281287
return Bunch(data=data, target=target)
282288

289+
283290
def load_linnerud():
284291
"""Load and return the linnerud dataset (multivariate regression).
285292
@@ -310,6 +317,7 @@ def load_linnerud():
310317
header_physiological=header_physiological,
311318
DESCR=fdescr.read())
312319

320+
313321
def load_boston():
314322
"""Load and return the boston house-prices dataset (regression).
315323
@@ -347,6 +355,7 @@ def load_boston():
347355
feature_names=feature_names,
348356
DESCR=fdescr.read())
349357

358+
350359
def load_sample_images():
351360
"""Load sample images for image manipulation.
352361
@@ -400,6 +409,7 @@ def load_sample_images():
400409
filenames=filenames,
401410
DESCR=descr)
402411

412+
403413
def load_sample_image(image_name):
404414
"""Load the numpy array of a single sample image
405415

sklearn/datasets/twenty_newsgroups.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import logging
4141
import tarfile
4242
import pickle
43-
import warnings
4443
import shutil
4544

4645
import numpy as np

sklearn/linear_model/stochastic_gradient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class SGDClassifier(BaseSGDClassifier):
7373
multi-class problems) computation. -1 means 'all CPUs'. Defaults
7474
to 1.
7575
76-
learning_rate : int
76+
learning_rate : string, optional
7777
The learning rate:
7878
constant: eta = eta0
7979
optimal: eta = 1.0/(t+t0) [default]

sklearn/neighbors/base.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
# License: BSD, (C) INRIA, University of Amsterdam
88
import warnings
99

10-
import re
11-
1210
import numpy as np
1311
from scipy.sparse import csr_matrix, issparse
1412
from scipy.spatial.ckdtree import cKDTree
@@ -20,9 +18,7 @@
2018

2119

2220
def _check_weights(weights):
23-
"""
24-
check to make sure weights are valid
25-
"""
21+
"""Check to make sure weights are valid"""
2622
if weights in (None, 'uniform', 'distance'):
2723
return weights
2824
elif callable(weights):
@@ -33,9 +29,9 @@ def _check_weights(weights):
3329

3430

3531
def _get_weights(dist, weights):
36-
"""
37-
get the weights from an array of distances and a parameter ``weights``,
38-
which can be either a string or an executable
32+
"""Get the weights from an array of distances and a parameter ``weights``
33+
34+
``weights`` can be either a string or an executable.
3935
4036
returns ``weights_arr``, an array of the same size as ``dist``
4137
if ``weights == 'uniform'``, then returns None

0 commit comments

Comments
 (0)
0