Package org.apache.spark.mllib.feature
Class PCAModel
Object
org.apache.spark.mllib.feature.PCAModel
- All Implemented Interfaces:
Serializable
,VectorTransformer
Model fitted by
PCA
that can project vectors to a low-dimensional space using PCA.
param: k number of principal components. param: pc a principal components Matrix. Each column is one principal component.
- See Also:
-
Method Details
-
explainedVariance
-
k
public int k() -
pc
-
transform
Transform a vector by computed Principal Components.- Specified by:
transform
in interfaceVectorTransformer
- Parameters:
vector
- vector to be transformed. Vector must be the same length as the source vectors given toPCA.fit()
.- Returns:
- transformed vector. Vector will be of length k.
-