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