Skip to content

Commit 7d574ad

Browse files
committed
Merge pull request scikit-learn#5511 from KamalakerDadi/sphinx_version_added
[MRG + 1] Version Added for All Classes in 0.17
2 parents 417ee28 + f2e3541 commit 7d574ad

31 files changed

+236
-3
lines changed

sklearn/cluster/dbscan_.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ class DBSCAN(BaseEstimator, ClusterMixin):
174174
If metric is "precomputed", X is assumed to be a distance matrix and
175175
must be square. X may be a sparse matrix, in which case only "nonzero"
176176
elements may be considered neighbors for DBSCAN.
177+
178+
.. versionadded:: 0.17
179+
metric *precomputed* to accept precomputed sparse matrix.
180+
177181
algorithm : {'auto', 'ball_tree', 'kd_tree', 'brute'}, optional
178182
The algorithm to be used by the NearestNeighbors module
179183
to compute pointwise distances and find nearest neighbors.

sklearn/cluster/mean_shift_.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False,
147147
(n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one
148148
are used.
149149
150+
.. versionadded:: 0.17
151+
Parallel Execution using *n_jobs*.
152+
150153
Returns
151154
-------
152155

sklearn/cross_validation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ class LabelKFold(_BaseKFold):
361361
The folds are approximately balanced in the sense that the number of
362362
distinct labels is approximately the same in each fold.
363363
364+
.. versionadded:: 0.17
365+
364366
Parameters
365367
----------
366368
labels : array-like with shape (n_samples, )
@@ -1108,6 +1110,8 @@ class LabelShuffleSplit(ShuffleSplit):
11081110
Note: The parameters ``test_size`` and ``train_size`` refer to labels, and
11091111
not to samples, as in ShuffleSplit.
11101112
1113+
.. versionadded:: 0.17
1114+
11111115
Parameters
11121116
----------
11131117
labels : array, [n_samples]
@@ -1828,6 +1832,9 @@ def train_test_split(*arrays, **options):
18281832
If not None, data is split in a stratified fashion, using this as
18291833
the labels array.
18301834
1835+
.. versionadded:: 0.17
1836+
*stratify* splitting
1837+
18311838
Returns
18321839
-------
18331840
splitting : list, length = 2 * len(arrays),

sklearn/datasets/rcv1.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def fetch_rcv1(data_home=None, subset='all', download_if_missing=True,
5151
5252
Read more in the :ref:`User Guide <datasets>`.
5353
54+
.. versionadded:: 0.17
55+
5456
Parameters
5557
----------
5658
data_home : string, optional

sklearn/datasets/samples_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ def make_multilabel_classification(n_samples=100, n_features=20, n_classes=5,
294294
sparse : bool, optional (default=False)
295295
If ``True``, return a sparse feature matrix
296296
297+
.. versionadded:: 0.17
298+
parameter to allow *sparse* output.
299+
297300
return_indicator : 'dense' (default) | 'sparse' | False
298301
If ``dense`` return ``Y`` in the dense binary indicator format. If
299302
``'sparse'`` return ``Y`` in the sparse binary indicator format.

sklearn/datasets/svmlight_format.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def dump_svmlight_file(X, y, f, zero_based=True, comment=None, query_id=None,
342342
n_features is the number of features.
343343
344344
y : array-like, shape = [n_samples] or [n_samples, n_labels]
345-
Target values. Class labels must be an integer or float, or array-like
345+
Target values. Class labels must be an integer or float, or array-like
346346
objects of integer or float for multilabel classifications.
347347
348348
f : string or file-like in binary mode
@@ -369,6 +369,9 @@ def dump_svmlight_file(X, y, f, zero_based=True, comment=None, query_id=None,
369369
multilabel: boolean, optional
370370
Samples may have several labels each (see
371371
http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html)
372+
373+
.. versionadded:: 0.17
374+
parameter *multilabel* to support multilabel datasets.
372375
"""
373376
if comment is not None:
374377
# Convert comment string to list of lines in UTF-8.

sklearn/decomposition/dict_learning.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,9 @@ class DictionaryLearning(BaseEstimator, SparseCodingMixin):
948948
Lasso solution (linear_model.Lasso). Lars will be faster if
949949
the estimated components are sparse.
950950
951+
.. versionadded:: 0.17
952+
*cd* coordinate descent method to improve speed.
953+
951954
transform_algorithm : {'lasso_lars', 'lasso_cd', 'lars', 'omp', \
952955
'threshold'}
953956
Algorithm used to transform the data
@@ -960,6 +963,9 @@ class DictionaryLearning(BaseEstimator, SparseCodingMixin):
960963
threshold: squashes to zero all coefficients less than alpha from
961964
the projection ``dictionary * X'``
962965
966+
.. versionadded:: 0.17
967+
*lasso_cd* coordinate descent method to improve speed.
968+
963969
transform_n_nonzero_coefs : int, ``0.1 * n_features`` by default
964970
Number of nonzero coefficients to target in each column of the
965971
solution. This is only used by `algorithm='lars'` and `algorithm='omp'`

sklearn/decomposition/nmf.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,14 @@ class NMF(BaseEstimator, TransformerMixin):
841841
842842
solver : 'pg' | 'cd'
843843
Numerical solver to use:
844-
'pg' is a (deprecated) Projected Gradient solver.
845-
'cd' is a Coordinate Descent solver.
844+
'pg' is a Projected Gradient solver (deprecated).
845+
'cd' is a Coordinate Descent solver (recommended).
846+
847+
.. versionadded:: 0.17
848+
Coordinate Descent solver.
849+
850+
.. versionchanged:: 0.17
851+
Deprecated Projected Gradient solver.
846852
847853
tol : double, default: 1e-4
848854
Tolerance value used in stopping conditions.
@@ -857,32 +863,57 @@ class NMF(BaseEstimator, TransformerMixin):
857863
Constant that multiplies the regularization terms. Set it to zero to
858864
have no regularization.
859865
866+
.. versionadded:: 0.17
867+
*alpha* used in the Coordinate Descent solver.
868+
860869
l1_ratio : double, default: 0.
861870
The regularization mixing parameter, with 0 <= l1_ratio <= 1.
862871
For l1_ratio = 0 the penalty is an elementwise L2 penalty
863872
(aka Frobenius Norm).
864873
For l1_ratio = 1 it is an elementwise L1 penalty.
865874
For 0 < l1_ratio < 1, the penalty is a combination of L1 and L2.
866875
876+
.. versionadded:: 0.17
877+
Regularization parameter *l1_ratio* used in the Coordinate Descent solver.
878+
867879
shuffle : boolean, default: False
868880
If true, randomize the order of coordinates in the CD solver.
869881
882+
.. versionadded:: 0.17
883+
*shuffle* parameter used in the Coordinate Descent solver.
884+
870885
nls_max_iter : integer, default: 2000
871886
Number of iterations in NLS subproblem.
872887
Used only in the deprecated 'pg' solver.
873888
889+
.. versionchanged:: 0.17
890+
Deprecated Projected Gradient solver. Use Coordinate Descent solver
891+
instead.
892+
874893
sparseness : 'data' | 'components' | None, default: None
875894
Where to enforce sparsity in the model.
876895
Used only in the deprecated 'pg' solver.
877896
897+
.. versionchanged:: 0.17
898+
Deprecated Projected Gradient solver. Use Coordinate Descent solver
899+
instead.
900+
878901
beta : double, default: 1
879902
Degree of sparseness, if sparseness is not None. Larger values mean
880903
more sparseness. Used only in the deprecated 'pg' solver.
881904
905+
.. versionchanged:: 0.17
906+
Deprecated Projected Gradient solver. Use Coordinate Descent solver
907+
instead.
908+
882909
eta : double, default: 0.1
883910
Degree of correctness to maintain, if sparsity is not None. Smaller
884911
values mean larger error. Used only in the deprecated 'pg' solver.
885912
913+
.. versionchanged:: 0.17
914+
Deprecated Projected Gradient solver. Use Coordinate Descent solver
915+
instead.
916+
886917
Attributes
887918
----------
888919
components_ : array, [n_components, n_features]

sklearn/decomposition/online_lda.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def _update_doc_distribution(X, exp_topic_word_distr, doc_topic_prior,
136136
class LatentDirichletAllocation(BaseEstimator, TransformerMixin):
137137
"""Latent Dirichlet Allocation with online variational Bayes algorithm
138138
139+
.. versionadded:: 0.17
140+
139141
Parameters
140142
----------
141143
n_topics : int, optional (default=10)

sklearn/discriminant_analysis.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ class LinearDiscriminantAnalysis(BaseEstimator, LinearClassifierMixin,
140140
The fitted model can also be used to reduce the dimensionality of the input
141141
by projecting it to the most discriminative directions.
142142
143+
.. versionadded:: 0.17
144+
*LinearDiscriminantAnalysis*.
145+
146+
.. versionchanged:: 0.17
147+
Deprecated :class:`lda.LDA` have been moved to *LinearDiscriminantAnalysis*.
148+
143149
Parameters
144150
----------
145151
solver : string, optional
@@ -167,9 +173,13 @@ class LinearDiscriminantAnalysis(BaseEstimator, LinearClassifierMixin,
167173
store_covariance : bool, optional
168174
Additionally compute class covariance matrix (default False).
169175
176+
.. versionadded:: 0.17
177+
170178
tol : float, optional
171179
Threshold used for rank estimation in SVD solver.
172180
181+
.. versionadded:: 0.17
182+
173183
Attributes
174184
----------
175185
coef_ : array, shape (n_features,) or (n_classes, n_features)
@@ -399,6 +409,12 @@ def fit(self, X, y, store_covariance=None, tol=None):
399409
"""Fit LinearDiscriminantAnalysis model according to the given
400410
training data and parameters.
401411
412+
.. versionchanged:: 0.17
413+
Deprecated *store_covariance* have been moved to main constructor.
414+
415+
.. versionchanged:: 0.17
416+
Deprecated *tol* have been moved to main constructor.
417+
402418
Parameters
403419
----------
404420
X : array-like, shape (n_samples, n_features)
@@ -532,6 +548,12 @@ class QuadraticDiscriminantAnalysis(BaseEstimator, ClassifierMixin):
532548
533549
The model fits a Gaussian density to each class.
534550
551+
.. versionadded:: 0.17
552+
*QuadraticDiscriminantAnalysis*
553+
554+
.. versionchanged:: 0.17
555+
Deprecated :class:`qda.QDA` have been moved to *QuadraticDiscriminantAnalysis*.
556+
535557
Parameters
536558
----------
537559
priors : array, optional, shape = [n_classes]
@@ -567,9 +589,13 @@ class QuadraticDiscriminantAnalysis(BaseEstimator, ClassifierMixin):
567589
If True the covariance matrices are computed and stored in the
568590
`self.covariances_` attribute.
569591
592+
.. versionadded:: 0.17
593+
570594
tol : float, optional, default 1.0e-4
571595
Threshold used for rank estimation.
572596
597+
.. versionadded:: 0.17
598+
573599
Examples
574600
--------
575601
>>> from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis
@@ -600,6 +626,12 @@ def __init__(self, priors=None, reg_param=0., store_covariances=False,
600626
def fit(self, X, y, store_covariances=None, tol=None):
601627
"""Fit the model according to the given training data and parameters.
602628
629+
.. versionchanged:: 0.17
630+
Deprecated *store_covariance* have been moved to main constructor.
631+
632+
.. versionchanged:: 0.17
633+
Deprecated *tol* have been moved to main constructor.
634+
603635
Parameters
604636
----------
605637
X : array-like, shape = [n_samples, n_features]

0 commit comments

Comments
 (0)