47 Bool_t MethodRSNNS::IsModuleLoaded = ROOT::
R::TRInterface::Instance().Require("RSNNS");
55 RMethodBase(jobName,
Types::kRSNNS, methodTitle, dsi, theOption, theTargetDir),
59 asfactor("
as.factor"),
62 fNetType = methodTitle;
63 if (fNetType !=
"RMLP") {
64 Log() <<
kFATAL <<
" Unknow Method" + fNetType
74 fInitFunc =
"Randomize_Weights";
75 fInitFuncParams =
"c(-0.3,0.3)";
77 fLearnFunc =
"Std_Backpropagation";
78 fLearnFuncParams =
"c(0.2,0)";
80 fUpdateFunc =
"Topological_Order";
81 fUpdateFuncParams =
"c(0)";
83 fHiddenActFunc =
"Act_Logistic";
84 fShufflePatterns =
kTRUE;
87 fPruneFuncParams =
"NULL";
89 SetWeightFileDir(
gConfig().GetIONames().fWeightFileDir);
98 asfactor(
"as.factor"),
151 Error(
"Init",
"R's package RSNNS can not be loaded.");
152 Log() <<
kFATAL <<
" R's package RSNNS can not be loaded."
161 for (
UInt_t i = 0; i < size; i++) {
169 if (
Data()->GetNTrainingEvents() == 0)
Log() <<
kFATAL <<
"<Train> Data() has zero events" <<
Endl;
187 ROOT::R::Label[
"libOut"] =
fLinOut,
188 ROOT::R::Label[
"pruneFunc"] = PruneFunc,
195 r[
"RMLPModel"] << Model;
196 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"
259 for (
UInt_t i = 0; i < nvar; i++) {
267 mvaValue = result[0];
275 TString path = GetWeightFileDir() +
"/RMLPModel.RData";
279 r <<
"load('" + path +
"')";
281 r[
"RMLPModel"] >> Model;
297 Log() <<
"Decision Trees and Rule-Based Models " <<
Endl;
const TString & GetWeightFileDir() const
MsgLogger & Endl(MsgLogger &ml)
void GetHelpMessage() const
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
ROOT::R::TRFunctionImport predict
std::vector< UInt_t > fFactorNumeric
ROOT::R::TRObject * fModel
MethodRSNNS(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="", TDirectory *theTargetDir=NULL)
UInt_t GetNVariables() const
Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)
virtual void TestClassification()
initialization
const char * Data() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TString fUpdateFuncParams
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
std::vector< std::string > fFactorTrain
const Event * GetEvent() const
char * Form(const char *fmt,...)
ROOT::R::TRFunctionImport mlp
static Bool_t IsModuleLoaded
Describe directory structure in memory.
static TRInterface & Instance()
static method to get an TRInterface instance reference
DataSetInfo & DataInfo() const
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
#define REGISTER_METHOD(CLASS)
for example
std::vector< Float_t > & GetValues()
ROOT::R::TRDataFrame fDfTrain
void SetWeightFileDir(TString fileDir)
set directory of weight file
std::vector< TString > GetListOfVariables() const
returns list of variables
Rcpp::internal::NamedPlaceHolder Label
Int_t Eval(const TString &code, TRObject &ans)
Method to eval R code and you get the result in a reference to TRObject.
virtual void TestClassification()
initialization
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
This is a class to create DataFrames from ROOT to R