ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  TDirectory *theTargetDir = NULL);
44 
46  const TString &theWeightFile,
47  TDirectory *theTargetDir = NULL);
48 
49 
50  ~MethodRSNNS(void);
51  void Train();
52  // options treatment
53  void Init();
54  void DeclareOptions();
55  void ProcessOptions();
56  // create ranking
58  {
59  return NULL; // = 0;
60  }
61 
62 
63  Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
64 
65  // performs classifier testing
66  virtual void TestClassification();
67 
68 
69  Double_t GetMvaValue(Double_t *errLower = 0, Double_t *errUpper = 0);
70 
72  // the actual "weights"
73  virtual void AddWeightsXMLTo(void *parent) const {} // = 0;
74  virtual void ReadWeightsFromXML(void *wghtnode) {} // = 0;
75  virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
76  void ReadStateFromFile();
77  private :
79  friend class Factory; // DSMTEST
80  friend class Reader; // DSMTEST
81  protected:
83  std::vector<Float_t> fProbResultForTrainSig;
84  std::vector<Float_t> fProbResultForTestSig;
85 
86  TString fNetType;//default RMPL
87  //RSNNS Options for all NN methods
88  TString fSize;//number of units in the hidden layer(s)
89  UInt_t fMaxit;//maximum of iterations to learn
90 
91  TString fInitFunc;//the initialization function to use
92  TString fInitFuncParams;//the parameters for the initialization function (type 6 see getSnnsRFunctionTable() in RSNNS package)
93 
94  TString fLearnFunc;//the learning function to use
95  TString fLearnFuncParams;//the parameters for the learning function
96 
97  TString fUpdateFunc;//the update function to use
98  TString fUpdateFuncParams;//the parameters for the update function
99 
100  TString fHiddenActFunc;//the activation function of all hidden units
101  Bool_t fShufflePatterns;//should the patterns be shuffled?
102  Bool_t fLinOut;//sets the activation function of the output units to linear or logistic
103 
104  TString fPruneFunc;//the pruning function to use
105  TString fPruneFuncParams;//the parameters for the pruning function. Unlike the
106  //other functions, these have to be given in a named list. See
107  //the pruning demos for further explanation.
108  std::vector<UInt_t> fFactorNumeric; //factors creations
109  //RSNNS mlp require a numeric factor then background=0 signal=1 from fFactorTrain
115  // get help message text
116  void GetHelpMessage() const;
117 
119  };
120 } // namespace TMVA
121 #endif
Bool_t fShufflePatterns
Definition: MethodRSNNS.h:101
void GetHelpMessage() const
ROOT::R::TRFunctionImport predict
Definition: MethodRSNNS.h:111
EAnalysisType
Definition: Types.h:124
Basic string class.
Definition: TString.h:137
std::vector< UInt_t > fFactorNumeric
Definition: MethodRSNNS.h:108
bool Bool_t
Definition: RtypesCore.h:59
std::vector< Float_t > fProbResultForTrainSig
Definition: MethodRSNNS.h:83
ROOT::R::TRObject * fModel
Definition: MethodRSNNS.h:114
MethodRSNNS(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="", TDirectory *theTargetDir=NULL)
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:75
TString fUpdateFuncParams
Definition: MethodRSNNS.h:98
const Ranking * CreateRanking()
Definition: MethodRSNNS.h:57
This is a class to get ROOT's objects from R's objects
Definition: TRObject.h:73
This is a class to pass functions from ROOT to R.
DataSetManager * fDataSetManager
Definition: MethodRSNNS.h:78
unsigned int UInt_t
Definition: RtypesCore.h:42
ROOT::R::TRFunctionImport mlp
Definition: MethodRSNNS.h:112
TString fUpdateFunc
Definition: MethodRSNNS.h:97
TString fInitFuncParams
Definition: MethodRSNNS.h:92
ROOT::R::TRFunctionImport asfactor
Definition: MethodRSNNS.h:113
double Double_t
Definition: RtypesCore.h:55
static Bool_t IsModuleLoaded
Definition: MethodRSNNS.h:110
Describe directory structure in memory.
Definition: TDirectory.h:44
TString fLearnFuncParams
Definition: MethodRSNNS.h:95
int type
Definition: TGX11.cxx:120
TString fPruneFuncParams
Definition: MethodRSNNS.h:105
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
virtual void ReadWeightsFromXML(void *wghtnode)
Definition: MethodRSNNS.h:74
std::vector< Float_t > fProbResultForTestSig
Definition: MethodRSNNS.h:84
virtual void AddWeightsXMLTo(void *parent) const
Definition: MethodRSNNS.h:73
#define NULL
Definition: Rtypes.h:82
TString fLearnFunc
Definition: MethodRSNNS.h:94
TString fHiddenActFunc
Definition: MethodRSNNS.h:100
virtual void ReadWeightsFromStream(std::istream &)=0