I’d like to perform extraction of reduced features
(it means that spectrum data has 200 points, I need to reduce the features and extract general 3 kinds of principal component (PCA1, PCA2, PCA3), for instance)
I prepared some code below,
// 5 spectra
Double_t spectra[5][200] = {
{1.2, 0.8, 1.0, 1.5, 0.9, .... 0.7, 1.4, 0.6, 1.1, 1.3},
{0.7, 0.9, 1.2, 0.6, 1.5, .... 1.1, 1.3, 1.4, 0.8, 0.7},
{1.3, 1.4, 0.9, 1.1, 0.8, .... 1.0, 1.2, 0.7, 0.6, 1.5},
{0.8, 1.2, 0.7, 1.5, 0.6, .... 1.3, 1.1, 0.9, 1.4, 0.9},
{1.1, 1.0, 0.6, 1.4, 1.3, .... 1.5, 0.9, 0.7, 0.8, 1.2}
};
Int_t n = 200; // data points
Int_t m = 5; // #of spectra
TPrincipal* principal = new TPrincipal(n, "ND");
for (Int_t i = 0; i < m; i++) {
principal->AddRow(spectra[i]);
}
// We delete the data after use, since TPrincipal got it by now.
//delete [] data;
// Do the actual analysis
principal->MakePrincipals();
But, I do not know how I extract the PCA values (principal component, or reduced features) for each spectra…
How can I extract the PCA values (principal component, or reduced features) ?