smile.projection
Class PPCA
- java.lang.Object
-
- smile.projection.PPCA
-
- All Implemented Interfaces:
- java.io.Serializable, Projection<double[]>
public class PPCA extends java.lang.Object implements Projection<double[]>, java.io.Serializable
Probabilistic principal component analysis. PPCA is a simplified factor analysis that employs a latent variable model with linear relationship:y ∼ W * x + μ + εwhere latent variables x ∼ N(0, I), error (or noise) ε ∼ N(0, Ψ), and μ is the location term (mean). In PPCA, an isotropic noise model is used, i.e., noise variances constrained to be equal (Ψi = σ2). A close form of estimation of above parameters can be obtained by maximum likelihood method.References
- Michael E. Tipping and Christopher M. Bishop. Probabilistic Principal Component Analysis. Journal of the Royal Statistical Society. Series B (Statistical Methodology) 61(3):611-622, 1999.
- See Also:
PCA, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PPCA(double[][] data, int k)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]getCenter()Returns the center of data.DenseMatrixgetLoadings()Returns the variable loading matrix, ordered from largest to smallest by corresponding eigenvalues.doublegetNoiseVariance()Returns the variance of noise.DenseMatrixgetProjection()Returns the projection matrix.double[]project(double[] x)Project a data point to the feature space.double[][]project(double[][] x)Project a set of data toe the feature space.
-
-
-
Constructor Detail
-
PPCA
public PPCA(double[][] data, int k)Constructor. Learn probabilistic principal component analysis.- Parameters:
data- training data of which each row is a sample.k- the number of principal component to learn.
-
-
Method Detail
-
getLoadings
public DenseMatrix getLoadings()
Returns the variable loading matrix, ordered from largest to smallest by corresponding eigenvalues.
-
getCenter
public double[] getCenter()
Returns the center of data.
-
getNoiseVariance
public double getNoiseVariance()
Returns the variance of noise.
-
getProjection
public DenseMatrix getProjection()
Returns the projection matrix. Note that this is not the matrix W in the latent model.
-
project
public double[] project(double[] x)
Description copied from interface:ProjectionProject a data point to the feature space.- Specified by:
projectin interfaceProjection<double[]>
-
project
public double[][] project(double[][] x)
Description copied from interface:ProjectionProject a set of data toe the feature space.- Specified by:
projectin interfaceProjection<double[]>
-
-
DataMelt 3.0 © DataMelt by jWork.ORG