library: libTMVA
#include "MethodFisher.h"

TMVA::MethodFisher


class description - header file - source file - inheritance tree (.pdf)

class TMVA::MethodFisher : public TMVA::MethodBase

Inheritance Chart:
TObject
<-
TMVA::MethodBase
<-
TMVA::MethodFisher
    private:
void GetCov_BetweenClass() void GetCov_Full() void GetCov_WithinClass() void GetDiscrimPower() void GetFisherCoeff() void GetMean() void Init() void InitFisher() void PrintCoefficients() public:
MethodFisher(TString jobName, vector<TString>* theVariables, TTree* theTree = 0, TString theOption = Fisher, TDirectory* theTargetDir = 0) MethodFisher(vector<TString>* theVariables, TString theWeightFile, TDirectory* theTargetDir = NULL) MethodFisher(const TMVA::MethodFisher&) virtual ~MethodFisher() static TClass* Class() virtual TMVA::MethodFisher::FisherMethod GetMethod() virtual Double_t GetMvaValue(TMVA::Event* e) virtual TClass* IsA() const TMVA::MethodFisher& operator=(const TMVA::MethodFisher&) virtual void ReadWeightsFromFile() virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual void Train() virtual void WriteHistosToFile() virtual void WriteWeightsToFile()

Data Members

    private:
Int_t fNevt total number of events Int_t fNsig number of signal events Int_t fNbgd number of background events TMatrixF* fSig variables for signal TMatrixF* fBgd variables for background TMatrixD* fMeanMatx TMatrixD* fBetw between-class matrix TMatrixD* fWith within-class matrix TMatrixD* fCov full covariance matrix vector<Double_t>* fDiscrimPow vector<Double_t>* fFisherCoeff Double_t fF0 TMVA::MethodFisher::FisherMethod fFisherMethod public:
static const TMVA::MethodFisher::FisherMethod kFisher static const TMVA::MethodFisher::FisherMethod kMahalanobis

Class Description

_______________________________________________________________________
 
Fisher and Mahalanobis Discriminants (Linear Discriminant Analysis)

In the method of Fisher discriminants event selection is performed in a transformed variable space with zero linear correlations, by distinguishing the mean values of the signal and background distributions.

The linear discriminant analysis determines an axis in the (correlated) hyperspace of the input variables such that, when projecting the output classes (signal and background) upon this axis, they are pushed as far as possible away from each other, while events of a same class are confined in a close vicinity. The linearity property of this method is reflected in the metric with which "far apart" and "close vicinity" are determined: the covariance matrix of the discriminant variable space.

The classification of the events in signal and background classes relies on the following characteristics (only): overall sample means, xi, for each input variable, i, class-specific sample means, xS(B),i, and total covariance matrix Tij. The covariance matrix can be decomposed into the sum of a within- (Wij) and a between-class (Bij) class matrix. They describe the dispersion of events relative to the means of their own class (within-class matrix), and relative to the overall sample means (between-class matrix). The Fisher coefficients, Fi, are then given by

where in TMVA is set NS=NB, so that the factor in front of the sum simplifies to ½. The Fisher discriminant then reads
The offset F0 centers the sample mean of xFi at zero. Instead of using the within-class matrix, the Mahalanobis variant determines the Fisher coefficients as follows:
with resulting xMa that are very similar to the xFi.

TMVA provides two outputs for the ranking of the input variables:

The corresponding numbers are printed on standard output.
_______________________________________________________________________
MethodFisher( TString jobName, vector<TString>* theVariables, TTree* theTree, TString theOption, TDirectory* theTargetDir )
 standard constructor for the "boosted decision trees"

 MethodFisher options:
 format and syntax of option string: "type"
 where type is "Fisher" or "Mahalanobis"

MethodFisher( vector<TString> *theVariables, TString theWeightFile, TDirectory* theTargetDir )
 constructor to calculate the Fisher-MVA from previously generatad
 coefficients (weight file)
void InitFisher( void )
 default initialisation called by all constructors
~MethodFisher( void )
 destructor
void Train( void )
 computation of Fisher coefficients by series of matrix operations
Double_t GetMvaValue( TMVA::Event *e )
 returns the Fisher value (no fixed range)
void Init( void )
 initialisaton method; creates global matrices and vectors
 should never be called without existing trainingTree
void GetMean( void )
 compute mean values of variables in each sample, and the overall means
void GetCov_WithinClass( void )
 the matrix of covariance 'within class' reflects the dispersion of the
 events relative to the center of gravity of their own class
void GetCov_BetweenClass( void )
 the matrix of covariance 'between class' reflects the dispersion of the
 events of a class relative to the global center of gravity of all the class
 hence the separation between classes
void GetCov_Full( void )
 compute full covariance matrix from sum of within and between matrices
void GetFisherCoeff( void )
 Fisher = Sum { [coeff]*[variables] }

 let Xs be the array of the mean values of variables for signal evts
 let Xb be the array of the mean values of variables for backgd evts
 let InvWith be the inverse matrix of the 'within class' correlation matrix

 then the array of Fisher coefficients is
 [coeff] =sqrt(fNsig*fNbgd)/fNevt*transpose{Xs-Xb}*InvWith
void GetDiscrimPower( void )
 computation of discrimination power indicator for each variable
 small values of "fWith" indicates little compactness of sig & of backgd
 big values of "fBetw" indicates large separation between sig & backgd

 we want signal & backgd classes as compact and separated as possible
 the discriminating power is then defined as the ration "fBetw/fWith"
void PrintCoefficients( void )
 display Fisher coefficients and discriminating power for each variable
 check maximum length of variable name
void WriteWeightsToFile( void )
 write Fisher coefficients to weight file
void ReadWeightsFromFile( void )
 read Fisher coefficients from weight file
void WriteHistosToFile( void )
 write special monitoring histograms to file - not implemented for Fisher
MethodFisher( TString jobName, vector<TString>* theVariables, TTree* theTree = 0, TString theOption = "Fisher", TDirectory* theTargetDir = 0 )
FisherMethod GetMethod( void )

Author: Andreas Hoecker, Xavier Prudent, Joerg Stelzer, Helge Voss, Kai Voss
Last update: root/tmva $Id: MethodFisher.cxx,v 1.4 2006/05/23 19:35:06 brun Exp $
Copyright (c) 2005: *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.