107 Error(
"Init",
"R's package xgboost can not be loaded.");
108 Log() << kFATAL <<
" R's package xgboost can not be loaded."
117 for (UInt_t i = 0; i <
size; i++) {
128 if (
Data()->GetNTrainingEvents() == 0)
Log() << kFATAL <<
"<Train> Data() has zero events" <<
Endl;
131 params[
"eta"] =
fEta;
155 DeclareOptionRef(
fEta,
"Eta",
"Step size shrinkage used in update to prevents overfitting. After each boosting step, we can directly get the weights of new features. and eta actually shrinks the feature weights to make the boosting process more conservative.");
167 Log() << kINFO <<
"Testing Classification RXGB METHOD " <<
Endl;
180 for (UInt_t i = 0; i < nvar; i++) {
195 if (firstEvt > lastEvt || lastEvt > nEvents) lastEvt = nEvents;
196 if (firstEvt < 0) firstEvt = 0;
198 nEvents = lastEvt-firstEvt;
210 std::vector<std::vector<Float_t> > inputData(nvars);
211 for (UInt_t i = 0; i < nvars; i++) {
212 inputData[i] = std::vector<Float_t>(nEvents);
215 for (
Int_t ievt=firstEvt; ievt<lastEvt; ievt++) {
218 assert(nvars ==
e->GetNVariables());
219 for (UInt_t i = 0; i < nvars; i++) {
220 inputData[i][ievt] =
e->GetValue(i);
227 for (UInt_t i = 0; i < nvars; i++) {
233 std::vector<Double_t> mvaValues(nEvents);
235 mvaValues = pred.
As<std::vector<Double_t>>();
238 Log() << kINFO <<
Form(
"Dataset[%s] : ",
DataInfo().
GetName())<<
"Elapsed time for evaluation of " << nEvents <<
" events: "
255 Log() <<
"Decision Trees and Rule-Based Models " <<
Endl;
#define REGISTER_METHOD(CLASS)
for example
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
This is a class to create DataFrames from ROOT to R.
static TRInterface & Instance()
static method to get an TRInterface instance reference
Bool_t Require(TString pkg)
Method to load an R's package.
This is a class to get ROOT's objects from R's objects.
T As()
Some datatypes of ROOT or c++ can be wrapped in to a TRObject, this method lets you unwrap those data...
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
Class that contains all the data information.
UInt_t GetNVariables() const
std::vector< TString > GetListOfVariables() const
returns list of variables
const Event * GetEvent() const
returns event without transformations
Types::ETreeType GetCurrentType() const
Long64_t GetNEvents(Types::ETreeType type=Types::kMaxTreeType) const
UInt_t GetNVariables() const
access the number of variables through the datasetinfo
void SetCurrentEvent(Long64_t ievt) const
std::vector< Float_t > & GetValues()
const char * GetName() const override
Bool_t IsModelPersistence() const
const TString & GetWeightFileDir() const
const TString & GetMethodName() const
const Event * GetEvent() const
DataSetInfo & DataInfo() const
virtual void TestClassification()
initialization
void ReadStateFromFile()
Function to write options and weights to file.
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
std::vector< UInt_t > fFactorNumeric
ROOT::R::TRFunctionImport xgbtrain
MethodRXGB(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
static Bool_t IsModuleLoaded
ROOT::R::TRFunctionImport asmatrix
void DeclareOptions() 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
ROOT::R::TRFunctionImport xgbload
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
void GetHelpMessage() const override
ROOT::R::TRFunctionImport xgbsave
ROOT::R::TRObject * fModel
ROOT::R::TRFunctionImport xgbdmatrix
void MakeClass(const TString &classFileName=TString("")) const override
create reader class for method (classification only at present)
void ProcessOptions() override
ROOT::R::TRFunctionImport predict
void TestClassification() override
initialization
std::vector< std::string > fFactorTrain
ROOT::R::TRDataFrame fDfTrain
RMethodBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &dsi, const TString &theOption="", ROOT::R::TRInterface &_r=ROOT::R::TRInterface::Instance())
Timing information for training and evaluation of MVA methods.
TString GetElapsedTime(Bool_t Scientific=kTRUE)
returns pretty string with elapsed time
Singleton class for Global types used by TMVA.
const Rcpp::internal::NamedPlaceHolder & Label
create variable transformations
MsgLogger & Endl(MsgLogger &ml)