Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:04

0001 // @(#)root/tmva $Id$
0002 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : RegressionVariance                                                    *
0008  *                                             *
0009  *                                                                                *
0010  * Description: Calculate the separation criteria used in regression              *
0011  *                                                                                *
0012  *          There are two things: the Separation Index, and the Separation Gain   *
0013  *          Separation Index:                                                     *
0014  *          Measure of the "Variance" of a sample.                                *
0015  *                                                                                *
0016  *          Separation Gain:                                                      *
0017  *          the measure of how the quality of separation of the sample increases  *
0018  *          by splitting the sample e.g. into a "left-node" and a "right-node"    *
0019  *          (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right)  *
0020  *          this is then the quality criteria which is optimized for when trying  *
0021  *          to increase the information in the system (making the best selection  *
0022  *                                                                                *
0023  *                                                                                *
0024  * Authors (alphabetical):                                                        *
0025  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0026  *                                                                                *
0027  * Copyright (c) 2005:                                                            *
0028  *      CERN, Switzerland                                                         *
0029  *      U. of Victoria, Canada                                                    *
0030  *      Heidelberg U., Germany                                                    *
0031  *                                                                                *
0032  * Redistribution and use in source and binary forms, with or without             *
0033  * modification, are permitted according to the terms listed in LICENSE           *
0034  * (see tmva/doc/LICENSE)                                          *
0035  **********************************************************************************/
0036 
0037 #ifndef ROOT_TMVA_RegressionVariance
0038 #define ROOT_TMVA_RegressionVariance
0039 
0040 //////////////////////////////////////////////////////////////////////////
0041 //                                                                      //
0042 // RegressionVariance                                                   //
0043 //                                                                      //
0044 // Calculate the "SeparationGain" for Regression analysis               //
0045 // separation criteria used in various training algorithms              //
0046 //                                                                      //
0047 // There are two things: the Separation Index, and the Separation Gain  //
0048 // Separation Index:                                                    //
0049 // Measure of the "Variance" of a sample.                               //
0050 //                                                                      //
0051 // Separation Gain:                                                     //
0052 // the measure of how the quality of separation of the sample increases //
0053 // by splitting the sample e.g. into a "left-node" and a "right-node"   //
0054 // (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right) //
0055 // this is then the quality criteria which is optimized for when trying //
0056 // to increase the information in the system (making the best selection //
0057 //                                                                      //
0058 //////////////////////////////////////////////////////////////////////////
0059 
0060 #include "Rtypes.h"
0061 
0062 #include "TString.h"
0063 
0064 namespace TMVA {
0065 
0066    class RegressionVariance {
0067 
0068    public:
0069 
0070       //default constructor
0071       RegressionVariance(){fName = "Variance for Regression";}
0072 
0073       //copy constructor
0074    RegressionVariance( const RegressionVariance& s ): fName ( s.fName ) {}
0075 
0076       // destructor
0077       virtual ~RegressionVariance(){}
0078 
0079       // Return the gain in separation of the original sample is split in two sub-samples
0080       // (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right)
0081       Double_t GetSeparationGain( const Double_t nLeft, const Double_t targetLeft, const Double_t target2Left,
0082                                   const Double_t nTot, const Double_t targetTot, const Double_t target2Tot );
0083 
0084       // Return the separation index (a measure for "purity" of the sample")
0085       virtual Double_t GetSeparationIndex( const Double_t n, const Double_t target, const Double_t target2 );
0086 
0087       // Return the name of the concrete Index implementation
0088       TString GetName() { return fName; }
0089 
0090    protected:
0091 
0092       TString fName;  ///< name of the concrete Separation Index implementation
0093 
0094       ClassDef(RegressionVariance,0); // Interface to different separation criteria used in training algorithms
0095    };
0096 
0097 
0098 } // namespace TMVA
0099 
0100 #endif