openModeller  Version 1.5.0
AbstractBestSubsets.hh
Go to the documentation of this file.
1 
30 #ifndef _BEST_SUBSETS_HH_
31 #define _BEST_SUBSETS_HH_
32 
33 #include <string>
34 #include <openmodeller/om.hh>
35 
36 #include "AlgorithmRun.hh"
37 
38 
39 /****************************************************************/
40 /************************* GARP Algorithm ***********************/
41 
54 {
55 public:
57  virtual ~AbstractBestSubsets() = 0;
58 
64  int needNormalization();
65 
70  int initialize();
71 
76  int iterate();
77 
82  int done() const;
83 
85  float getProgress() const;
86 
87  //
88  // Methods used to project the model
89  //
90 
99  Scalar getValue( const Sample& x ) const;
100 
107  int getConvergence( Scalar * const val ) const;
108 
109  /*
110  */
111 protected:
112  virtual void _getConfiguration( ConfigurationPtr& ) const;
113  virtual void _setConfiguration( const ConstConfigurationPtr & );
114 
115  mutable std::string _subAlgorithm; //< mutable so it can be assigned in needNormalization if necessary
116 
117 private:
118  int numActiveThreads();
120  int calculateBestSubset();
121  void sortRuns(AlgorithmRun ** runList, int nelements, int errorType);
122 
123  //
124  // best subsets parameters
125  //
126  double _trainProp;
133 
136 
137  //
138  // Internal data structures for Best Subsets
139  //
143 
147 
148  int _done;
149 
150  mutable float _maxProgress;
151 
152 };
153 
154 
155 #endif
156 
double Scalar
Type of map values.
Definition: om_defs.hh:39
void sortRuns(AlgorithmRun **runList, int nelements, int errorType)
Scalar getValue(const Sample &x) const
AlgorithmRun ** _activeRun
AbstractBestSubsets(AlgMetadata const *)
virtual void _setConfiguration(const ConstConfigurationPtr &)
virtual void _getConfiguration(ConfigurationPtr &) const
int getConvergence(Scalar *const val) const
Definition: Sample.hh:25
AlgorithmRun ** _finishedRun