English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Modeler: TModeler.h Source File
Uranie / Modeler v4.9.0
/* @license-end */
TModeler.h
Go to the documentation of this file.
1
2// Copyright (C) 2013-2024 CEA/DES
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as published
6// by the Free Software Foundation, either version 3 of the License, or any
7// later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
18// $Id$
19// $Author$
20// $Date$
21// $Revision$
22// $State$
24
39#ifndef TMODELER_H
40#define TMODELER_H
41
42#include <iostream>
43
44//ROOT
45#include "Rtypes.h"
46#include "TNamed.h"
47//Added to make up for TMultiLayerPerceptron comment
48#include "TVector.h"
49//Provisoirement retir�
50#ifndef WIN32
51#include "TMultiLayerPerceptron.h"
52#endif
53//Uranie
54#include "Modeler.h"
55#include "TDataServer.h"
56#include "UExceptions.h"
57
58namespace URANIE
59{
60namespace Modeler
61{
62class TModeler: public TNamed
63{
64public:
65 Bool_t _blog;
67 Bool_t _bStoreYHat;
68 URANIE::DataServer::TDataServer *_tds;
69 //TMultiLayerPerceptron* _mlp; //!< Perceptron associated
70
71 Int_t _nS;
72
78
79 Int_t _nX;
80 Int_t _nY;
81
82 TString _sFileName;
84
86 Double_t _dr2;
87 Bool_t _bIntercept;
88public:
89 //---------------------------------------------
93
94 TModeler(URANIE::DataServer::TDataServer *tds, TString architecture,
95 Option_t *option = "");
97 TModeler(URANIE::DataServer::TDataServer *tds, const char *varexpinput,
98 const char *varexpoutput, Option_t * option = "");
99
101 virtual ~TModeler();
103
104 //---------------------------------------------
108 //TMultiLayerPerceptron* getANN() { return _mlp;}
110 TVectorD getParameters()
111 {
112 return _parameterValues;
113 }
115 Double_t getR2() const
116 {
117 return _dr2;
118 }
120 const char * getInputName(Int_t i) const;
122 const char * getOutputName(Int_t i = 0);
124 Int_t getNInput();
125
128 {
129 return _bIntercept;
130 }
132
136 void setDrawProgressBar(Bool_t bbool = kTRUE)
137 {
138 _bdrawProgressBar = bbool;
139 }
140
142
146 {
147 return _bdrawProgressBar;
148 }
150
151 //---------------------------------------------
155 void train(Option_t* option = "text");
157
158 //---------------------------------------------
162
170 virtual void exportFunction(const char* lang, const char* file = "",
171 const char* name = "", Option_t *option = "");
173
177 virtual void exportModelCplusplus(std::ofstream * sourcefile) const = 0;
179
183 virtual void exportModelFortran(std::ofstream * sourcefile) const = 0;
185
189 virtual void exportModelPMML(const char* file = "",
190 const char* name = "",Option_t *option = "") const = 0;
192
196 virtual void exportModelPython(std::ofstream * sourcefile) const = 0;
198
199 //---------------------------------------------
203 void setLog()
204 {
205 _blog = kTRUE;
206 }
207 void unsetLog()
208 {
209 _blog = kFALSE;
210 }
212 {
213 _blog = _blog ? kFALSE : kTRUE;
214 }
215 Bool_t getLog()
216 {
217 return _blog;
218 }
219 virtual void printLog(Option_t *option = "");
221
222 ClassDef(URANIE::Modeler::TModeler, ID_MODELER)
223 //Classe de
224};
225
226} // Fin du namespace Modeler
227} // Fin du namespace URANIE
228#endif
Definition TModeler.h:63
URANIE::DataServer::TDataServer * _tds
Definition TModeler.h:68
TString _sIntermediateArchitecture
The intermediate (between the first and last character ",") information.
Definition TModeler.h:75
virtual void exportModelCplusplus(std::ofstream *sourcefile) const =0
Export the model in C++ langage in a file.
Int_t _nY
The number of output attributes.
Definition TModeler.h:80
Double_t getR2() const
Return the R2 quality.
Definition TModeler.h:115
virtual ~TModeler()
Default destructor.
Bool_t getLog()
Definition TModeler.h:215
TVectorD _parameterValues
The list of parameters.
Definition TModeler.h:85
Double_t _dr2
The R2 quality.
Definition TModeler.h:86
Int_t _nX
The number of input attributes.
Definition TModeler.h:79
void changeLog()
Definition TModeler.h:211
Int_t getNInput()
Gets the number of input.
void train(Option_t *option="text")
virtual void exportModelFortran(std::ofstream *sourcefile) const =0
Export the model in Fortran langage in a file.
virtual void exportModelPMML(const char *file="", const char *name="", Option_t *option="") const =0
Export the model in a PMML file.
void setDrawProgressBar(Bool_t bbool=kTRUE)
Set the "draw progress bar" flag.
Definition TModeler.h:136
Int_t _nS
Pointer to a TDS.
Definition TModeler.h:71
Bool_t _bdrawProgressBar
Boolean to know if the progress bar has to be drawn.
Definition TModeler.h:66
const char * getOutputName(Int_t i=0)
Return the name of output attribute.
TModeler(URANIE::DataServer::TDataServer *tds, TString architecture, Option_t *option="")
Constructor with a dataserver.
void setLog()
Definition TModeler.h:203
Bool_t _blog
Boolean for edit the log.
Definition TModeler.h:65
virtual void exportFunction(const char *lang, const char *file="", const char *name="", Option_t *option="")
Export the model in an external file with a specified langage.
TModeler(URANIE::DataServer::TDataServer *tds, const char *varexpinput, const char *varexpoutput, Option_t *option="")
Default constructor with input and output attributes.
Bool_t getIntercept()
Gets the boolean attribut _bIntercept.
Definition TModeler.h:127
TString _sOutputAttributes
The string of output attributes (separated by the character ":".
Definition TModeler.h:74
TString _sFileName
The name of the file when export the model without extension.
Definition TModeler.h:82
TVectorD getParameters()
Return the parameter vector of the model.
Definition TModeler.h:110
virtual void printLog(Option_t *option="")
TList * _listOfOutputAttributes
The list of output Leaf.
Definition TModeler.h:77
void unsetLog()
Definition TModeler.h:207
Bool_t getDrawProgressBar()
Get the "draw progress bar" flag.
Definition TModeler.h:145
TList * _listOfInputAttributes
The list of input Leaf.
Definition TModeler.h:76
virtual void exportModelPython(std::ofstream *sourcefile) const =0
Export the model in Python langage in a file.
Bool_t _bIntercept
For certain models, add the intercept (Default is TRUE)
Definition TModeler.h:87
TString _sFunctionName
The name of the function when export the model.
Definition TModeler.h:83
TString _sInputAttributes
The string of input attributes (separated by the character ":".
Definition TModeler.h:73
const char * getInputName(Int_t i) const
Return the name of input attributes.
Bool_t _bStoreYHat
Boolean to specify if we add the \hat{} attribute in the TDS [default kTRUE].
Definition TModeler.h:67
ROOT.
Definition TAnisp.h:164