kaknikhil commented on a change in pull request #441: Kmeans: simplified 
silhouette per point for k-means
URL: https://github.com/apache/madlib/pull/441#discussion_r325337155
 
 

 ##########
 File path: src/ports/postgres/modules/kmeans/kmeans.py_in
 ##########
 @@ -387,5 +396,62 @@ def compute_kmeans(schema_madlib, rel_args, rel_state, 
rel_source,
                             'old_centroid': old_centroid_str}))
     return iterationCtrl.iteration
 
+def simple_silhouette_points(schema_madlib, rel_source, output_table, pid,
+    expr_point, centroids, fn_dist, **kwargs):
+
+    with MinWarning("error"):
+        kmeans_validate_src(schema_madlib, rel_source)
+        output_tbl_valid(output_table, 'kmeans')
+
+        _assert(type(centroids) == list and
+                type(centroids[0]) == list and
+                len(centroids) > 1,
+                'kmeans: invalid centroids shape')
 
 Review comment:
   I believe we should be more verbose in this error message by printing out 
our expectation of the centroid shape. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to