texthero.representation.pca¶
-
pca
(s, n_components=2)¶ Perform principal component analysis on the given Pandas Series.
In general, pca should be called after the text has already been represented.
- Parameters
- sPandas Series
- n_componentsInt. Default is 2.
Number of components to keep. If n_components is not set or None, all components are kept.
Examples
>>> import texthero as hero >>> import pandas as pd >>> s = pd.Series(["Sentence one", "Sentence two"])