Principal Component Analysis Class
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
public sealed class PrincipalComponentAnalysis : TransformationModel<double>
- Inheritance
- Object → Model → TransformationModel<Double> → PrincipalComponentAnalysis
Remarks
Use the PrincipalComponentAnalysis class to obtain information about the components that contribute the most to the variation in a dataset. The data for the analysis can be supplied in a variety of formats, including as a data frame, an array of numerical vectors, or a matrix.
The [!:Standardize] property determines whether each variable should be rescaled to have zero mean and unit standard deviation. The Fit() method performs the actual calculation.
Once the analysis has been completed, the Components property provides access to a collection of PrincipalComponent objects that provide details about each of the principal components. The components are sorted in order of their contribution to the variance in the data, in descending order. The ComponentMatrix property returns the components as the columns of a matrix. The ScoreMatrix property expresses the observations in terms of the components. The GetPredictions(Int32) method returns the observations if only the specified number of components is taken into account.
The VarianceProportions and CumulativeVarianceProportions summarize the contribution of each component. The GetVarianceThreshold(Double) calculates how many components are needed to explain a certain proportion of the variation.
Constructors
Principal | Constructs a new PrincipalComponentAnalysis object. |
Principal | Constructs a new PrincipalComponentAnalysis object. |
Principal | Constructs a new PrincipalComponentAnalysis object. |
Principal | Constructs a new PrincipalComponentAnalysis object. |
Principal | Constructs a new PrincipalComponentAnalysis object. |
Properties
Base |
Gets an index containing the keys of the columns
that are required inputs to the model.
(Inherited from Model) |
Center | Gets or sets whether the variables should be centered prior to computing the principal components. |
Component | Gets the matrix whose columns contain the principal components. |
Components | Returns the collection of principal components. |
Computed |
Gets whether the model has been computed.
(Inherited from Model) Obsolete. |
Cumulative | Gets the cumulative proportion of the variance that is explained by the components. |
Data |
Gets an object that contains all the data used as input to the model.
(Inherited from Model) |
Eigenvalues | Gets the eigenvalues corresponding to each of the components. |
Features |
Gets a matrix that contains the features.
(Inherited from TransformationModel<T>) |
Fitted |
Gets whether the model has been computed.
(Inherited from Model) |
Input |
Gets the schema for the features used for fitting the model.
(Inherited from Model) |
Loadings | Gets the matrix of component loadings. |
Max |
Gets or sets the maximum degree of parallelism enabled by this instance.
(Inherited from Model) |
Model |
Gets the collection of variables used in the model.
(Inherited from Model) |
Number | Gets or sets the number of components to retain. |
Number |
Gets the number of observations the model is based on.
(Inherited from Model) |
Scaling | Gets or sets the method used to scale the variables. |
Score | Gets the matrix of component scores. |
Status |
Gets the status of the model, which determines which information is available.
(Inherited from Model) |
Supports |
Indicates whether the model supports case weights.
(Inherited from Model) |
Variance | Gets the proportion of the variance that is explained by each of the components. |
Weights |
Gets or sets the actual weights.
(Inherited from Model) |
Methods
Compute() |
Computes the model.
(Inherited from Model) Obsolete. |
Compute( |
Computes the model.
(Inherited from Model) Obsolete. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Fit() |
Fits the model to the data.
(Inherited from Model) |
Fit( |
Fits the model to the data.
(Inherited from Model) |
Get | Returns the number of components to retain based on the broken stick criterion. |
Get | Returns the number of components to retain based on whether the corresponding eigenvalues are greater than the specified value. |
Get | Serves as the default hash function. (Inherited from Object) |
Get | Returns the Mahalanobis distance of the observations to the centroid of the observations. |
Get | Returns the predicted values of the variables based on the specified number of components. |
Get | Gets the Type of the current instance. (Inherited from Object) |
Get | Returns the number of components needed to explain the requested proportion of the variance in the data. |
Inverse |
Applies the inverse transformation to a set of observations.
(Inherited from TransformationModel<T>) |
Inverse |
Applies the inverse transformation to a set of observations.
(Inherited from TransformationModel<T>) |
Inverse |
Applies the inverse transformation to a set of observations.
(Overrides TransformationModel<T>.InverseTransformInto(Matrix<Double>, Matrix<Double>)) |
Inverse |
Applies the inverse transformation to a set of observations.
(Overrides TransformationModel<T>.InverseTransformInto(Vector<Double>, Vector<Double>)) |
Reset |
Clears all fitted model parameters.
(Inherited from Model) Obsolete. |
Reset |
Clears all fitted model parameters.
(Inherited from Model) |
Set |
Uses the specified data frame as the source for all input variables.
(Inherited from Model) |
Summarize() |
Returns a string containing a human-readable summary of the object using default options.
(Inherited from Model) |
Summarize( |
Returns a string containing a human-readable summary of the object using the specified options.
(Inherited from Model) |
ToString | Returns a string that represents the current object. (Inherited from Model) |
Transform( |
Applies the transformation to a set of observations.
(Inherited from TransformationModel<T>) |
Transform( |
Applies the transformation to a single observation.
(Inherited from TransformationModel<T>) |
Transform |
Applies the transformation to a set of observations.
(Overrides TransformationModel<T>.TransformInto(Matrix<Double>, Matrix<Double>)) |
Transform |
Applies the transformation to a single observation.
(Overrides TransformationModel<T>.TransformInto(Vector<Double>, Vector<Double>)) |