English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Modeler: URANIE::Modeler::TPolynomialRegression Class Reference
Uranie / Modeler v4.9.0
/* @license-end */
URANIE::Modeler::TPolynomialRegression Class Reference

Description of the class TPolynomialRegression. More...

#include <TPolynomialRegression.h>

Inheritance diagram for URANIE::Modeler::TPolynomialRegression:
Collaboration diagram for URANIE::Modeler::TPolynomialRegression:

Public Types

enum  ECriteria { kUnknown , kR2 , kR2A , kQ2 }
 

Public Member Functions

Constructor and Destructor
 TPolynomialRegression (URANIE::DataServer::TDataServer *tds, TString architecture, Option_t *option="")
 Default constructor with the TDataServer and architecture.
 
 TPolynomialRegression (URANIE::DataServer::TDataServer *tds, const char *varexpinput, const char *varexpoutput, Option_t *option="")
 Default constructor with the TDataServer and input and output attributes.
 
virtual ~TPolynomialRegression ()
 Default destructor.
 
Get and Set methods
Double_t getR2Adjusted ()
 Return the Adjusted R2 statistic.
 
Double_t getQ2 ()
 Return the Q2 statistic.
 
Double_t getPress ()
 Return the PRESS statistic.
 
void setMinimalOrder (Int_t iorder)
 Set the minimal order of the polynomial.
 
void setMaximalOrder (Int_t iorder)
 Set the maximal order of the polynomial.
 
void setMaxMonomes (Int_t n)
 Set the maximal number of monomia to add (exaustive research)
 
Int_t getMaxMonomes ()
 Return the maximal number of monomia.
 
void setTrace (TString straceFile="")
 Activate the trace of the process.
 
void unsetTrace ()
 Unset trace.
 
Bool_t getTrace ()
 Return the trace flag.
 
TString getTraceFile ()
 Return the name of the trace file.
 
void setCriteria (Double_t dcriteria)
 Set the wanted criteria.
 
TTree * getResultsTree ()
 Get the TTree of results.
 
Estimate
void estimate (Option_t *option="")
 
void estimateExaustiveResearch (Option_t *option)
 Exhaustive research when the number of maximal monomes is no-negative.
 
void recursiveSearch (TList *tl, Int_t npos, TString str)
 
void fillIndex (TString sinputname, Double_t dval, Int_t bRetained=0)
 Method to fill in the tree the value of temporal results.
 
Export the model in extrenal langage
void exportModelCplusplus (std::ofstream *sourcefile) const
 Export the model in an external file with a specified langage.
 
void exportModelFortran (std::ofstream *sourcefile) const
 Export the model in Fortran langage in a file.
 
void exportModelPMML (const char *file="", const char *name="", Option_t *option="") const
 Export the model in a PMML file (not yet implemented)
 
void exportModelPython (std::ofstream *sourcefile) const
 Export the model in Python langage in a file (not yet implemented)
 
Printing Log
virtual void printLog (Option_t *option="")
 
- Public Member Functions inherited from URANIE::Modeler::TModeler
 TModeler (URANIE::DataServer::TDataServer *tds, TString architecture, Option_t *option="")
 Constructor with a dataserver.
 
 TModeler (URANIE::DataServer::TDataServer *tds, const char *varexpinput, const char *varexpoutput, Option_t *option="")
 Default constructor with input and output attributes.
 
virtual ~TModeler ()
 Default destructor.
 
TVectorD getParameters ()
 Return the parameter vector of the model.
 
Double_t getR2 () const
 Return the R2 quality.
 
const char * getInputName (Int_t i) const
 Return the name of input attributes.
 
const char * getOutputName (Int_t i=0)
 Return the name of output attribute.
 
Int_t getNInput ()
 Gets the number of input.
 
Bool_t getIntercept ()
 Gets the boolean attribut _bIntercept.
 
void setDrawProgressBar (Bool_t bbool=kTRUE)
 Set the "draw progress bar" flag.
 
Bool_t getDrawProgressBar ()
 Get the "draw progress bar" flag.
 
void train (Option_t *option="text")
 
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.
 
void setLog ()
 
void unsetLog ()
 
void changeLog ()
 
Bool_t getLog ()
 

Public Attributes

Double_t _dr2a
 The Adjusted R2 quality.
 
Double_t _dq2
 The Q2 quality.
 
Double_t _dPress
 The Press quality.
 
TTree * _ntresult
 The TTree of results.
 
Char_t _sMonomials [MAXLENGTHSTRING]
 
Int_t _nMonomials
 The list of retained monomials.
 
Int_t _bRetained
 The number of retained monomials.
 
Double_t _dValueCriteria
 The number to known if the momonials are added.
 
Double_t _dAllCriteria [3]
 The current value of the criteria ( fill the TTree)
 
Int_t _nMinOrder
 The vector of 3 criteria (R2, R2A, Q2) ( fill the TTree)
 
Int_t _nMaxOrder
 The maximal order of the polynomial.
 
Int_t _nMaxMonomes
 The maximal number of monomia to insert (exaustive research)
 
Int_t _nNumber
 the current number of polynome
 
Bool_t _bTrace
 The flag to known is trace is needed.
 
TString _sTraceFile
 The name of the trace file.
 
- Public Attributes inherited from URANIE::Modeler::TModeler
Bool_t _blog
 Boolean for edit the log.
 
Bool_t _bdrawProgressBar
 Boolean to know if the progress bar has to be drawn.
 
Bool_t _bStoreYHat
 Boolean to specify if we add the \hat{} attribute in the TDS [default kTRUE].
 
URANIE::DataServer::TDataServer * _tds
 
Int_t _nS
 Pointer to a TDS.
 
TString _sInputAttributes
 The string of input attributes (separated by the character ":".
 
TString _sOutputAttributes
 The string of output attributes (separated by the character ":".
 
TString _sIntermediateArchitecture
 The intermediate (between the first and last character ",") information.
 
TList * _listOfInputAttributes
 The list of input Leaf.
 
TList * _listOfOutputAttributes
 The list of output Leaf.
 
Int_t _nX
 The number of input attributes.
 
Int_t _nY
 The number of output attributes.
 
TString _sFileName
 The name of the file when export the model without extension.
 
TString _sFunctionName
 The name of the function when export the model.
 
TVectorD _parameterValues
 The list of parameters.
 
Double_t _dr2
 The R2 quality.
 
Bool_t _bIntercept
 For certain models, add the intercept (Default is TRUE)
 

Protected Attributes

URANIE::DataServer::UMessageLogger * _fLogger
 

Private Member Functions

Bool_t _generateCompletePolynomial ()
 

Private Attributes

ECriteria _nCriteria
 Message logger.
 
Double_t _dCriteria
 The value of wanted criteria.
 
Bool_t _bChangemaxorder
 
Bool_t _OKcomplete
 True if value of maximal order of the polynomial has changed.
 
URANIE::Modeler::TLinearRegression_theTLR
 True if _complete data server can be use.
 
URANIE::DataServer::TDataServer * _completeDS
 The complete data server for the maximalorder wanted.
 
TString _sCompleteInputAttributes
 The string of complete input attributes (separated by the character ":".
 
TList * _lPropMonoms
 
TString _sLROption
 The list of monoms containing potential candidates.
 
TObjArray * _drawingGarbageCollector
 Garbage collector for drawn objects.
 

Detailed Description

Description of the class TPolynomialRegression.

To write by the developper.

Default value
  • Criteria : $Q^2$
  • Value : 0.70
  • MinOder : 1
  • MaxOrder : 2

Member Enumeration Documentation

◆ ECriteria

Enumerator
kUnknown 
kR2 
kR2A 
kQ2 

Constructor & Destructor Documentation

◆ TPolynomialRegression() [1/2]

URANIE::Modeler::TPolynomialRegression::TPolynomialRegression ( URANIE::DataServer::TDataServer *  tds,
TString  architecture,
Option_t *  option = "" 
)

Default constructor with the TDataServer and architecture.

If you don't want a intercept for the linear regression, put "nointercept" in the option argument.

TPolynomialRegression * tpr = new TPolynomialRegression(tds, TString("i1:i2:i3,out"), "nointercept");
tpr->setCriteria(0.977);
tpr->estimate("Q2");
Description of the class TPolynomialRegression.
Definition TPolynomialRegression.h:66
void setCriteria(Double_t dcriteria)
Set the wanted criteria.
Definition TPolynomialRegression.h:244
void estimate(Option_t *option="")
Parameters
tds(URANIE::DataServer::TDataServer *) the dataserver
architecture(TString)[""] The list of input and output attributes to pass to the function. The names of attributes are separated by the character ":" and the type (Input or Output) are separated by the character ","
option(Option_t *)[""] The option to pass

Referenced by ClassImp().

◆ TPolynomialRegression() [2/2]

URANIE::Modeler::TPolynomialRegression::TPolynomialRegression ( URANIE::DataServer::TDataServer *  tds,
const char *  varexpinput,
const char *  varexpoutput,
Option_t *  option = "" 
)

Default constructor with the TDataServer and input and output attributes.

If you don't want a intercept for the linear regression, put "nointercept" in the option argument.

TPolynomialRegression * tpr = new TPolynomialRegression(tds, "i1:i2:i3", "out", "nointercept");
tpr->setCriteria(0.977);
tpr->estimate("Q2");
Parameters
tds(URANIE::DataServer::TDataServer *) the dataserver
varexpinput(const char*) The list of input attributes to pass to the function separated by the caracter ":"
varexpoutput(const char *) The list of output attributes separated by the caracter ":"
option(Option_t *)[""] The option to pass

◆ ~TPolynomialRegression()

virtual URANIE::Modeler::TPolynomialRegression::~TPolynomialRegression ( )
virtual

Default destructor.

Referenced by ClassImp().

Member Function Documentation

◆ _generateCompletePolynomial()

Bool_t URANIE::Modeler::TPolynomialRegression::_generateCompletePolynomial ( )
private

Referenced by ClassImp().

◆ estimate()

void URANIE::Modeler::TPolynomialRegression::estimate ( Option_t *  option = "")

Referenced by ClassImp().

◆ estimateExaustiveResearch()

void URANIE::Modeler::TPolynomialRegression::estimateExaustiveResearch ( Option_t *  option)

Exhaustive research when the number of maximal monomes is no-negative.

Referenced by ClassImp().

◆ exportModelCplusplus()

void URANIE::Modeler::TPolynomialRegression::exportModelCplusplus ( std::ofstream *  sourcefile) const
virtual

Export the model in an external file with a specified langage.

It will be the main interface function to the export.

Parameters
lang(const char *) the langage to export (C|Fortran)
file(const char *) the file to export the modeler. If empty, use the name of the model, plus the extension of the langage.
name(const char *) the name of the function in the export file. If empty, use the name of the model Export the model in C++ langage in a file
Warning
Don't use this method. Use the main method TModeler::exportFunction.
Parameters
sourcefile(ofstream *) the pointer to the file to export the modeler.

Implements URANIE::Modeler::TModeler.

Referenced by ClassImp().

◆ exportModelFortran()

void URANIE::Modeler::TPolynomialRegression::exportModelFortran ( std::ofstream *  sourcefile) const
virtual

Export the model in Fortran langage in a file.

Warning
Don't use this method. Use the main method TModeler::exportFunction.
Parameters
sourcefile(ofstream *) the pointer to the file to export the modeler.

Implements URANIE::Modeler::TModeler.

Referenced by ClassImp().

◆ exportModelPMML()

void URANIE::Modeler::TPolynomialRegression::exportModelPMML ( const char *  file = "",
const char *  name = "",
Option_t *  option = "" 
) const
inlinevirtual

Export the model in a PMML file (not yet implemented)

Warning
Don't use this method. Use the main method TModeler::exportFunction.
Parameters
sourcefile(ofstream *) the pointer to the file to export the modeler.

Implements URANIE::Modeler::TModeler.

◆ exportModelPython()

void URANIE::Modeler::TPolynomialRegression::exportModelPython ( std::ofstream *  sourcefile) const
inlinevirtual

Export the model in Python langage in a file (not yet implemented)

Warning
Don't use this method. Use the main method TModeler::exportFunction.
Parameters
sourcefile(ofstream *) the pointer to the file to export the modeler.

Implements URANIE::Modeler::TModeler.

◆ fillIndex()

void URANIE::Modeler::TPolynomialRegression::fillIndex ( TString  sinputname,
Double_t  dval,
Int_t  bRetained = 0 
)

Method to fill in the tree the value of temporal results.

Parameters
sinputname(const char *) : the name of the retained attributes
dval(Double_t) : the value of the quality
bRetained(Int_t)[0] A flag to known if the attributes are retained (1) or not retained (0)

Referenced by ClassImp().

◆ getMaxMonomes()

Int_t URANIE::Modeler::TPolynomialRegression::getMaxMonomes ( )
inline

Return the maximal number of monomia.

References _nMaxMonomes.

◆ getPress()

Double_t URANIE::Modeler::TPolynomialRegression::getPress ( )
inline

Return the PRESS statistic.

References _dPress.

◆ getQ2()

Double_t URANIE::Modeler::TPolynomialRegression::getQ2 ( )
inline

Return the Q2 statistic.

References _dq2.

◆ getR2Adjusted()

Double_t URANIE::Modeler::TPolynomialRegression::getR2Adjusted ( )
inline

Return the Adjusted R2 statistic.

References _dr2a.

◆ getResultsTree()

TTree * URANIE::Modeler::TPolynomialRegression::getResultsTree ( )
inline

Get the TTree of results.

The TTree of results contains:

  • Inp : the list of inputs attributes added
  • n : the number of inputs attributes added
  • b : a number to known if the attributes are retained (b==1) else b==0
  • Criteria : the criteria used to select the monomials
  • R2, R2A, Q2 : the 3 quality stored in a vector C.
TTree *tt = tpr->getResultsTree();
tt->Scan("*");

to give for example

************************************************************************************************
*    Row   *       Inp *         n *         b *  Criteria *    C.C.R2 *   C.C.R2A *    C.C.Q2 *
************************************************************************************************
*        0 *           *         0 *         1 * 0.7956222 * 0.9580832 * 0.9161665 * 0.7956222 *
*        1 *     :z1z1 *         1 *         0 * 0.7568323 * 0.9582542 * 0.9089183 * 0.7568323 *
*        2 *     :z1z2 *         1 *         0 * 0.7606942 * 0.9584714 * 0.9093923 * 0.7606942 *
*        3 *     :z1z3 *         1 *         0 * 0.8093517 * 0.9679445 * 0.9300608 * 0.8093517 *
*        4 *     :z1z4 *         1 *         0 * 0.7857819 * 0.9665406 * 0.9269978 * 0.7857819 *
*        5 *     :z1z5 *         1 *         0 * 0.7751127 * 0.9599555 * 0.9126302 * 0.7751127 *
*        6 *     :z1z6 *         1 *         0 * 0.7687018 * 0.9596316 * 0.9119236 * 0.7687018 *
*        7 *     :z1z7 *         1 *         0 * 0.7510527 * 0.9595362 * 0.9117153 * 0.7510527 *
*        8 *     :z1z8 *         1 *         0 * 0.7116922 * 0.9583941 * 0.9092235 * 0.7116922 *
...
*      267 * :z3z6:z5z *         3 *         0 * 0.9572626 * 0.9947547 * 0.9860127 * 0.9572626 *
*      268 * :z3z6:z5z *         3 *         0 * 0.9603144 * 0.9944556 * 0.9852151 * 0.9603144 *
*      269 * :z3z6:z5z *         3 *         0 * 0.9582744 * 0.9944016 * 0.9850711 * 0.9582744 *
*      270 * :z3z6:z5z *         3 *         0 * 0.9044754 * 0.9956092 * 0.9882912 * 0.9044754 *
*      271 * :z3z6:z5z *         3 *         0 * 0.9566059 * 0.9944364 * 0.9851638 * 0.9566059 *
*      272 * :z3z6:z5z *         3 *         0 * 0.9686468 * 0.9956805 * 0.9884815 * 0.9686468 *
*      273 * :z3z6:z5z *         3 *         1 * 0.9779799 * 0.9973796 * 0.9930124 * 0.9779799 *
************************************************************************************************
Returns
(TTree *) the TTree of results.

References _ntresult.

◆ getTrace()

Bool_t URANIE::Modeler::TPolynomialRegression::getTrace ( )
inline

Return the trace flag.

References _bTrace.

◆ getTraceFile()

TString URANIE::Modeler::TPolynomialRegression::getTraceFile ( )

Return the name of the trace file.

Referenced by ClassImp().

◆ printLog()

virtual void URANIE::Modeler::TPolynomialRegression::printLog ( Option_t *  option = "")
virtual

Reimplemented from URANIE::Modeler::TModeler.

Referenced by ClassImp().

◆ recursiveSearch()

void URANIE::Modeler::TPolynomialRegression::recursiveSearch ( TList *  tl,
Int_t  npos,
TString  str 
)

Referenced by ClassImp().

◆ setCriteria()

void URANIE::Modeler::TPolynomialRegression::setCriteria ( Double_t  dcriteria)
inline

Set the wanted criteria.

Set the wanted criteria for estimate function .

Parameters
dcriteria: wanted criteria.

References _dCriteria.

◆ setMaximalOrder()

void URANIE::Modeler::TPolynomialRegression::setMaximalOrder ( Int_t  iorder)
inline

Set the maximal order of the polynomial.

Set the maximal order of the polynomial .

Parameters
iorder: order max of the polynomial.

References _bChangemaxorder, _nMaxOrder, and _nMinOrder.

◆ setMaxMonomes()

void URANIE::Modeler::TPolynomialRegression::setMaxMonomes ( Int_t  n)

Set the maximal number of monomia to add (exaustive research)

Parameters
n(Int_t) : The limit of number of monomia to add in the polynomial

Referenced by ClassImp().

◆ setMinimalOrder()

void URANIE::Modeler::TPolynomialRegression::setMinimalOrder ( Int_t  iorder)
inline

Set the minimal order of the polynomial.

Set the minimal order of the polynomial .

Parameters
iorder: order min of the polynomial.

References _nMaxOrder, and _nMinOrder.

◆ setTrace()

void URANIE::Modeler::TPolynomialRegression::setTrace ( TString  straceFile = "")

Activate the trace of the process.

the trace is used only in the generateCandidate method

/param straceFile (TString) The name of the trace file (empty by default, then use the default name which is "_tpr_trace_.log" )

Referenced by ClassImp().

◆ unsetTrace()

void URANIE::Modeler::TPolynomialRegression::unsetTrace ( )
inline

Unset trace.

References _bTrace.

Member Data Documentation

◆ _bChangemaxorder

Bool_t URANIE::Modeler::TPolynomialRegression::_bChangemaxorder
private

Referenced by ClassImp(), and setMaximalOrder().

◆ _bRetained

Int_t URANIE::Modeler::TPolynomialRegression::_bRetained

The number of retained monomials.

Referenced by ClassImp().

◆ _bTrace

Bool_t URANIE::Modeler::TPolynomialRegression::_bTrace

The flag to known is trace is needed.

Referenced by ClassImp(), getTrace(), and unsetTrace().

◆ _completeDS

URANIE::DataServer::TDataServer* URANIE::Modeler::TPolynomialRegression::_completeDS
private

The complete data server for the maximalorder wanted.

Referenced by ClassImp().

◆ _dAllCriteria

Double_t URANIE::Modeler::TPolynomialRegression::_dAllCriteria[3]

The current value of the criteria ( fill the TTree)

Referenced by ClassImp().

◆ _dCriteria

Double_t URANIE::Modeler::TPolynomialRegression::_dCriteria
private

The value of wanted criteria.

Referenced by ClassImp(), and setCriteria().

◆ _dPress

Double_t URANIE::Modeler::TPolynomialRegression::_dPress

The Press quality.

Referenced by ClassImp(), and getPress().

◆ _dq2

Double_t URANIE::Modeler::TPolynomialRegression::_dq2

The Q2 quality.

Referenced by ClassImp(), and getQ2().

◆ _dr2a

Double_t URANIE::Modeler::TPolynomialRegression::_dr2a

The Adjusted R2 quality.

Referenced by ClassImp(), and getR2Adjusted().

◆ _drawingGarbageCollector

TObjArray* URANIE::Modeler::TPolynomialRegression::_drawingGarbageCollector
private

Garbage collector for drawn objects.

Referenced by ClassImp().

◆ _dValueCriteria

Double_t URANIE::Modeler::TPolynomialRegression::_dValueCriteria

The number to known if the momonials are added.

Referenced by ClassImp().

◆ _fLogger

URANIE::DataServer::UMessageLogger* URANIE::Modeler::TPolynomialRegression::_fLogger
protected

Referenced by ClassImp().

◆ _lPropMonoms

TList* URANIE::Modeler::TPolynomialRegression::_lPropMonoms
private

Referenced by ClassImp().

◆ _nCriteria

ECriteria URANIE::Modeler::TPolynomialRegression::_nCriteria
private

Message logger.

The estimation option choosen

Referenced by ClassImp().

◆ _nMaxMonomes

Int_t URANIE::Modeler::TPolynomialRegression::_nMaxMonomes

The maximal number of monomia to insert (exaustive research)

Referenced by ClassImp(), and getMaxMonomes().

◆ _nMaxOrder

Int_t URANIE::Modeler::TPolynomialRegression::_nMaxOrder

The maximal order of the polynomial.

Referenced by ClassImp(), setMaximalOrder(), and setMinimalOrder().

◆ _nMinOrder

Int_t URANIE::Modeler::TPolynomialRegression::_nMinOrder

The vector of 3 criteria (R2, R2A, Q2) ( fill the TTree)

The minimal order of the polynomial

Referenced by ClassImp(), setMaximalOrder(), and setMinimalOrder().

◆ _nMonomials

Int_t URANIE::Modeler::TPolynomialRegression::_nMonomials

The list of retained monomials.

Referenced by ClassImp().

◆ _nNumber

Int_t URANIE::Modeler::TPolynomialRegression::_nNumber

the current number of polynome

Referenced by ClassImp().

◆ _ntresult

TTree* URANIE::Modeler::TPolynomialRegression::_ntresult

The TTree of results.

Referenced by ClassImp(), and getResultsTree().

◆ _OKcomplete

Bool_t URANIE::Modeler::TPolynomialRegression::_OKcomplete
private

True if value of maximal order of the polynomial has changed.

Referenced by ClassImp().

◆ _sCompleteInputAttributes

TString URANIE::Modeler::TPolynomialRegression::_sCompleteInputAttributes
private

The string of complete input attributes (separated by the character ":".

Referenced by ClassImp().

◆ _sLROption

TString URANIE::Modeler::TPolynomialRegression::_sLROption
private

The list of monoms containing potential candidates.

The string of option to pass to the TLinearRegression ("nointercept" for example)

Referenced by ClassImp().

◆ _sMonomials

Char_t URANIE::Modeler::TPolynomialRegression::_sMonomials[MAXLENGTHSTRING]

Referenced by ClassImp().

◆ _sTraceFile

TString URANIE::Modeler::TPolynomialRegression::_sTraceFile

The name of the trace file.

Referenced by ClassImp().

◆ _theTLR

URANIE::Modeler::TLinearRegression* URANIE::Modeler::TPolynomialRegression::_theTLR
private

True if _complete data server can be use.

The choosen non linear regression

Referenced by ClassImp().