]> git.donarmstrong.com Git - mothur.git/blobdiff - kmeans.h
added Jensen-Shannon calc. working on get.communitytype command. fixed bug in get...
[mothur.git] / kmeans.h
diff --git a/kmeans.h b/kmeans.h
new file mode 100644 (file)
index 0000000..97dfb68
--- /dev/null
+++ b/kmeans.h
@@ -0,0 +1,32 @@
+//
+//  kmeans.h
+//  Mothur
+//
+//  Created by SarahsWork on 12/4/13.
+//  Copyright (c) 2013 Schloss Lab. All rights reserved.
+//
+
+#ifndef Mothur_kmeans_h
+#define Mothur_kmeans_h
+
+#include "communitytype.h"
+
+/**************************************************************************************************/
+
+class KMeans : public CommunityTypeFinder {
+    
+public:
+    KMeans(vector<vector<int> >, int);
+    vector<double> calcSilhouettes(vector< vector< double> >);
+    double calcCHIndex(vector< vector< double> >);
+    
+private:
+
+    int findSecondClosest(vector<int>&, vector<vector<double> >&, map<int, int>);
+    double calcScore(int sample, int partition, vector<vector<double> >&, map<int, int>);
+
+};
+
+/**************************************************************************************************/
+
+#endif