31 #ifndef GRT_CLASSIFIER_HEADER
32 #define GRT_CLASSIFIER_HEADER
38 #define DEFAULT_NULL_LIKELIHOOD_VALUE 0
39 #define DEFAULT_NULL_DISTANCE_VALUE 0
44 enum ClassifierModes{STANDARD_CLASSIFIER_MODE=0,TIMESERIES_CLASSIFIER_MODE};
71 bool copyBaseVariables(
const Classifier *classifier);
93 std::string getClassifierType()
const;
100 bool getSupportsNullRejection()
const;
107 bool getNullRejectionEnabled()
const;
115 Float getNullRejectionCoeff()
const;
124 Float getMaximumLikelihood()
const;
133 Float getBestDistance()
const;
140 Float getPhase()
const;
147 virtual UINT getNumClasses()
const;
156 UINT getClassLabelIndexValue(UINT classLabel)
const;
163 UINT getPredictedClassLabel()
const;
213 bool enableNullRejection(
bool useNullRejection);
220 virtual bool setNullRejectionCoeff(Float nullRejectionCoeff);
230 virtual bool setNullRejectionThresholds(
VectorFloat newRejectionThresholds);
258 static Classifier* createInstanceFromString( std::string
const &classifierType );
281 const Classifier* getClassifierPointer()
const;
312 std::string classifierType;
313 bool supportsNullRejection;
314 bool useNullRejection;
316 UINT predictedClassLabel;
318 Float nullRejectionCoeff;
334 if( !stringClassifierMap ){ stringClassifierMap =
new StringClassifierMap; }
335 return stringClassifierMap;
339 static StringClassifierMap *stringClassifierMap;
340 static UINT numClassifierInstances;
345 template<
typename T >
Classifier* getNewClassificationModuleInstance() {
return new T; }
347 template<
typename T >
351 getMap()->insert( std::pair< std::string,
Classifier*(*)() >(newClassificationModuleName, &getNewClassificationModuleInstance< T > ) );
357 #endif //GRT_CLASSIFIER_HEADER
bool saveBaseSettingsToFile(std::fstream &file) const
virtual bool recomputeNullRejectionThresholds()
bool getTimeseriesCompatible() const
static StringClassifierMap * getMap()
virtual bool deepCopyFrom(const Classifier *classifier)
This is the main base class that all GRT machine learning algorithms should inherit from...
bool loadBaseSettingsFromFile(std::fstream &file)
std::map< std::string, Classifier *(*)() > StringClassifierMap