// @(#)root/tmva $Id$ 
// Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss 

/**********************************************************************************
 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
 * Package: TMVA                                                                  *
 * Class  : GiniIndex                                                             *
 * Web    : http://tmva.sourceforge.net                                           *
 *                                                                                *
 * Description: Implementation of the GiniIndex as separation criterion           *
 *              Large Gini Indices (maximum 0.5) mean , that the sample is well   *
 *              mixed (same amount of signal and bkg)                             *
 *              bkg. Small Indices mean, well separated.                          *
 *              general defniniton:                                               *     
 *              Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 .... - (c(k)/N)^2    * 
 *              Where: M is a smaple of whatever N elements (events)              *
 *                     that belong to K different classes                         *
 *                     c(k) is the number of elements that belong to class k      *
 *              for just Signal and Background classes this boils down to:        *
 *              Gini(Sample) = 2s*b/(s+b)^2                                       *
 *                                                                                *
 *                                                                                *
 * Authors (alphabetical):                                                        *
 *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
 *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
 *      Kai Voss        <Kai.Voss@cern.ch>       - U. of Victoria, Canada         *
 *                                                                                *
 * Copyright (c) 2005:                                                            *
 *      CERN, Switzerland                                                         * 
 *      U. of Victoria, Canada                                                    * 
 *      Heidelberg U., Germany                                                    * 
 *                                                                                *
 * Redistribution and use in source and binary forms, with or without             *
 * modification, are permitted according to the terms listed in LICENSE           *
 * (http://ttmva.sourceforge.net/LICENSE)                                         *
 **********************************************************************************/

#ifndef ROOT_TMVA_GiniIndex
#define ROOT_TMVA_GiniIndex

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// GiniIndex                                                            //
//                                                                      //
// Implementation of the GiniIndex as separation criterion              //
//                                                                      //
//     Large Gini Indices (maximum 0.5) mean , that the sample is well  //
//     mixed (same amount of signal and bkg)                            //
//     bkg. Small Indices mean, well separated.                         //
//     general defniniton:                                              //     
//     Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 .... - (c(k)/N)^2   // 
//     Where: M is a smaple of whatever N elements (events)             //
//            that belong to K different classes                        //
//            c(k) is the number of elements that belong to class k     //
//     for just Signal and Background classes this boils down to:       //
//     Gini(Sample) = 2s*b/(s+b)^2                                      //  
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TMVA_SeparationBase
#include "TMVA/SeparationBase.h"
#endif

namespace TMVA {

   class GiniIndex : public SeparationBase {
      
   public:
      
      // construtor for the GiniIndex
      GiniIndex() { fName="Gini"; }

      // copy constructor
      GiniIndex( const GiniIndex& g): SeparationBase(g) {}

      //destructor
      virtual ~GiniIndex(){}
      
      // Return the separation index (a measure for "purity" of the sample")
      virtual Double_t GetSeparationIndex( const Double_t &s, const Double_t &b );

   protected:
      
      ClassDef(GiniIndex,0) // Implementation of the GiniIndex as separation criterion
   };  

} // namespace TMVA

#endif

 GiniIndex.h:1
 GiniIndex.h:2
 GiniIndex.h:3
 GiniIndex.h:4
 GiniIndex.h:5
 GiniIndex.h:6
 GiniIndex.h:7
 GiniIndex.h:8
 GiniIndex.h:9
 GiniIndex.h:10
 GiniIndex.h:11
 GiniIndex.h:12
 GiniIndex.h:13
 GiniIndex.h:14
 GiniIndex.h:15
 GiniIndex.h:16
 GiniIndex.h:17
 GiniIndex.h:18
 GiniIndex.h:19
 GiniIndex.h:20
 GiniIndex.h:21
 GiniIndex.h:22
 GiniIndex.h:23
 GiniIndex.h:24
 GiniIndex.h:25
 GiniIndex.h:26
 GiniIndex.h:27
 GiniIndex.h:28
 GiniIndex.h:29
 GiniIndex.h:30
 GiniIndex.h:31
 GiniIndex.h:32
 GiniIndex.h:33
 GiniIndex.h:34
 GiniIndex.h:35
 GiniIndex.h:36
 GiniIndex.h:37
 GiniIndex.h:38
 GiniIndex.h:39
 GiniIndex.h:40
 GiniIndex.h:41
 GiniIndex.h:42
 GiniIndex.h:43
 GiniIndex.h:44
 GiniIndex.h:45
 GiniIndex.h:46
 GiniIndex.h:47
 GiniIndex.h:48
 GiniIndex.h:49
 GiniIndex.h:50
 GiniIndex.h:51
 GiniIndex.h:52
 GiniIndex.h:53
 GiniIndex.h:54
 GiniIndex.h:55
 GiniIndex.h:56
 GiniIndex.h:57
 GiniIndex.h:58
 GiniIndex.h:59
 GiniIndex.h:60
 GiniIndex.h:61
 GiniIndex.h:62
 GiniIndex.h:63
 GiniIndex.h:64
 GiniIndex.h:65
 GiniIndex.h:66
 GiniIndex.h:67
 GiniIndex.h:68
 GiniIndex.h:69
 GiniIndex.h:70
 GiniIndex.h:71
 GiniIndex.h:72
 GiniIndex.h:73
 GiniIndex.h:74
 GiniIndex.h:75
 GiniIndex.h:76
 GiniIndex.h:77
 GiniIndex.h:78
 GiniIndex.h:79
 GiniIndex.h:80
 GiniIndex.h:81
 GiniIndex.h:82
 GiniIndex.h:83
 GiniIndex.h:84
 GiniIndex.h:85
 GiniIndex.h:86
 GiniIndex.h:87
 GiniIndex.h:88
 GiniIndex.h:89