31 #ifndef GRT_CLUSTERER_HEADER 32 #define GRT_CLUSTERER_HEADER 67 bool copyBaseVariables(
const Clusterer *clusterer);
99 virtual bool reset()
override;
106 virtual bool clear()
override;
113 UINT getNumClusters()
const;
120 UINT getPredictedClusterLabel()
const;
129 Float getMaximumLikelihood()
const;
138 Float getBestDistance()
const;
163 GRT_DEPRECATED_MSG(
"getClustererType() is deprecated, use getId() or getBaseId() instead", std::string getClustererType()
const );
173 bool setNumClusters(
const UINT numClusters);
186 static Clusterer* create( std::string
const &
id );
196 GRT_DEPRECATED_MSG(
"createInstanceFromString is deprecated, use create instead.",
static Clusterer* createInstanceFromString(
const std::string &
id ) );
212 const Clusterer& getBaseClusterer()
const;
230 bool saveClustererSettingsToFile( std::fstream &file )
const;
237 bool loadClustererSettingsFromFile( std::fstream &file );
249 static StringClustererMap *getMap() {
250 if( !stringClustererMap ){ stringClustererMap =
new StringClustererMap; }
251 return stringClustererMap;
255 static StringClustererMap *stringClustererMap;
256 static UINT numClustererInstances;
266 template<
typename T >
270 getMap()->insert( std::pair< std::string,
Clusterer*(*)() >(newModuleId, &createNewClustererModuleInstance< T > ) );
276 #endif //GRT_CLUSTERER_HEADER
Clusterer * createNewClustererModuleInstance()
Returns a pointer to a new instance of the template class, the caller is responsible for deleting the...
virtual bool train(ClassificationData trainingData)
virtual bool deepCopyFrom(const Clusterer *clusterer)
std::map< std::string, Clusterer *(*)() > StringClustererMap
UINT predictedClusterLabel
Stores the predicted cluster label from the most recent predict( )
This class provides an interface for classes to register themselves with the clusterer base class...
UINT numClusters
Number of clusters in the model.
virtual bool train_(ClassificationData &trainingData)
GRT_DEPRECATED_MSG("saveModelToFile(std::string filename) is deprecated, use save(const std::string &filename) instead", virtual bool saveModelToFile(const std::string &filename) const )
This is the main base class that all GRT machine learning algorithms should inherit from...