31 #ifndef GRT_CLUSTERER_HEADER
32 #define GRT_CLUSTERER_HEADER
66 bool copyBaseVariables(
const Clusterer *clusterer);
105 virtual bool clear();
113 bool getConverged()
const;
120 UINT getNumClusters()
const;
127 UINT getPredictedClusterLabel()
const;
136 Float getMaximumLikelihood()
const;
145 Float getBestDistance()
const;
175 std::string getClustererType()
const;
185 bool setNumClusters(
const UINT numClusters);
198 static Clusterer* createInstanceFromString( std::string
const &ClustererType );
221 const Clusterer& getBaseClusterer()
const;
239 bool saveClustererSettingsToFile( std::fstream &file )
const;
246 bool loadClustererSettingsFromFile( std::fstream &file );
248 std::string clustererType;
259 static StringClustererMap *getMap() {
260 if( !stringClustererMap ){ stringClustererMap =
new StringClustererMap; }
261 return stringClustererMap;
265 static StringClustererMap *stringClustererMap;
266 static UINT numClustererInstances;
271 template<
typename T >
Clusterer* getNewClassificationModuleInstance() {
return new T; }
273 template<
typename T >
277 getMap()->insert( std::pair< std::string,
Clusterer*(*)() >(newClassificationModuleName, &getNewClassificationModuleInstance< T > ) );
283 #endif //GRT_CLUSTERER_HEADER
virtual bool train(ClassificationData trainingData)
virtual bool deepCopyFrom(const Clusterer *clusterer)
std::map< std::string, Clusterer *(*)() > StringClustererMap
This is the main base class that all GRT machine learning algorithms should inherit from...
UINT predictedClusterLabel
Stores the predicted cluster label from the most recent predict( )
UINT numClusters
Number of clusters in the model.
virtual bool train_(ClassificationData &trainingData)