51 const std::vector<TMVA::Interval*>& ranges,
74 "Saves the best n results from each generation. They are included in the last cycle" );
76 "Saves the best n results from each cycle. They are included in the last cycle. The value should be set to at least 1.0" );
79 "Trim the population to PopSize after assessing the fitness of each individual" );
108 Log() << kHEADER <<
"<GeneticFitter> Optimisation, please be patient "
109 <<
"... (inaccurate progress timing for GA)" <<
Endl;
133 if ( pars.size() ==
fRanges.size() ){
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
virtual void ParseOptions()
options parser
FitterBase(IFitterTarget &target, const TString &name, const std::vector< TMVA::Interval * > ranges, const TString &theOption)
constructor
IFitterTarget & GetFitterTarget() const
const char * GetName() const override
Returns name of object.
Double_t Run()
estimator function interface for fitting
const std::vector< TMVA::Interval * > fRanges
Base definition for genetic algorithm.
virtual Double_t SpreadControl(Int_t steps, Int_t ofSteps, Double_t factor)
this function provides the ability to change the stepSize of a mutation according to the success of t...
virtual Bool_t HasConverged(Int_t steps=10, Double_t ratio=0.1)
gives back true if the last "steps" steps have lead to an improvement of the "fitness" of the "indivi...
GeneticPopulation & GetGeneticPopulation()
void Init()
calls evolution, but if it is not the first time.
virtual Double_t CalculateFitness()
starts the evaluation of the fitness of all different individuals of the population.
Double_t fSC_factor
... with fSC_factor; if there were less improvements: divide by that factor; if there were exactly fS...
Double_t fConvCrit
improvements bigger than fConvCrit are counted as "improvement"
Int_t fSC_rate
... fSC_rate improvements, than multiply the sigma of the gaussian which defines how the random numbe...
Int_t fNsteps
convergence criteria: if no improvements > fConvCrit was achieved within the last fNsteps: cycle has ...
Int_t fCycles
number of (nearly) independent calculation cycles
void SetParameters(Int_t cycles, Int_t nsteps, Int_t popSize, Int_t SC_steps, Int_t SC_rate, Double_t SC_factor, Double_t convCrit)
set GA configuration parameters
Int_t fSC_steps
regulates how strong the mutations for the coordinates are: if within fSC_steps there were more than....
Int_t fSaveBestFromGeneration
store the best individuals from one generation (these are included as "hints" in the last cycle of GA...
Bool_t fTrim
take care, that the number of individuals is less fPopSize (trimming is done after the fitness of the...
UInt_t fSeed
Seed for the random generator (0 takes random seeds).
Int_t fSaveBestFromCycle
store the best individuals from one cycle (these are included as "hints" in the last cycle of GA calc...
Int_t fPopSize
number of individuals to start with
GeneticFitter(IFitterTarget &target, const TString &name, const std::vector< TMVA::Interval * > &ranges, const TString &theOption)
constructor
void DeclareOptions() override
declare GA options
std::vector< Double_t > & GetFactors()
Double_t GetFitness() const
void Sort()
sort the genepool according to the fitness of the individuals
void TrimPopulation()
trim the population to the predefined size
GeneticGenes * GetGenes(Int_t index)
gives back the "Genes" of the population with the given index.
void GiveHint(std::vector< Double_t > &hint, Double_t fitness=0)
add an individual (a set of variables) to the population if there is a set of variables which is know...
void AddPopulation(GeneticPopulation *strangers)
add another population (strangers) to the one of this GeneticPopulation
Interface for a fitter 'target'.
Timing information for training and evaluation of MVA methods.
TString GetElapsedTime(Bool_t Scientific=kTRUE)
returns pretty string with elapsed time
void DrawProgressBar(Int_t, const TString &comment="")
draws progress bar in color or B&W caution:
MsgLogger & Endl(MsgLogger &ml)