Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
MethodRXGB.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 : RMethodRXGB *
8 * *
9 * Description: *
10 * R´s Package xgboost method based on ROOTR *
11 * *
12 **********************************************************************************/
13
14#ifndef ROOT_TMVA_RMethodXGB
15#define ROOT_TMVA_RMethodXGB
16
17//////////////////////////////////////////////////////////////////////////
18// //
19// RMethodRXGB //
20// //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TMVA/RMethodBase.h"
25#include <vector>
26
27namespace TMVA {
28
29 class Factory; // DSMTEST
30 class Reader; // DSMTEST
31 class DataSetManager; // DSMTEST
32 class Types;
33 class MethodRXGB: public RMethodBase {
34
35 public :
36
37 // constructors
39 const TString &methodTitle,
41 const TString &theOption = "");
42
44 const TString &theWeightFile);
45
46
47 ~MethodRXGB(void);
48 void Train() override;
49 // options treatment
50 void Init() override;
51 void DeclareOptions() override;
52 void ProcessOptions() override;
53 // create ranking
54 const Ranking *CreateRanking() override
55 {
56 return nullptr; // = 0;
57 }
58
59
61
62 // performs classifier testing
63 void TestClassification() override;
64
65
66 Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr) override;
67 void MakeClass(const TString &classFileName = TString("")) const override; //required for model persistence
69 // the actual "weights"
70 void AddWeightsXMLTo(void * /*parent*/) const override {} // = 0;
71 void ReadWeightsFromXML(void * /*wghtnode*/) override {} // = 0;
72 void ReadWeightsFromStream(std::istream &) override {} //= 0; // backward compatibility
73
74 void ReadModelFromFile();
75
76 // signal/background classification response for all current set of data
77 std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false) override;
78
79 private :
81 friend class Factory; // DSMTEST
82 friend class Reader; // DSMTEST
83 protected:
84
85
86 //RXGBfunction options
87 //https://github.com/dmlc/xgboost/blob/master/doc/parameter.md
92
93 std::vector<UInt_t> fFactorNumeric; //factors creations
94 //xgboost require a numeric factor then background=0 signal=1 from fFactorTrain
95
104
105
106 // get help message text
107 void GetHelpMessage() const override;
108
110 };
111} // namespace TMVA
112#endif
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
This is a class to pass functions from ROOT to R.
This is a class to get ROOT's objects from R's objects.
Definition TRObject.h:70
Class that contains all the data information.
Definition DataSetInfo.h:62
Class that contains all the data information.
This is the main MVA steering class.
Definition Factory.h:80
void ReadWeightsFromStream(std::istream &) override=0
std::vector< UInt_t > fFactorNumeric
Definition MethodRXGB.h:93
void Init() override
void AddWeightsXMLTo(void *) const override
Definition MethodRXGB.h:70
ROOT::R::TRFunctionImport xgbtrain
Definition MethodRXGB.h:97
MethodRXGB(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
static Bool_t IsModuleLoaded
Definition MethodRXGB.h:91
ROOT::R::TRFunctionImport asmatrix
Definition MethodRXGB.h:102
void DeclareOptions() override
void Train() override
std::vector< Double_t > GetMvaValues(Long64_t firstEvt=0, Long64_t lastEvt=-1, Bool_t logProgress=false) override
get all the MVA values for the events of the current Data type
const Ranking * CreateRanking() override
Definition MethodRXGB.h:54
void ReadWeightsFromXML(void *) override
Definition MethodRXGB.h:71
ROOT::R::TRFunctionImport xgbload
Definition MethodRXGB.h:100
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override
Double_t GetMvaValue(Double_t *errLower=nullptr, Double_t *errUpper=nullptr) override
ROOT::R::TRFunctionImport asfactor
Definition MethodRXGB.h:101
void GetHelpMessage() const override
ROOT::R::TRFunctionImport xgbsave
Definition MethodRXGB.h:99
ROOT::R::TRObject * fModel
Definition MethodRXGB.h:103
ROOT::R::TRFunctionImport xgbdmatrix
Definition MethodRXGB.h:98
void MakeClass(const TString &classFileName=TString("")) const override
create reader class for method (classification only at present)
void ProcessOptions() override
ROOT::R::TRFunctionImport predict
Definition MethodRXGB.h:96
void ReadWeightsFromStream(std::istream &) override
Definition MethodRXGB.h:72
DataSetManager * fDataSetManager
Definition MethodRXGB.h:80
void TestClassification() override
initialization
Ranking for variables in method (implementation)
Definition Ranking.h:48
The Reader class serves to use the MVAs in a specific analysis context.
Definition Reader.h:64
Basic string class.
Definition TString.h:138
create variable transformations