Developer Guide and Reference

  • 2021.1
  • 12/04/2020
  • Public Content
Contents

Quality Metrics for Principal Components Analysis

Given the results of the PCA algorithm, data set LaTex Math image. , LaTex Math image. of eigenvalues in decreasing order, full number of principal components
p
and reduced number of components LaTex Math image. , the problem is to evaluate the explained variances radio and noise variance.
QualityMetricsId
for the PCA algorithm is
explainedVarianceMetrics
.

Details

The metrics are computed given the input data meets the following requirements:
  • At least the largest eigenvalue LaTex Math image. is non-zero. Returns an error otherwise.
  • The number of eigenvalues
    p
    must be equal to the number of features provided. Returns an error if
    p
    is less than the number of features.
The PCA algorithm receives input argument eigenvalues LaTex Math image. , LaTex Math image. . It represents the following quality metrics:
  • Explained variance ratio
  • Noise variance
The library uses the following quality metrics:
Quality Metric
Definition
Explained variance
LaTex Math image. , LaTex Math image.
Explained variance ratios
LaTex Math image. , LaTex Math image.
Noise variance
LaTex Math image.
Quality metrics for PCA are correctly calculated only if the eigenvalues vector obtained from the PCA algorithm has not been reduced. That is, the nComponents parameter of the PCA algorithm must be zero or equal to the number of features. The formulas rely on a full set of the principal components. If the set is reduced, the result is considered incorrect.

Batch Processing

Algorithm Input
The Quality Metrics for PCA algorithm accepts the input described below. Pass the
Input ID
as a parameter to the methods that provide input for your algorithm. For more details, see Algorithms.
Input ID
Input
eigenvalues
p
eigenvalues (explained variances), numeric table of size LaTex Math image. .
You can define it as an object of any class derived from
NumericTable
except
PackedSymmetricMatrix
,
PackedTriangularMatrix
, and
CSRNumericTable
.
Algorithm Parameters
The quality metric algorithm has the following parameters:
Parameter
Default Value
Description
algorithmFPType
float
The floating-point type that the algorithm uses for intermediate computations. Can be
float
or
double
.
nComponents
0
The number of principal components LaTex Math image. to compute metrics for. If it is zero, the algorithm will compute the result for
p
.
nFeatures
0
The number of features in the data set used as input in PCA algorithm. If it is zero, the algorithm will compute the result for p.
if LaTex Math image. , the algorithm will return non-relevant results.
Algorithm Output
The quality metric for PCA algorithm calculates the result described below. Pass the
Result ID
as a parameter to the methods that access the results of your algorithm.
Result ID
Result
explainedVariances
Pointer to the LaTex Math image. numeric table that contains a reduced eigenvalues array.
explainedVariancesRatios
Pointer to the LaTex Math image. numeric table that contains an array of reduced explained variances ratios.
noiseVariance
Pointer to the LaTex Math image. numeric table that contains noise variance.
By default, each numeric table specified by the collection elements is an object of the
HomogenNumericTable
class, but you can define the result as an object of any class derived from
NumericTable
, except for
PackedSymmetricMatrix
,
PackedTriangularMatrix
, and CSRNumericTable.

Examples

C++ (CPU)
Java*
There is no support for Java on GPU.
Batch Processing:

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.