public class PCAModel extends java.lang.Object implements VectorTransformer
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.
Modifier and Type | Method and Description |
---|---|
DenseVector |
explainedVariance() |
int |
k() |
DenseMatrix |
pc() |
Vector |
transform(Vector vector)
Transform a vector by computed Principal Components.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transform, transform
public int k()
public DenseMatrix pc()
public DenseVector explainedVariance()
public Vector transform(Vector vector)
transform
in interface VectorTransformer
vector
- vector to be transformed.
Vector must be the same length as the source vectors given to PCA.fit()
.