Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:52

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  : GiniIndex                                                             *
0008  *                                             *
0009  *                                                                                *
0010  * Description: Implementation of the GiniIndex as separation criterion           *
0011  *              Large Gini Indices (maximum 0.5) mean , that the sample is well   *
0012  *              mixed (same amount of signal and bkg)                             *
0013  *              bkg. Small Indices mean, well separated.                          *
0014  *              general definition:                                               *
0015  *              Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 .... - (c(k)/N)^2    *
0016  *              Where: M is a sample of whatever N elements (events)              *
0017  *                     that belong to K different classes                         *
0018  *                     c(k) is the number of elements that belong to class k      *
0019  *              for just Signal and Background classes this boils down to:        *
0020  *              Gini(Sample) = 2s*b/(s+b)^2                                       *
0021  *                                                                                *
0022  *                                                                                *
0023  * Authors (alphabetical):                                                        *
0024  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
0025  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0026  *      Kai Voss        <Kai.Voss@cern.ch>       - U. of Victoria, Canada         *
0027  *                                                                                *
0028  * Copyright (c) 2005:                                                            *
0029  *      CERN, Switzerland                                                         *
0030  *      U. of Victoria, Canada                                                    *
0031  *      Heidelberg U., Germany                                                    *
0032  *                                                                                *
0033  * Redistribution and use in source and binary forms, with or without             *
0034  * modification, are permitted according to the terms listed in LICENSE           *
0035  * (http://ttmva.sourceforge.net/LICENSE)                                         *
0036  **********************************************************************************/
0037 
0038 #ifndef ROOT_TMVA_GiniIndex
0039 #define ROOT_TMVA_GiniIndex
0040 
0041 //////////////////////////////////////////////////////////////////////////
0042 //                                                                      //
0043 // GiniIndex                                                            //
0044 //                                                                      //
0045 // Implementation of the GiniIndex as separation criterion              //
0046 //                                                                      //
0047 //     Large Gini Indices (maximum 0.5) mean , that the sample is well  //
0048 //     mixed (same amount of signal and bkg)                            //
0049 //     bkg. Small Indices mean, well separated.                         //
0050 //     general definition:                                              //
0051 //     Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 .... - (c(k)/N)^2   //
0052 //     Where: M is a sample of whatever N elements (events)             //
0053 //            that belong to K different classes                        //
0054 //            c(k) is the number of elements that belong to class k     //
0055 //     for just Signal and Background classes this boils down to:       //
0056 //     Gini(Sample) = 2s*b/(s+b)^2                                      //
0057 //////////////////////////////////////////////////////////////////////////
0058 
0059 #include "TMVA/SeparationBase.h"
0060 
0061 namespace TMVA {
0062 
0063    class GiniIndex : public SeparationBase {
0064 
0065    public:
0066 
0067       // construtor for the GiniIndex
0068       GiniIndex() { fName="Gini"; }
0069 
0070       // copy constructor
0071    GiniIndex( const GiniIndex& g): SeparationBase(g) {}
0072 
0073       //destructor
0074       virtual ~GiniIndex(){}
0075 
0076       // Return the separation index (a measure for "purity" of the sample")
0077       virtual Double_t GetSeparationIndex( const Double_t s, const Double_t b );
0078 
0079    protected:
0080 
0081       ClassDef(GiniIndex,0); // Implementation of the GiniIndex as separation criterion
0082    };
0083 
0084 } // namespace TMVA
0085 
0086 #endif
0087