Batch Processing¶
Algorithm Input¶
The 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 |
---|---|
|
Use when the input data is a normalized or non-normalized data set. Pointer to the \(n \times p\) numeric table that contains the input data set. Note This input can be an object of any class derived from |
|
Use when the input data is a correlation matrix. Pointer to the \(p \times p\) numeric table that contains the correlation matrix. Note This input can be an object of any class derived from |
Algorithm Parameters¶
The PCA algorithm has the following parameters, depending on the computation method parameter method:
Parameter |
method |
Default Value |
Description |
---|---|---|---|
|
|
|
The floating-point type that the algorithm uses for intermediate
computations. Can be |
|
Not applicable |
|
Available methods for PCA computation: For CPU:
For GPU:
|
|
|
SharedPtr<covariance::Batch<algorithmFPType, covariance::defaultDense> > |
The correlation and variance-covariance matrices algorithm to be used for PCA computations with the correlation method. |
|
|
SharedPtr<normalization::zscore::Batch<algorithmFPType, normalization::zscore::defaultDense>> |
The data normalization algorithm to be used for PCA computations with the SVD method. |
|
|
\(0\) |
The number of principal components \(p_r\). If it is zero, the algorithm will compute the result for \(p_r = p\). |
|
|
|
If true, the algorithm applies the “sign flip” technique to the results. |
|
|
|
The 64-bit integer flag that specifies which optional result to compute. Provide one of the following values to request a single characteristic or use bitwise OR to request a combination of the characteristics:
|
Algorithm Output¶
The PCA algorithm calculates the results described below. Pass the
Result ID
as a parameter to the methods that access the results of
your algorithm.
Result ID |
Result |
---|---|
|
Pointer to the \(1 \times p_r\) numeric table that contains eigenvalues in the descending order. Note By default, this result is an object of the |
|
Pointer to the \(p_r \times p\) numeric table that contains eigenvectors in the row-major order. Note By default, this result is an object of the |
|
Pointer to the \(1 \times p_r\) numeric table that contains mean values for each feature. Optional. If correlation is provided then the vector is filed with zeroes. |
|
Pointer to the \(1 \times p_r\) numeric table that contains mean values for each feature. Optional. If correlation is provided then the vector is filed with zeroes. |
|
Pointer to key value data collection containing the aggregated data for normalization and whitening with the following key value pairs:
If |
Please note the following:
Note
If the function result is not requested through the
resultsToCompute
parameter, the respective element of the result contains a NULL pointer.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 fromNumericTable
, except forPackedSymmetricMatrix
,PackedTriangularMatrix
, andCSRNumericTable
.For the
svdDense
method \(n\) should not be less than \(p\). If \(n > p\), svdDense returns an error.