Principal Component Analysis

Principal Component Analysis (PCA) calculates so-called principal components with the help of which one can rotate the coordinate system of a given data set in such a way that the variance of the data, i.e. its information content, is maximized along the new principal axes. The covariance matrix of the transformed data is diagonalized and the order of principal components is sorted so that the first principal component carries the largest information portion of the data set, the second then carries the second largest information portion, and so on.

The latter principal components often contribute little information to the data set, which means that they can be ignored. As a result, the parameter space is reduced with the least possible loss of information (Dimension reduction). The dimension reduction with PCA is often used for preprocessing prior to the cluster analysis or a classification. The PCA can also be used for anomaly detection by reducing a large space to a few principal components and determining limit values for the important principal components “by hand”.

Supported properties

ONNX support

Supported ONNX operators:

A sample showing how a PCA for dimension reduction can be exported from Scikit-learn and used in TwinCAT can be found here: ONNX export of a PCA.

Supported data types

A distinction must be made between "supported datatype" and "preferred datatype". The preferred datatype corresponds to the precision of the execution engine.

The preferred datatype is floating point 64 (E_MLLDT_FP64-LREAL).

When using a supported datatype, an efficient type conversion automatically takes place in the library. Slight losses of performance can occur due to the type conversion.

A list of the supported datatypes can be found in ETcMllDataType.