Logo ROOT   6.08/07
Reference Guide
MethodRSNNS.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 : RMethodRSNNS *
8  * *
9  * Description: *
10  * R´s Package RSNNS method based on ROOTR *
11  * *
12  **********************************************************************************/
13 
14 #ifndef ROOT_TMVA_RMethodRSNNS
15 #define ROOT_TMVA_RMethodRSNNS
16 
17 //////////////////////////////////////////////////////////////////////////
18 // //
19 // RMethodRSNNS //
20 // //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TMVA_RMethodBase
25 #include "TMVA/RMethodBase.h"
26 #endif
27 
28 namespace TMVA {
29 
30  class Factory; // DSMTEST
31  class Reader; // DSMTEST
32  class DataSetManager; // DSMTEST
33  class Types;
34  class MethodRSNNS : public RMethodBase {
35 
36  public :
37 
38  // constructors
39  MethodRSNNS(const TString &jobName,
40  const TString &methodTitle,
41  DataSetInfo &theData,
42  const TString &theOption = "");
43 
45  const TString &theWeightFile);
46 
47 
48  ~MethodRSNNS(void);
49  void Train();
50  // options treatment
51  void Init();
52  void DeclareOptions();
53  void ProcessOptions();
54  // create ranking
56  {
57  return NULL; // = 0;
58  }
59 
60 
61  Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
62 
63  // performs classifier testing
64  virtual void TestClassification();
65 
66 
67  Double_t GetMvaValue(Double_t *errLower = 0, Double_t *errUpper = 0);
68 
70  // the actual "weights"
71  virtual void AddWeightsXMLTo(void *parent) const {} // = 0;
72  virtual void ReadWeightsFromXML(void *wghtnode) {} // = 0;
73  virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
74 
75  void ReadModelFromFile();
76 
77  // signal/background classification response for all current set of data
78  virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false);
79 
80  private :
82  friend class Factory; // DSMTEST
83  friend class Reader; // DSMTEST
84  protected:
86  std::vector<Float_t> fProbResultForTrainSig;
87  std::vector<Float_t> fProbResultForTestSig;
88 
89  TString fNetType;//default RMPL
90  //RSNNS Options for all NN methods
91  TString fSize;//number of units in the hidden layer(s)
92  UInt_t fMaxit;//maximum of iterations to learn
93 
94  TString fInitFunc;//the initialization function to use
95  TString fInitFuncParams;//the parameters for the initialization function (type 6 see getSnnsRFunctionTable() in RSNNS package)
96 
97  TString fLearnFunc;//the learning function to use
98  TString fLearnFuncParams;//the parameters for the learning function
99 
100  TString fUpdateFunc;//the update function to use
101  TString fUpdateFuncParams;//the parameters for the update function
102 
103  TString fHiddenActFunc;//the activation function of all hidden units
104  Bool_t fShufflePatterns;//should the patterns be shuffled?
105  Bool_t fLinOut;//sets the activation function of the output units to linear or logistic
106 
107  TString fPruneFunc;//the pruning function to use
108  TString fPruneFuncParams;//the parameters for the pruning function. Unlike the
109  //other functions, these have to be given in a named list. See
110  //the pruning demos for further explanation.
111  std::vector<UInt_t> fFactorNumeric; //factors creations
112  //RSNNS mlp require a numeric factor then background=0 signal=1 from fFactorTrain
114  ROOT::R::TRFunctionImport predict;
115  ROOT::R::TRFunctionImport mlp;
116  ROOT::R::TRFunctionImport asfactor;
117  ROOT::R::TRObject *fModel;
118  // get help message text
119  void GetHelpMessage() const;
120 
122  };
123 } // namespace TMVA
124 #endif
Bool_t fShufflePatterns
Definition: MethodRSNNS.h:104
virtual std::vector< Double_t > GetMvaValues(Long64_t firstEvt=0, Long64_t lastEvt=-1, Bool_t logProgress=false)
get all the MVA values for the events of the current Data type
long long Long64_t
Definition: RtypesCore.h:69
ROOT::R::TRFunctionImport predict
Definition: MethodRSNNS.h:114
EAnalysisType
Definition: Types.h:129
Basic string class.
Definition: TString.h:137
void GetHelpMessage() const
std::vector< UInt_t > fFactorNumeric
Definition: MethodRSNNS.h:111
bool Bool_t
Definition: RtypesCore.h:59
std::vector< Float_t > fProbResultForTrainSig
Definition: MethodRSNNS.h:86
ROOT::R::TRObject * fModel
Definition: MethodRSNNS.h:117
Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)
virtual void TestClassification()
initialization
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void ReadWeightsFromStream(std::istream &)
Definition: MethodRSNNS.h:73
TString fUpdateFuncParams
Definition: MethodRSNNS.h:101
const Ranking * CreateRanking()
Definition: MethodRSNNS.h:55
virtual void AddWeightsXMLTo(void *parent) const
Definition: MethodRSNNS.h:71
DataSetManager * fDataSetManager
Definition: MethodRSNNS.h:81
unsigned int UInt_t
Definition: RtypesCore.h:42
ROOT::R::TRFunctionImport mlp
Definition: MethodRSNNS.h:115
TString fInitFuncParams
Definition: MethodRSNNS.h:95
ROOT::R::TRFunctionImport asfactor
Definition: MethodRSNNS.h:116
MethodRSNNS(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
Definition: MethodRSNNS.cxx:51
double Double_t
Definition: RtypesCore.h:55
TString fLearnFuncParams
Definition: MethodRSNNS.h:98
int type
Definition: TGX11.cxx:120
TString fPruneFuncParams
Definition: MethodRSNNS.h:108
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Abstract ClassifierFactory template that handles arbitrary types.
virtual void ReadWeightsFromXML(void *wghtnode)
Definition: MethodRSNNS.h:72
std::vector< Float_t > fProbResultForTestSig
Definition: MethodRSNNS.h:87
#define NULL
Definition: Rtypes.h:82
TString fLearnFunc
Definition: MethodRSNNS.h:97
TString fHiddenActFunc
Definition: MethodRSNNS.h:103
virtual void ReadWeightsFromStream(std::istream &)=0
static Bool_t IsModuleLoaded
Definition: MethodRSNNS.h:113