29 #ifndef GRT_HIERARCHICAL_CLUSTERING_HEADER 30 #define GRT_HIERARCHICAL_CLUSTERING_HEADER 32 #include "../../CoreModules/Clusterer.h" 52 this->uniqueClusterID = rhs.uniqueClusterID;
53 this->clusterVariance = rhs.clusterVariance;
54 this->indexs = rhs.indexs;
60 UINT& operator[](
const UINT &i){
64 UINT operator[](
const UINT &i)
const{
68 void addSampleToCluster(UINT i){
69 indexs.push_back( i );
72 UINT getUniqueClusterID()
const{
73 return uniqueClusterID;
76 UINT getNumSamplesInCluster()
const{
77 return (UINT)indexs.size();
80 Float getClusterVariance()
const{
81 return clusterVariance;
84 unsigned int uniqueClusterID;
85 Float clusterVariance;
96 this->level = rhs.level;
97 this->clusters = rhs.clusters;
107 this->level = rhs.level;
108 this->clusters = rhs.clusters;
122 UINT getLevel()
const{
126 UINT getNumClusters()
const{
127 return (UINT)clusters.size();
177 virtual bool reset();
184 virtual bool clear();
217 virtual bool saveModelToFile( std::fstream &file )
const;
226 virtual bool loadModelFromFile( std::fstream &file );
233 using MLBase::saveModelToFile;
234 using MLBase::loadModelFromFile;
241 static std::string
getId();
244 inline Float SQR(
const Float &a) {
return a*a;};
245 Float squaredEuclideanDistance(
const Float *a,
const Float *b);
256 static const std::string id;
262 #endif //GRT_HIERARCHICAL_CLUSTERING_HEADER std::string getId() const
virtual bool reset() override
virtual bool clear() override
virtual bool deepCopyFrom(const Clusterer *clusterer)
virtual bool train_(MatrixFloat &trainingData) override