Logo ROOT  
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 #include "TMVA/RMethodBase.h"
25 #include <vector>
26 
27 namespace TMVA {
28 
29  class Factory; // DSMTEST
30  class Reader; // DSMTEST
31  class DataSetManager; // DSMTEST
32  class Types;
33  class MethodC50 : public RMethodBase {
34 
35  public :
36 
37  // constructors
38  MethodC50(const TString &jobName,
39  const TString &methodTitle,
40  DataSetInfo &theData,
41  const TString &theOption = "");
42 
44  const TString &theWeightFile);
45 
46 
47  ~MethodC50(void);
48  void Train();
49  // options treatment
50  void Init();
51  void DeclareOptions();
52  void ProcessOptions();
53  // create ranking
55  {
56  return NULL; // = 0;
57  }
58 
59 
60  Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
61 
62  // performs classifier testing
63  virtual void TestClassification();
64 
65 
66  Double_t GetMvaValue(Double_t *errLower = 0, Double_t *errUpper = 0);
67  virtual void MakeClass(const TString &classFileName = TString("")) const; //required for model persistence
69  // the actual "weights"
70  virtual void AddWeightsXMLTo(void * /*parent*/) const {} // = 0;
71  virtual void ReadWeightsFromXML(void * /*weight*/) {} // = 0;
72  virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
73 
74  // signal/background classification response for all current set of data
75  virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false);
76 
77  void ReadModelFromFile();
78  private :
80  friend class Factory; // DSMTEST
81  friend class Reader; // DSMTEST
82  protected:
83  //C5.0 function options
84  UInt_t fNTrials;//number of trials with boost enabled
85  Bool_t fRules;//A logical: should the tree be decomposed into a rule-based model?
86 
87  //Control options see C5.0Control
88  Bool_t fControlSubset; //A logical: should the model evaluate groups of discrete predictors for splits?
90  Bool_t fControlWinnow;// A logical: should predictor winnowing (i.e feature selection) be used?
91  Bool_t fControlNoGlobalPruning; //A logical to toggle whether the final, global pruning step to simplify the tree.
92  Double_t fControlCF; //A number in (0, 1) for the confidence factor.
93  UInt_t fControlMinCases;//an integer for the smallest number of samples that must be put in at least two of the splits.
94  Bool_t fControlFuzzyThreshold;//A logical toggle to evaluate possible advanced splits of the data. See Quinlan (1993) for details and examples.
95  Double_t fControlSample;//A value between (0, .999) that specifies the random proportion of the data should be used to train the model.
96  Int_t fControlSeed;//An integer for the random number seed within the C code.
97  Bool_t fControlEarlyStopping;// logical to toggle whether the internal method for stopping boosting should be used.
98 
101 
108  std::vector <TString > ListOfVariables;
109 
110 
111  // get help message text
112  void GetHelpMessage() const;
113 
114  ClassDef(MethodC50, 0)
115  };
116 } // namespace TMVA
117 #endif
TMVA::MethodC50::AddWeightsXMLTo
virtual void AddWeightsXMLTo(void *) const
Definition: MethodC50.h:70
TMVA::MethodBase::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)=0
TMVA::MethodC50::MakeClass
virtual void MakeClass(const TString &classFileName=TString("")) const
create reader class for method (classification only at present)
Definition: MethodC50.cxx:339
TMVA::Ranking
Ranking for variables in method (implementation)
Definition: Ranking.h:48
TMVA::MethodC50::fMvaCounter
UInt_t fMvaCounter
Definition: MethodC50.h:99
Long64_t
long long Long64_t
Definition: RtypesCore.h:80
TMVA::MethodC50::fControlSeed
Int_t fControlSeed
Definition: MethodC50.h:96
TMVA::MethodC50::fControlSubset
Bool_t fControlSubset
Definition: MethodC50.h:88
TMVA::MethodC50::fControlFuzzyThreshold
Bool_t fControlFuzzyThreshold
Definition: MethodC50.h:94
TMVA::MethodC50::ReadModelFromFile
void ReadModelFromFile()
Definition: MethodC50.cxx:324
TMVA::MethodC50::C50Control
ROOT::R::TRFunctionImport C50Control
Definition: MethodC50.h:104
TString
Basic string class.
Definition: TString.h:136
TMVA::MethodC50::Init
void Init()
Definition: MethodC50.cxx:123
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
ROOT::R::TRObject
This is a class to get ROOT's objects from R's objects.
Definition: TRObject.h:70
TMVA::MethodC50::Train
void Train()
Definition: MethodC50.cxx:134
bool
TMVA::MethodC50::ReadWeightsFromXML
virtual void ReadWeightsFromXML(void *)
Definition: MethodC50.h:71
TMVA::MethodC50::asfactor
ROOT::R::TRFunctionImport asfactor
Definition: MethodC50.h:105
TMVA::DataSetInfo
Class that contains all the data information.
Definition: DataSetInfo.h:62
TMVA::MethodC50::MethodC50
MethodC50(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
Definition: MethodC50.cxx:50
TMVA::MethodC50::fControlCF
Double_t fControlCF
Definition: MethodC50.h:92
TMVA::MethodC50::fDataSetManager
DataSetManager * fDataSetManager
Definition: MethodC50.h:79
TMVA::Types::EAnalysisType
EAnalysisType
Definition: Types.h:128
TMVA::MethodC50::fControlSample
Double_t fControlSample
Definition: MethodC50.h:95
TMVA::MethodC50::fRules
Bool_t fRules
Definition: MethodC50.h:85
TMVA::MethodC50::predict
ROOT::R::TRFunctionImport predict
Definition: MethodC50.h:102
TMVA::MethodC50::fModelControl
ROOT::R::TRObject fModelControl
Definition: MethodC50.h:107
TMVA::RMethodBase
Definition: RMethodBase.h:48
TMVA::MethodC50::fControlMinCases
UInt_t fControlMinCases
Definition: MethodC50.h:93
TMVA::Factory
This is the main MVA steering class.
Definition: Factory.h:80
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TMVA::MethodC50::HasAnalysisType
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Definition: MethodC50.cxx:115
unsigned int
TMVA::MethodC50::GetMvaValues
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
TMVA::MethodC50::C50
ROOT::R::TRFunctionImport C50
Definition: MethodC50.h:103
TMVA::MethodC50::fNTrials
UInt_t fNTrials
Definition: MethodC50.h:84
TMVA::DataSetManager
Class that contains all the data information.
Definition: DataSetManager.h:51
TMVA::MethodC50::TestClassification
virtual void TestClassification()
initialization
Definition: MethodC50.cxx:217
TMVA::MethodC50::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)
Definition: MethodC50.h:72
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::MethodC50::CreateRanking
const Ranking * CreateRanking()
Definition: MethodC50.h:54
TMVA::MethodC50::fControlEarlyStopping
Bool_t fControlEarlyStopping
Definition: MethodC50.h:97
TMVA::MethodC50::ListOfVariables
std::vector< TString > ListOfVariables
Definition: MethodC50.h:108
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMVA::MethodC50::fControlBands
UInt_t fControlBands
Definition: MethodC50.h:89
TMVA::MethodC50::fControlNoGlobalPruning
Bool_t fControlNoGlobalPruning
Definition: MethodC50.h:91
TMVA::MethodC50::IsModuleLoaded
static Bool_t IsModuleLoaded
Definition: MethodC50.h:100
ROOT::R::TRFunctionImport
This is a class to pass functions from ROOT to R.
Definition: TRFunctionImport.h:119
RMethodBase.h
type
int type
Definition: TGX11.cxx:121
TMVA::MethodC50::fModel
ROOT::R::TRObject * fModel
Definition: MethodC50.h:106
TMVA::MethodC50::ProcessOptions
void ProcessOptions()
Definition: MethodC50.cxx:196
TMVA::MethodC50::GetHelpMessage
void GetHelpMessage() const
Definition: MethodC50.cxx:304
TMVA::Reader
The Reader class serves to use the MVAs in a specific analysis context.
Definition: Reader.h:64
TMVA::MethodC50
Definition: MethodC50.h:33
TMVA::MethodC50::DeclareOptions
void DeclareOptions()
Definition: MethodC50.cxx:156
TMVA::MethodC50::fControlWinnow
Bool_t fControlWinnow
Definition: MethodC50.h:90
TMVA::MethodC50::GetMvaValue
Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)
Definition: MethodC50.cxx:225
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
int
TMVA::MethodC50::~MethodC50
~MethodC50(void)
Definition: MethodC50.cxx:109