projects
/
clueless-kmeans.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clueless-kmean now takes as parameter in which mode to work, and test.sh generate...
[clueless-kmeans.git]
/
clusterer.h
diff --git
a/clusterer.h
b/clusterer.h
index
b45f8c3
..
a0a29f9
100644
(file)
--- a/
clusterer.h
+++ b/
clusterer.h
@@
-30,32
+30,39
@@
class Clusterer {
public:
class Clusterer {
public:
- enum { STANDARD_ASSOCIATION, STANDARD_LP_ASSOCIATION, UNINFORMATIVE_LP_ASSOCIATION };
+ enum {
+ STANDARD_ASSOCIATION,
+ STANDARD_LP_ASSOCIATION,
+ UNINFORMATIVE_LP_ASSOCIATION
+ };
const static int max_nb_iterations = 10;
const static scalar_t min_iteration_improvement = 0.999;
const static int max_nb_iterations = 10;
const static scalar_t min_iteration_improvement = 0.999;
+ const static scalar_t min_cluster_variance = 0.01f;
int _nb_clusters;
int _dim;
int _nb_clusters;
int _dim;
+
scalar_t **_cluster_means, **_cluster_var;
scalar_t **_cluster_means, **_cluster_var;
+ scalar_t distance_to_centroid(scalar_t *x, int k);
+
void initialize_clusters(int nb_points, scalar_t **points);
void initialize_clusters(int nb_points, scalar_t **points);
- //
Does the s
tandard hard k-mean association
+ //
S
tandard hard k-mean association
scalar_t baseline_cluster_association(int nb_points, scalar_t **points,
int nb_classes, int *labels,
scalar_t **gamma);
scalar_t baseline_cluster_association(int nb_points, scalar_t **points,
int nb_classes, int *labels,
scalar_t **gamma);
- //
Does the same with an LP formulation, as a sanity check
+ //
Standard k-mean association implemented as an LP optimization
scalar_t baseline_lp_cluster_association(int nb_points, scalar_t **points,
int nb_classes, int *labels,
scalar_t **gamma);
scalar_t baseline_lp_cluster_association(int nb_points, scalar_t **points,
int nb_classes, int *labels,
scalar_t **gamma);
- // Does the association under constraints that each cluster gets
- // associated clusters with the same class proportion as the overall
- // training set
+ // Association under the constraint that each cluster gets the same
+ // class proportions as the overall training set
scalar_t uninformative_lp_cluster_association(int nb_points, scalar_t **points,
int nb_classes, int *labels,
scalar_t uninformative_lp_cluster_association(int nb_points, scalar_t **points,
int nb_classes, int *labels,