ROOT  6.06/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  TDirectory *theTargetDir = NULL);
44 
46  const TString &theWeightFile,
47  TDirectory *theTargetDir = NULL);
48 
49 
50  ~MethodC50(void);
51  void Train();
52  // options treatment
53  void Init();
54  void DeclareOptions();
55  void ProcessOptions();
56  // create ranking
58  {
59  return NULL; // = 0;
60  }
61 
62 
63  Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
64 
65  // performs classifier testing
66  virtual void TestClassification();
67 
68 
69  Double_t GetMvaValue(Double_t *errLower = 0, Double_t *errUpper = 0);
70  virtual void MakeClass(const TString &classFileName = TString("")) const; //required for model persistence
72  // the actual "weights"
73  virtual void AddWeightsXMLTo(void *parent) const {} // = 0;
74  virtual void ReadWeightsFromXML(void *wghtnode) {} // = 0;
75  virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
76 
77  void ReadStateFromFile();
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
Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)
Definition: MethodC50.cxx:225
Int_t fControlSeed
Definition: MethodC50.h:96
UInt_t fMvaCounter
Definition: MethodC50.h:99
EAnalysisType
Definition: Types.h:124
Bool_t fControlWinnow
Definition: MethodC50.h:90
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:88
Double_t fControlCF
Definition: MethodC50.h:92
ROOT::R::TRFunctionImport C50Control
Definition: MethodC50.h:104
Bool_t fControlFuzzyThreshold
Definition: MethodC50.h:94
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t fControlSample
Definition: MethodC50.h:95
static Bool_t IsModuleLoaded
Definition: MethodC50.h:100
ROOT::R::TRFunctionImport asfactor
Definition: MethodC50.h:105
MethodC50(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="", TDirectory *theTargetDir=NULL)
UInt_t fNTrials
Definition: MethodC50.h:84
virtual void TestClassification()
initialization
Definition: MethodC50.cxx:217
This is a class to get ROOT's objects from R's objects
Definition: TRObject.h:73
This is a class to pass functions from ROOT to R.
Bool_t fRules
Definition: MethodC50.h:85
virtual void AddWeightsXMLTo(void *parent) const
Definition: MethodC50.h:73
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:280
const Ranking * CreateRanking()
Definition: MethodC50.h:57
Bool_t fControlEarlyStopping
Definition: MethodC50.h:97
ROOT::R::TRObject fModelControl
Definition: MethodC50.h:107
DataSetManager * fDataSetManager
Definition: MethodC50.h:79
ROOT::R::TRFunctionImport predict
Definition: MethodC50.h:102
double Double_t
Definition: RtypesCore.h:55
UInt_t fControlMinCases
Definition: MethodC50.h:93
Describe directory structure in memory.
Definition: TDirectory.h:41
void GetHelpMessage() const
Definition: MethodC50.cxx:245
int type
Definition: TGX11.cxx:120
Bool_t fControlNoGlobalPruning
Definition: MethodC50.h:91
ROOT::R::TRFunctionImport C50
Definition: MethodC50.h:103
void DeclareOptions()
Definition: MethodC50.cxx:156
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Definition: MethodC50.cxx:118
std::vector< TString > ListOfVariables
Definition: MethodC50.h:108
UInt_t fControlBands
Definition: MethodC50.h:89
Abstract ClassifierFactory template that handles arbitrary types.
ROOT::R::TRObject * fModel
Definition: MethodC50.h:106
#define NULL
Definition: Rtypes.h:82
void ProcessOptions()
Definition: MethodC50.cxx:196
virtual void ReadWeightsFromStream(std::istream &)
Definition: MethodC50.h:75
void ReadStateFromFile()
Definition: MethodC50.cxx:265
virtual void ReadWeightsFromStream(std::istream &)=0
virtual void ReadWeightsFromXML(void *wghtnode)
Definition: MethodC50.h:74