31 #ifndef GRT_CLASSIFIER_HEADER
32 #define GRT_CLASSIFIER_HEADER
38 #define DEFAULT_NULL_LIKELIHOOD_VALUE 0
39 #define DEFAULT_NULL_DISTANCE_VALUE 0
310 string classifierType;
311 bool supportsNullRejection;
312 bool useNullRejection;
314 UINT predictedClassLabel;
316 double nullRejectionCoeff;
317 double maxLikelihood;
320 VectorDouble classLikelihoods;
321 VectorDouble classDistances;
322 VectorDouble nullRejectionThresholds;
323 vector< UINT > classLabels;
324 vector<MinMax> ranges;
326 static StringClassifierMap *getMap() {
328 return stringClassifierMap;
331 enum ClassifierModes{STANDARD_CLASSIFIER_MODE=0,TIMESERIES_CLASSIFIER_MODE};
334 static StringClassifierMap *stringClassifierMap;
335 static UINT numClassifierInstances;
340 template<
typename T > Classifier* getNewClassificationModuleInstance() {
return new T; }
342 template<
typename T >
346 getMap()->insert( std::pair<
string,
Classifier*(*)()>(newClassificationModuleName, &getNewClassificationModuleInstance< T > ) );
352 #endif //GRT_CLASSIFIER_HEADER
const Classifier & getBaseClassifier() const
static Classifier * createInstanceFromString(string const &classifierType)
virtual bool recomputeNullRejectionThresholds()
virtual bool setNullRejectionThresholds(VectorDouble newRejectionThresholds)
bool getTimeseriesCompatible() const
const Classifier * getClassifierPointer() const
virtual bool deepCopyFrom(const Classifier *classifier)
bool copyBaseVariables(const Classifier *classifier)
std::map< string, Classifier *(*)() > StringClassifierMap
bool loadBaseSettingsFromFile(fstream &file)
virtual UINT getNumClasses() const
VectorDouble getClassLikelihoods() const
Classifier * deepCopy() const
VectorDouble getClassDistances() const
static vector< string > getRegisteredClassifiers()
double getMaximumLikelihood() const
bool saveBaseSettingsToFile(fstream &file) const
This is the main base class that all GRT machine learning algorithms should inherit from...
UINT getClassLabelIndexValue(UINT classLabel) const
double getNullRejectionCoeff() const
virtual ~Classifier(void)
VectorDouble getNullRejectionThresholds() const
bool getNullRejectionEnabled() const
double getBestDistance() const
UINT getPredictedClassLabel() const
Classifier * createNewInstance() const
vector< MinMax > getRanges() const
string getClassifierType() const
bool enableNullRejection(bool useNullRejection)
vector< UINT > getClassLabels() const
virtual bool setNullRejectionCoeff(double nullRejectionCoeff)
bool getSupportsNullRejection() const