swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Tip revision: 2f1c5a9f1a9e6107f9291f9242c6befa8d790168 authored by Fons Rademakers on 14 May 2009, 16:16:09 UTC
tag patch release v5-22-00b.
tag patch release v5-22-00b.
Tip revision: 2f1c5a9
VariablePCATransform.h
// @(#)root/tmva $Id$
// Author: Andreas Hoecker, Joerg Stelzer, Helge Voss
/**********************************************************************************
* Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
* Package: TMVA *
* Class : VariablePCATransform *
* Web : http://tmva.sourceforge.net *
* *
* Description: *
* Principal value composition of input variables *
* *
* Authors (alphabetical): *
* Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
* Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
* Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
* *
* Copyright (c) 2005: *
* CERN, Switzerland *
* U. of Victoria, Canada *
* MPI-K Heidelberg, Germany *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted according to the terms listed in LICENSE *
* (http://tmva.sourceforge.net/LICENSE) *
**********************************************************************************/
#ifndef ROOT_TMVA_VariablePCATransform
#define ROOT_TMVA_VariablePCATransform
#include "TPrincipal.h"
#ifndef ROOT_TMVA_VariableTransformBase
#include "TMVA/VariableTransformBase.h"
#endif
namespace TMVA {
class VariablePCATransform : public VariableTransformBase {
public:
VariablePCATransform( std::vector<TMVA::VariableInfo>& );
virtual ~VariablePCATransform( void );
void ApplyTransformation( Types::ESBType type = Types::kMaxSBType ) const;
Bool_t PrepareTransformation( TTree* inputTree );
void WriteTransformationToStream ( std::ostream& ) const;
void ReadTransformationFromStream( std::istream& );
// provides string vector describing explicit transformation
std::vector<TString>* GetTransformationStrings( Types::ESBType type = Types::kMaxSBType ) const;
// writer of function code
virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part );
private:
void CalculatePrincipalComponents( TTree* originalTree );
void X2P( const Double_t*, Double_t*, Int_t index ) const;
TPrincipal* fPCA[2]; //! PCA [signal/background]
// store relevant parts of PCA locally
TVectorD* fMeanValues[2]; // mean values
TMatrixD* fEigenVectors[2]; // eigenvectors
ClassDef(VariablePCATransform,0) // Variable transformation: Principal Value Composition
};
} // namespace TMVA
#endif