Logo ROOT   6.08/07
Reference Guide
ConvergenceTest.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : ConvergenceTest *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Contains all the data information *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland *
16  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
17  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
18  * *
19  * Copyright (c) 2006: *
20  * CERN, Switzerland *
21  * U. of Victoria, Canada *
22  * MPI-K Heidelberg, Germany *
23  * *
24  * Redistribution and use in source and binary forms, with or without *
25  * modification, are permitted according to the terms listed in LICENSE *
26  * (http://tmva.sourceforge.net/LICENSE) *
27  **********************************************************************************/
28 
29 #ifndef ROOT_TMVA_ConvergenceTest
30 #define ROOT_TMVA_ConvergenceTest
31 
32 //////////////////////////////////////////////////////////////////////////
33 // //
34 // ConvergenceTest //
35 // //
36 // check for convergence //
37 // //
38 //////////////////////////////////////////////////////////////////////////
39 
40 #include <deque>
41 
42 #ifndef ROOT_Rtypes
43 #include "Rtypes.h"
44 #endif
45 
46 namespace TMVA {
47 
49 
50  public:
51 
54 
55  // setters
56  void SetConvergenceParameters( Int_t steps, Double_t improvement )
57  { fSteps = steps; fImprovement = improvement; }
58  void SetCurrentValue( Float_t value ) { fCurrentValue = value; }
61 
62  // getters
63  Bool_t HasConverged( Bool_t withinConvergenceBand = kFALSE );
64  Float_t Progress(); // from 0 (just started) to 1 (finished)
65  Float_t SpeedControl( UInt_t ofSteps );
66 
67 
68  protected:
69 
70  Float_t fCurrentValue; //! current value
71 
72  Float_t fImprovement; //! minimum improvement which counts as improvement
73  Int_t fSteps; //! number of steps without improvement required for convergence
74 
75  private:
76 
77  Int_t fCounter; //! counts the number of steps without improvement
78  Float_t fConvValue; //! the best "fitness" value
79  Int_t fMaxCounter; //! maximum value for the counter so far
80 
81  // speed-control (gives back the learning speed = improvement-rate in the last N steps)
82  // successList keeps track of the improvements to be able
85  std::deque<Short_t> fSuccessList; // to calculate the improvement-speed
86 
87  };
88 }
89 
90 #endif
Int_t fMaxCounter
the best "fitness" value
Float_t fBestResult
maximum value for the counter so far
float Float_t
Definition: RtypesCore.h:53
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Float_t fImprovement
current value
void SetConvergenceParameters(Int_t steps, Double_t improvement)
Bool_t HasConverged(Bool_t withinConvergenceBand=kFALSE)
gives back true if the last "steps" steps have lead to an improvement of the "fitness" of the "indivi...
Int_t fSteps
minimum improvement which counts as improvement
Float_t Progress()
returns a float from 0 (just started) to 1 (finished)
unsigned int UInt_t
Definition: RtypesCore.h:42
ConvergenceTest()
constructor
double Double_t
Definition: RtypesCore.h:55
~ConvergenceTest()
destructor
std::deque< Short_t > fSuccessList
Abstract ClassifierFactory template that handles arbitrary types.
Float_t SpeedControl(UInt_t ofSteps)
this function provides the ability to change the learning rate according to the success of the last g...
Int_t fCounter
number of steps without improvement required for convergence
void SetCurrentValue(Float_t value)
Float_t fConvValue
counts the number of steps without improvement