147 Error(
"Init",
"R's package RSNNS can not be loaded.");
148 Log() << kFATAL <<
" R's package RSNNS can not be loaded."
157 for (UInt_t i = 0; i <
size; i++) {
165 if (
Data()->GetNTrainingEvents() == 0)
Log() << kFATAL <<
"<Train> Data() has zero events" <<
Endl;
168 if (
fPruneFunc ==
"NULL") PruneFunc =
r.Eval(
"NULL");
194 r[
"RMLPModel"] << Model;
195 r <<
"save(RMLPModel,file='" + path +
"')";
223 other functions, these have to be given in a named list. See\
224 the pruning demos for further explanation.the update function to use");
232 Log() << kERROR <<
" fMaxit <=0... that does not work !! "
233 <<
" I set it to 50 .. just so that the program does not crash"
245 Log() << kINFO <<
"Testing Classification " <<
fNetType <<
" METHOD " <<
Endl;
259 for (UInt_t i = 0; i < nvar; i++) {
266 mvaValue = result[0];
275 if (firstEvt > lastEvt || lastEvt > nEvents) lastEvt = nEvents;
276 if (firstEvt < 0) firstEvt = 0;
278 nEvents = lastEvt-firstEvt;
290 std::vector<std::vector<Float_t> > inputData(nvars);
291 for (UInt_t i = 0; i < nvars; i++) {
292 inputData[i] = std::vector<Float_t>(nEvents);
295 for (
Int_t ievt=firstEvt; ievt<lastEvt; ievt++) {
298 assert(nvars ==
e->GetNVariables());
299 for (UInt_t i = 0; i < nvars; i++) {
300 inputData[i][ievt] =
e->GetValue(i);
307 for (UInt_t i = 0; i < nvars; i++) {
313 std::vector<Double_t> mvaValues(nEvents);
316 mvaValues = result.
As<std::vector<Double_t>>();
321 Log() << kINFO <<
Form(
"Dataset[%s] : ",
DataInfo().
GetName())<<
"Elapsed time for evaluation of " << nEvents <<
" events: "
338 r <<
"load('" + path +
"')";
340 r[
"RMLPModel"] >> Model;
356 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.
TVectorT< Double_t > TVectorD
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 NoErrorCalc(Double_t *const err, Double_t *const errUpper)
static Bool_t IsModuleLoaded
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override
ROOT::R::TRFunctionImport asfactor
virtual 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
Double_t GetMvaValue(Double_t *errLower=nullptr, Double_t *errUpper=nullptr) override
void GetHelpMessage() const override
ROOT::R::TRFunctionImport predict
TString fUpdateFuncParams
void ProcessOptions() override
void DeclareOptions() override
MethodRSNNS(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
std::vector< UInt_t > fFactorNumeric
ROOT::R::TRFunctionImport mlp
ROOT::R::TRObject * fModel
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)