Flow
TESTf5903b5abasklearn.decomposition._truncated_svd.TruncatedSVD

TESTf5903b5abasklearn.decomposition._truncated_svd.TruncatedSVD

Visibility: public Uploaded 10-01-2024 by Continuous Integration sklearn==0.23.1 numpy>=1.13.3 scipy>=0.19.1 joblib>=0.11 threadpoolctl>=2.0.0 0 runs
0 likes downloaded by 0 people 0 issues 0 downvotes , 0 total downloads
Issue #Downvotes for this reason By


Loading wiki
Help us complete this description Edit
Dimensionality reduction using truncated SVD (aka LSA). This transformer performs linear dimensionality reduction by means of truncated singular value decomposition (SVD). Contrary to PCA, this estimator does not center the data before computing the singular value decomposition. This means it can work with sparse matrices efficiently. In particular, truncated SVD works on term count/tf-idf matrices as returned by the vectorizers in :mod:`sklearn.feature_extraction.text`. In that context, it is known as latent semantic analysis (LSA). This estimator supports two algorithms: a fast randomized SVD solver, and a "naive" algorithm that uses ARPACK as an eigensolver on `X * X.T` or `X.T * X`, whichever is more efficient.

Parameters

algorithmSVD solver to use. Either "arpack" for the ARPACK wrapper in SciPy (scipy.sparse.linalg.svds), or "randomized" for the randomized algorithm due to Halko (2009)default: "randomized"
n_componentsDesired dimensionality of output data Must be strictly less than the number of features The default value is useful for visualisation. For LSA, a value of 100 is recommendeddefault: 2
n_iterNumber of iterations for randomized SVD solver. Not used by ARPACK. The default is larger than the default in :func:`~sklearn.utils.extmath.randomized_svd` to handle sparse matrices that may have large slowly decaying spectrumdefault: 5
random_stateUsed during randomized svd. Pass an int for reproducible results across multiple function calls See :term:`Glossary `default: null
tolTolerance for ARPACK. 0 means machine precision. Ignored by randomized SVD solver.default: 0.0

0
Runs

List all runs
Parameter:
Rendering chart
Rendering table