8000 DOC: Version added positivity in dict_learning (#11341) · wdevazelhes/scikit-learn@e3cf020 · GitHub
[go: up one dir, main page]

Skip to content

Commit e3cf020

Browse files
jakirkhamjnothman
authored andcommitted
DOC: Version added positivity in dict_learning (scikit-learn#11341)
1 parent 08f04d9 commit e3cf020

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

doc/whats_new/v0.20.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ Decomposition, manifold learning and clustering
142142
sample weights via new parameter ``sample_weight`` in ``fit`` function.
143143
:issue:`10933` by :user:`Johannes Hansen <jnhansen>`.
144144

145+
- :mod:`dict_learning` functions and models now support positivity constraints.
146+
This applies to the dictionary and sparse code.
147+
:issue:`6374` by :user:`John Kirkham <jakirkham>`.
148+
145149
Metrics
146150

147151
- Partial AUC is available via ``max_fpr`` parameter in

sklearn/decomposition/dict_learning.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def _sparse_encode(X, dictionary, gram, cov=None, algorithm='lasso_lars',
8383
positive: boolean
8484
Whether to enforce a positivity constraint on the sparse code.
8585
86+
.. versionadded:: 0.20
87+
8688
Returns
8789
-------
8890
code : array of shape (n_components, n_features)
@@ -256,6 +258,8 @@ def sparse_encode(X, dictionary, gram=None, cov=None, algorithm='lasso_lars',
256258
positive : boolean, optional
257259
Whether to enforce positivity when finding the encoding.
258260
261+
.. versionadded:: 0.20
262+
259263
Returns
260264
-------
261265
code : array of shape (n_samples, n_components)
@@ -358,6 +362,8 @@ def _update_dict(dictionary, Y, code, verbose=False, return_r2=False,
358362
positive : boolean, optional
359363
Whether to enforce positivity when finding the dictionary.
360364
365+
.. versionadded:: 0.20
366+
361367
Returns
362368
-------
363369
dictionary : array of shape (n_features, n_components)
@@ -478,9 +484,13 @@ def dict_learning(X, n_components, alpha, max_iter=100, tol=1e-8,
478484
positive_dict : bool
479485
Whether to enforce positivity when finding the dictionary.
480486
487+
.. versionadded:: 0.20
488+
481489
positive_code : bool
482490
Whether to enforce positivity when finding the code.
483491
492+
.. versionadded:: 0.20
493+
484494
Returns
485495
-------
486496
code : array of shape (n_samples, n_components)
@@ -684,9 +694,13 @@ def dict_learning_online(X, n_components=2, alpha=1, n_iter=100,
684694
positive_dict : bool
685695
Whether to enforce positivity when finding the dictionary.
686696
697+
.. versionadded:: 0.20
698+
687699
positive_code : bool
688700
Whether to enforce positivity when finding the code.
689701
702+
.. versionadded:: 0.20
703+
690704
Returns
691705
-------
692706
code : array of shape (n_samples, n_components),
@@ -942,6 +956,8 @@ class SparseCoder(BaseEstimator, SparseCodingMixin):
942956
positive_code : bool
943957
Whether to enforce positivity when finding the code.
944958
959+
.. versionadded:: 0.20
960+
945961
Attributes
946962
----------
947963
components_ : array, [n_components, n_features]
@@ -1080,9 +1096,13 @@ class DictionaryLearning(BaseEstimator, SparseCodingMixin):
10801096
positive_code : bool
10811097
Whether to enforce positivity when finding the code.
10821098
1099+
.. versionadded:: 0.20
1100+
10831101
positive_dict : bool
10841102
Whether to enforce positivity when finding the dictionary
10851103
1104+
.. versionadded:: 0.20
1105+
10861106
Attributes
10871107
----------
10881108
components_ : array, [n_components, n_features]
@@ -1256,9 +1276,13 @@ class MiniBatchDictionaryLearning(BaseEstimator, SparseCodingMixin):
12561276
positive_code : bool
12571277
Whether to enforce positivity when finding the code.
12581278
1279+
.. versionadded:: 0.20
1280+
12591281
positive_dict : bool
12601282
Whether to enforce positivity when finding the dictionary.
12611283
1284+
.. versionadded:: 0.20
1285+
12621286
Attributes
12631287
----------
12641288
components_ : array, [n_components, n_features]

0 commit comments

Comments
 (0)
0