Logo ROOT   6.07/09
Reference Guide
MethodC50.h
Go to the documentation of this file.
1 // @(#)root/tmva/rmva $Id$
2 // Author: Omar Zapata,Lorenzo Moneta, Sergei Gleyzer 2015
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : RMethodC50 *
8  * *
9  * Description: *
10  * R´s Package C50 method based on ROOTR *
11  * *
12  **********************************************************************************/
13 
14 #ifndef ROOT_TMVA_RMethodC50
15 #define ROOT_TMVA_RMethodC50
16 
17 //////////////////////////////////////////////////////////////////////////
18 // //
19 // RMethodC50 //
20 // //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TMVA_RMethodBase
25 #include "TMVA/RMethodBase.h"
26 #endif
27 
28 namespace TMVA {
29 
30  class Factory; // DSMTEST
31  class Reader; // DSMTEST
32  class DataSetManager; // DSMTEST
33  class Types;
34  class MethodC50 : public RMethodBase {
35 
36  public :
37 
38  // constructors
39  MethodC50(const TString &jobName,
40  const TString &methodTitle,
41  DataSetInfo &theData,
42  const TString &theOption = "");
43 
45  const TString &theWeightFile);
46 
47 
48  ~MethodC50(void);
49  void Train();
50  // options treatment
51  void Init();
52  void DeclareOptions();
53  void ProcessOptions();
54  // create ranking
56  {
57  return NULL; // = 0;
58  }
59 
60 
61  Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
62 
63  // performs classifier testing
64  virtual void TestClassification();
65 
66 
67  Double_t GetMvaValue(Double_t *errLower = 0, Double_t *errUpper = 0);
68  virtual void MakeClass(const TString &classFileName = TString("")) const; //required for model persistence
70  // the actual "weights"
71  virtual void AddWeightsXMLTo(void *parent) const {} // = 0;
72  virtual void ReadWeightsFromXML(void *wghtnode) {} // = 0;
73  virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
74 
75  // signal/background classification response for all current set of data
76  virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false);
77 
78  void ReadModelFromFile();
79  private :
81  friend class Factory; // DSMTEST
82  friend class Reader; // DSMTEST
83  protected:
84  //C5.0 function options
85  UInt_t fNTrials;//number of trials with boost enabled
86  Bool_t fRules;//A logical: should the tree be decomposed into a rule-based model?
87 
88  //Control options see C5.0Control
89  Bool_t fControlSubset; //A logical: should the model evaluate groups of discrete predictors for splits?
91  Bool_t fControlWinnow;// A logical: should predictor winnowing (i.e feature selection) be used?
92  Bool_t fControlNoGlobalPruning; //A logical to toggle whether the final, global pruning step to simplify the tree.
93  Double_t fControlCF; //A number in (0, 1) for the confidence factor.
94  UInt_t fControlMinCases;//an integer for the smallest number of samples that must be put in at least two of the splits.
95  Bool_t fControlFuzzyThreshold;//A logical toggle to evaluate possible advanced splits of the data. See Quinlan (1993) for details and examples.
96  Double_t fControlSample;//A value between (0, .999) that specifies the random proportion of the data should be used to train the model.
97  Int_t fControlSeed;//An integer for the random number seed within the C code.
98  Bool_t fControlEarlyStopping;// logical to toggle whether the internal method for stopping boosting should be used.
99 
102 
103  ROOT::R::TRFunctionImport predict;
104  ROOT::R::TRFunctionImport C50;
105  ROOT::R::TRFunctionImport C50Control;
106  ROOT::R::TRFunctionImport asfactor;
107  ROOT::R::TRObject *fModel;
108  ROOT::R::TRObject fModelControl;
109  std::vector <TString > ListOfVariables;
110 
111 
112  // get help message text
113  void GetHelpMessage() const;
114 
115  ClassDef(MethodC50, 0)
116  };
117 } // namespace TMVA
118 #endif
Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)
Definition: MethodC50.cxx:225
Int_t fControlSeed
Definition: MethodC50.h:97
long long Long64_t
Definition: RtypesCore.h:69
UInt_t fMvaCounter
Definition: MethodC50.h:100
EAnalysisType
Definition: Types.h:128
Bool_t fControlWinnow
Definition: MethodC50.h:91
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t fControlSubset
Definition: MethodC50.h:89
void ReadModelFromFile()
Definition: MethodC50.cxx:324
Double_t fControlCF
Definition: MethodC50.h:93
ROOT::R::TRFunctionImport C50Control
Definition: MethodC50.h:105
Bool_t fControlFuzzyThreshold
Definition: MethodC50.h:95
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t fControlSample
Definition: MethodC50.h:96
ROOT::R::TRFunctionImport asfactor
Definition: MethodC50.h:106
UInt_t fNTrials
Definition: MethodC50.h:85
virtual void TestClassification()
initialization
Definition: MethodC50.cxx:217
Bool_t fRules
Definition: MethodC50.h:86
MethodC50(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
Definition: MethodC50.cxx:50
virtual void AddWeightsXMLTo(void *parent) const
Definition: MethodC50.h:71
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void MakeClass(const TString &classFileName=TString("")) const
create reader class for method (classification only at present)
Definition: MethodC50.cxx:339
const Ranking * CreateRanking()
Definition: MethodC50.h:55
Bool_t fControlEarlyStopping
Definition: MethodC50.h:98
ROOT::R::TRObject fModelControl
Definition: MethodC50.h:108
DataSetManager * fDataSetManager
Definition: MethodC50.h:80
ROOT::R::TRFunctionImport predict
Definition: MethodC50.h:103
double Double_t
Definition: RtypesCore.h:55
UInt_t fControlMinCases
Definition: MethodC50.h:94
void GetHelpMessage() const
Definition: MethodC50.cxx:304
int type
Definition: TGX11.cxx:120
Bool_t fControlNoGlobalPruning
Definition: MethodC50.h:92
ROOT::R::TRFunctionImport C50
Definition: MethodC50.h:104
void DeclareOptions()
Definition: MethodC50.cxx:156
static Bool_t IsModuleLoaded
Definition: MethodC50.h:101
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Definition: MethodC50.cxx:115
std::vector< TString > ListOfVariables
Definition: MethodC50.h:109
UInt_t fControlBands
Definition: MethodC50.h:90
Abstract ClassifierFactory template that handles arbitrary types.
virtual std::vector< Double_t > GetMvaValues(Long64_t firstEvt=0, Long64_t lastEvt=-1, Bool_t logProgress=false)
get all the MVA values for the events of the current Data type
Definition: MethodC50.cxx:246
ROOT::R::TRObject * fModel
Definition: MethodC50.h:107
#define NULL
Definition: Rtypes.h:82
void ProcessOptions()
Definition: MethodC50.cxx:196
virtual void ReadWeightsFromStream(std::istream &)
Definition: MethodC50.h:73
virtual void ReadWeightsFromStream(std::istream &)=0
virtual void ReadWeightsFromXML(void *wghtnode)
Definition: MethodC50.h:72