57 predict("predict", "xgboost"),
59 xgbdmatrix("xgb.DMatrix"),
62 asfactor("
as.factor"),
63 asmatrix("
as.matrix"),
69 SetWeightFileDir(
gConfig().GetIONames().fWeightFileDir);
78 predict(
"predict",
"xgboost"),
80 xgbdmatrix(
"xgb.DMatrix"),
83 asfactor(
"as.factor"),
84 asmatrix(
"as.matrix"),
112 Error(
"Init",
"R's package xgboost can not be loaded.");
113 Log() <<
kFATAL <<
" R's package xgboost can not be loaded."
122 for (
UInt_t i = 0; i < size; i++) {
133 if (
Data()->GetNTrainingEvents() == 0)
Log() <<
kFATAL <<
"<Train> Data() has zero events" <<
Endl;
136 params[
"eta"] =
fEta;
157 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.");
169 Log() <<
kINFO <<
"Testing Classification RXGB METHOD " <<
Endl;
182 for (
UInt_t i = 0; i < nvar; i++) {
203 Log() <<
"Decision Trees and Rule-Based Models " <<
Endl;
217 TString path = GetWeightFileDir() +
"/RXGBModel.RData";
222 SEXP Model = xgbload(path);
ROOT::R::TRFunctionImport xgbdmatrix
const TString & GetWeightFileDir() const
MsgLogger & Endl(MsgLogger &ml)
Namespace for new ROOT classes and functions.
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
ROOT::R::TRObject * fModel
UInt_t GetNVariables() const
MethodRXGB(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="", TDirectory *theTargetDir=NULL)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Bool_t Require(TString pkg)
Method to load an R's package.
virtual void MakeClass(const TString &classFileName=TString("")) const
create reader class for method (classification only at present)
This is a class to get ROOT's objects from R's objects
std::vector< std::string > fFactorTrain
ROOT::R::TRFunctionImport xgbsave
void GetHelpMessage() const
const Event * GetEvent() const
ROOT::R::TRFunctionImport asmatrix
static Bool_t IsModuleLoaded
Describe directory structure in memory.
virtual void TestClassification()
initialization
static TRInterface & Instance()
static method to get an TRInterface instance reference
DataSetInfo & DataInfo() const
#define REGISTER_METHOD(CLASS)
for example
Abstract ClassifierFactory template that handles arbitrary types.
std::vector< Float_t > & GetValues()
ROOT::R::TRDataFrame fDfTrain
void SetWeightFileDir(TString fileDir)
set directory of weight file
ROOT::R::TRFunctionImport predict
std::vector< TString > GetListOfVariables() const
returns list of variables
Rcpp::internal::NamedPlaceHolder Label
Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)
virtual void TestClassification()
initialization
ROOT::R::TRFunctionImport xgbtrain
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
This is a class to create DataFrames from ROOT to R
std::vector< UInt_t > fFactorNumeric