Repository 'marea'
hg clone https://toolshed.g2.bx.psu.edu/repos/bimib/marea

Changeset 37:2495c7772ca8 (2019-11-25)
Previous changeset 36:94c51690d40c (2019-11-25) Next changeset 38:4e1b466935cd (2019-11-25)
Commit message:
Uploaded
modified:
Marea/marea_cluster.py
Marea/marea_cluster.xml
b
diff -r 94c51690d40c -r 2495c7772ca8 Marea/marea_cluster.py
--- a/Marea/marea_cluster.py Mon Nov 25 06:46:04 2019 -0500
+++ b/Marea/marea_cluster.py Mon Nov 25 11:57:57 2019 -0500
[
@@ -34,7 +34,7 @@
     
     parser.add_argument('-cy', '--cluster_type',
                         type = str,
-                        choices = ['kmeans', 'meanshift', 'dbscan', 'hierarchy'],
+                        choices = ['kmeans', 'dbscan', 'hierarchy'],
                         default = 'kmeans',
                         help = 'choose clustering algorythm')
     
@@ -60,12 +60,6 @@
                         choices = ['true', 'false'],
                         help = 'choose if you want silhouette plots')
     
-    parser.add_argument('-db', '--davies', 
-                        type = str,
-                        default = 'false',
-                        choices = ['true', 'false'],
-                        help = 'choose if you want davies bouldin scores')
-    
     parser.add_argument('-td', '--tool_dir',
                         type = str,
                         required = True,
@@ -152,7 +146,7 @@
     
 ################################ kmeans #####################################
     
-def kmeans (k_min, k_max, dataset, elbow, silhouette, davies, best_cluster):
+def kmeans (k_min, k_max, dataset, elbow, silhouette, best_cluster):
     if not os.path.exists('clustering'):
         os.makedirs('clustering')
     
@@ -167,12 +161,6 @@
     else:
         silhouette = False
         
-    if davies == 'true':
-        davies = True
-    else:
-        davies = False
-        
-
     range_n_clusters = [i for i in range(k_min, k_max+1)]
     distortions = []
     scores = []
@@ -341,7 +329,7 @@
     
     plt.figure(figsize=(10, 7))  
     plt.title("Customer Dendograms")  
-    shc.dendrogram(shc.linkage(dataset, method='ward'))  
+    shc.dendrogram(shc.linkage(dataset, method='ward'), labels=dataset.index.values.tolist())  
     fig = plt.gcf()
     fig.savefig('clustering/dendogram.png', dpi=200)
     
@@ -397,7 +385,7 @@
     
     
     if args.cluster_type == 'kmeans':
-        kmeans(args.k_min, args.k_max, X, args.elbow, args.silhouette, args.davies, args.best_cluster)
+        kmeans(args.k_min, args.k_max, X, args.elbow, args.silhouette, args.best_cluster)
     
     if args.cluster_type == 'dbscan':
         dbscan(X, args.eps, args.min_samples, args.best_cluster)
b
diff -r 94c51690d40c -r 2495c7772ca8 Marea/marea_cluster.xml
--- a/Marea/marea_cluster.xml Mon Nov 25 06:46:04 2019 -0500
+++ b/Marea/marea_cluster.xml Mon Nov 25 11:57:57 2019 -0500
b
@@ -1,4 +1,4 @@
-<tool id="MaREA_cluester" name="Cluster Analysis" version="1.0.9">
+<tool id="MaREA_cluester" name="Cluster Analysis" version="1.1.0">
     <description></description>
     <macros>
         <import>marea_macros.xml</import>