42 TMVA::GeneticFitter::GeneticFitter( IFitterTarget& target,
44 const
std::vector<
TMVA::Interval*>& ranges,
46 : FitterBase( target, name, ranges, theOption )
67 "Saves the best n results from each generation. They are included in the last cycle" );
69 "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" );
72 "Trim the population to PopSize after assessing the fitness of each individual" );
92 fSC_factor = SC_factor;
101 Log() <<
kINFO <<
"<GeneticFitter> Optimisation, please be patient "
102 <<
"... (inaccurate progress timing for GA)" <<
Endl;
104 GetFitterTarget().ProgressNotifier(
"GA",
"init" );
115 for (
Int_t cycle = 0; cycle < fCycles; cycle++) {
116 GetFitterTarget().ProgressNotifier(
"GA",
"cycle" );
123 if ( pars.size() == fRanges.size() ){
126 if (cycle==fCycles-1) {
127 GetFitterTarget().ProgressNotifier(
"GA",
"last" );
131 GetFitterTarget().ProgressNotifier(
"GA",
"iteration" );
138 GetFitterTarget().ProgressNotifier(
"GA",
"iteration" );
152 for (
Int_t i = 0; i<fSaveBestFromGeneration && i<fPopSize; i++ ) {
161 for (
Int_t i = 0; i<fSaveBestFromGeneration && i<fPopSize; i++ ) {
175 GetFitterTarget().ProgressNotifier(
"GA",
"stop" );
MsgLogger & Endl(MsgLogger &ml)
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...
virtual Double_t CalculateFitness()
starts the evaluation of the fitness of all different individuals of the population.
GeneticPopulation & GetGeneticPopulation()
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...
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
ClassImp(TMVA::GeneticFitter) TMVA
constructor
void AddPopulation(GeneticPopulation *strangers)
add another population (strangers) to the one of this GeneticPopulation
Double_t Run()
estimator function interface for fitting
TString GetElapsedTime(Bool_t Scientific=kTRUE)
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 Sort()
sort the genepool according to the fitness of the individuals
Double_t GetFitness() const
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...
std::vector< Double_t > & GetFactors()
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
void DeclareOptions()
declare GA options
Abstract ClassifierFactory template that handles arbitrary types.
void DrawProgressBar(Int_t, const TString &comment="")
draws progress bar in color or B&W caution:
void Init()
calls evolution, but if it is not the first time.
Int_t fSaveBestFromGeneration