class sklearn.decomposition.MiniBatchDictionaryLearning(n_components=None, alpha=1, n_iter=1000, fit_algorithm=’lars’, n_jobs=None, batch_size=3, shuffle=True, dict_init=None, transform_algorithm=’omp’, transform_n_nonzero_coefs=None, transform_alpha=None, verbose=False, split_sign=False, random_state=None, positive_code=False, positive_dict=False)
[source]
Mini-batch dictionary learning
Finds a dictionary (a set of atoms) that can best be used to represent data using a sparse code.
Solves the optimization problem:
(U^*,V^*) = argmin 0.5 || Y - U V ||_2^2 + alpha * || U ||_1 (U,V) with || V_k ||_2 = 1 for all 0 <= k < n_components
Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
See also
SparseCoder
, DictionaryLearning
, SparsePCA
, MiniBatchSparsePCA
References:
J. Mairal, F. Bach, J. Ponce, G. Sapiro, 2009: Online dictionary learning for sparse coding (http://www.di.ens.fr/sierra/pdfs/icml09.pdf)
fit (X[, y]) | Fit the model from data in X. |
fit_transform (X[, y]) | Fit to data, then transform it. |
get_params ([deep]) | Get parameters for this estimator. |
partial_fit (X[, y, iter_offset]) | Updates the model using the data in X as a mini-batch. |
set_params (**params) | Set the parameters of this estimator. |
transform (X) | Encode the data as a sparse combination of the dictionary atoms. |
__init__(n_components=None, alpha=1, n_iter=1000, fit_algorithm=’lars’, n_jobs=None, batch_size=3, shuffle=True, dict_init=None, transform_algorithm=’omp’, transform_n_nonzero_coefs=None, transform_alpha=None, verbose=False, split_sign=False, random_state=None, positive_code=False, positive_dict=False)
[source]
fit(X, y=None)
[source]
Fit the model from data in X.
Parameters: |
|
---|---|
Returns: |
|
fit_transform(X, y=None, **fit_params)
[source]
Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
Parameters: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
partial_fit(X, y=None, iter_offset=None)
[source]
Updates the model using the data in X as a mini-batch.
Parameters: |
|
---|---|
Returns: |
|
set_params(**params)
[source]
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter>
so that it’s possible to update each component of a nested object.
Returns: |
|
---|
transform(X)
[source]
Encode the data as a sparse combination of the dictionary atoms.
Coding method is determined by the object parameter transform_algorithm
.
Parameters: |
|
---|---|
Returns: |
|
sklearn.decomposition.MiniBatchDictionaryLearning
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.MiniBatchDictionaryLearning.html