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