openModeller  Version 1.5.0
best_subsets.hh
Go to the documentation of this file.
1 
30 #ifndef _BEST_SUBSETS_HH_
31 #define _BEST_SUBSETS_HH_
32 
33 #include <openmodeller/om.hh>
34 
35 #include "bs_algorithm_factory.hh"
36 #include "garp_run.hh"
37 
38 #include <string>
39 using std::string;
40 
41 /****************************************************************/
42 /************************* GARP Algorithm ***********************/
43 
56 {
57 public:
58 
60  virtual ~BestSubsets();
61 
66  int initialize();
67 
72  int iterate();
73 
78  int done() const;
79 
81  float getProgress() const;
82 
83  //
84  // Methods used to project the model
85  //
86 
95  Scalar getValue( const Sample& x ) const;
96 
103  int getConvergence( Scalar * const val ) const;
104 
105  /*
106  */
107  void printListOfRuns(string msg, AlgorithmRun ** runs, int numOfRuns);
108 
109 protected:
110 
111  void _getConfiguration( ConfigurationPtr& ) const;
113 
114  int _nparam;
116 
117 private:
118 
119  virtual AlgorithmImpl * getBSAlgorithm() = 0;
120  virtual int transferParametersToAlgorithm() = 0;
121 
122  int numActiveThreads();
124  int calculateBestSubset();
125  void sortRuns(AlgorithmRun ** runList, int nelements, int errorType);
126 
127 
128  //
129  // best subsets parameters
130  //
131 
132  double _trainProp;
139 
142 
143  //
144  // Internal data structures for Best Subsets
145  //
149 
153 
154  int _done;
155 
156  mutable float _maxProgress;
157 };
158 
159 
160 #endif
161 
int _commissionSampleSize
int done() const
void sortRuns(AlgorithmRun **runList, int nelements, int errorType)
float getProgress() const
double _commissionThreshold
double Scalar
Type of map values.
Definition: om_defs.hh:39
AlgorithmRun ** _bestRun
Scalar getValue(const Sample &x) const
virtual ~BestSubsets()
void _getConfiguration(ConfigurationPtr &) const
virtual int transferParametersToAlgorithm()=0
void printListOfRuns(string msg, AlgorithmRun **runs, int numOfRuns)
AlgorithmRun ** _activeRun
int _modelsUnderOmission
float _maxProgress
int _currentModelsUnderOmissionThreshold
int earlyTerminationConditionMet()
bool _softOmissionThreshold
int calculateBestSubset()
double _trainProp
BestSubsets(AlgMetadata *metadata)
void _setConfiguration(const ConstConfigurationPtr &)
AlgorithmRun ** _finishedRun
virtual AlgorithmImpl * getBSAlgorithm()=0
int numActiveThreads()
double _omissionThreshold
AlgParameter * _alg_params
int _numFinishedRuns
int getConvergence(Scalar *const val) const
AlgMetadata metadata
Definition: garp.cpp:134
Definition: Sample.hh:25