18from ROOT
import TPrincipal, gRandom, TBrowser, vector
26print (
"""*************************************************
27* Principal Component Analysis *
29* Number of variables: {0:4d} *
30* Number of data points: {1:8d} *
31* Number of dependent variables: {2:4d} *
33*************************************************""".
format(n, m, c))
47data = vector(
'double')()
51 for j
in range(n - c):
53 data.push_back(randumNum.Gaus(5, 1))
55 data.push_back(randumNum.Poisson(8))
57 data.push_back(randumNum.Exp(2))
62 for k
in range(n - c - j):
63 data[n - c + j] += data[k]
66 principal.AddRow(data.data())
70principal.MakePrincipals()
79principal.MakeHistograms()
85b =
TBrowser(
"principalBrowser", principal)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
Using a TBrowser one can browse all ROOT objects.
Principal Components Analysis (PCA)