24 class CDistanceMachine;
76 virtual bool load(FILE* srcfile);
83 virtual bool save(FILE* dstfile);
89 void set_k(int32_t p_k);
140 virtual const char*
get_name()
const {
return "KMeans"; }
166 void set_random_centers(
float64_t* weights_set, int32_t* ClList, int32_t XSize);
168 float64_t* dists, int32_t* ClList, int32_t XSize);
169 void compute_cluster_variances();
virtual const char * get_name() const
virtual bool save(FILE *dstfile)
Class Distance, a base class for all the distances used in the Shogun toolbox.
int32_t max_iter
maximum number of iterations
int32_t dimensions
number of dimensions
SGVector< float64_t > R
radi of the clusters (size k)
A generic DistanceMachine interface.
virtual bool train_require_labels() const
SGVector< float64_t > get_radiuses()
KMeans clustering, partitions the data into k (a-priori specified) clusters.
#define MACHINE_PROBLEM_TYPE(PT)
virtual bool load(FILE *srcfile)
bool fixed_centers
whether to keep cluster centers fixed or not
void set_max_iter(int32_t iter)
void set_fixed_centers(bool fixed)
SGMatrix< float64_t > mus_initial
initial centers supplied
virtual void set_initial_centers(SGMatrix< float64_t > centers)
virtual EMachineType get_classifier_type()
The class Features is the base class of all feature objects.
virtual void store_model_features()
virtual bool train_machine(CFeatures *data=NULL)
int32_t k
the k parameter in KMeans
SGMatrix< float64_t > get_cluster_centers()