File indexing completed on 2025-01-18 10:11:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef ROOT_TMVA_VariablePCATransform
0030 #define ROOT_TMVA_VariablePCATransform
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #include "TPrincipal.h"
0041
0042 #include "TMVA/VariableTransformBase.h"
0043
0044 #include <vector>
0045
0046 namespace TMVA {
0047
0048 class VariablePCATransform : public VariableTransformBase {
0049
0050 public:
0051
0052 VariablePCATransform( DataSetInfo& dsi );
0053 virtual ~VariablePCATransform( void );
0054
0055 void Initialize();
0056 Bool_t PrepareTransformation (const std::vector<Event*>&);
0057
0058 virtual const Event* Transform(const Event* const, Int_t cls ) const;
0059 virtual const Event* InverseTransform(const Event* const, Int_t cls ) const;
0060
0061 void WriteTransformationToStream ( std::ostream& ) const;
0062 void ReadTransformationFromStream( std::istream&, const TString& );
0063
0064 virtual void AttachXMLTo(void* parent);
0065 virtual void ReadFromXML( void* trfnode );
0066
0067
0068 virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
0069
0070 private:
0071
0072 void CalculatePrincipalComponents( const std::vector< Event*>& );
0073 void X2P( std::vector<Float_t>&, const std::vector<Float_t>&, Int_t cls ) const;
0074 void P2X( std::vector<Float_t>&, const std::vector<Float_t>&, Int_t cls ) const;
0075
0076
0077 std::vector<TVectorD*> fMeanValues;
0078 std::vector<TMatrixD*> fEigenVectors;
0079
0080 ClassDef(VariablePCATransform,0);
0081 };
0082
0083 }
0084
0085 #endif
0086