26 #ifndef GRT_CLASSIFIER_HEADER 27 #define GRT_CLASSIFIER_HEADER 33 #define DEFAULT_NULL_LIKELIHOOD_VALUE 0 34 #define DEFAULT_NULL_DISTANCE_VALUE 0 44 enum ClassifierModes{STANDARD_CLASSIFIER_MODE=0,TIMESERIES_CLASSIFIER_MODE};
50 Classifier(
const std::string &classifierId =
"" );
72 bool copyBaseVariables(
const Classifier *classifier);
102 std::string getClassifierType()
const;
109 bool getSupportsNullRejection()
const;
116 bool getNullRejectionEnabled()
const;
124 Float getNullRejectionCoeff()
const;
133 Float getMaximumLikelihood()
const;
142 Float getBestDistance()
const;
149 Float getPhase()
const;
156 Float getTrainingSetAccuracy()
const;
163 virtual UINT getNumClasses()
const;
172 UINT getClassLabelIndexValue(
const UINT classLabel)
const;
179 UINT getPredictedClassLabel()
const;
230 bool enableNullRejection(
const bool useNullRejection);
238 virtual bool setNullRejectionCoeff(
const Float nullRejectionCoeff);
248 virtual bool setNullRejectionThresholds(
const VectorFloat &newRejectionThresholds);
276 static Classifier* create(
const std::string &
id );
286 GRT_DEPRECATED_MSG(
"createInstanceFromString is deprecated, use create instead.",
static Classifier* createInstanceFromString(
const std::string &
id ) );
302 const Classifier* getClassifierPointer()
const;
333 bool supportsNullRejection;
334 bool useNullRejection;
336 UINT predictedClassLabel;
338 Float nullRejectionCoeff;
342 Float trainingSetAccuracy;
355 if( !stringClassifierMap ){ stringClassifierMap =
new StringClassifierMap; }
356 return stringClassifierMap;
360 static StringClassifierMap *stringClassifierMap;
361 static UINT numClassifierInstances;
365 template<
typename T >
372 template<
typename T >
376 getMap()->insert( std::pair< std::string,
Classifier*(*)() >(newModuleId, &createNewClassifierInstance<T> ) );
382 #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)
bool loadBaseSettingsFromFile(std::fstream &file)
std::map< std::string, Classifier *(*)() > StringClassifierMap
GRT_DEPRECATED_MSG("saveModelToFile(std::string filename) is deprecated, use save(const std::string &filename) instead", virtual bool saveModelToFile(const std::string &filename) const )
Classifier * createNewClassifierInstance()
Returns a pointer to a new instance of the template class, the caller is responsible for deleting the...
This class provides an interface for classes to register themselves with the classifier base class...
This is the main base class that all GRT machine learning algorithms should inherit from...
This is the main base class that all GRT Classification algorithms should inherit from...