/gist:32c85f3aa85b8f69d52c Secret
Last active
August 29, 2015 14:05
Computing k-means clustering in MADlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT data.*, (madlib.closest_column(centroids, points)).column_id as cluster_id | |
FROM public.iris_data as data, | |
(SELECT centroids | |
FROM madlib.kmeanspp('iris_data', 'points', | |
<Parameters.K>, | |
<Parameters.distance function>, | |
<Parameters.aggregation method>, | |
<Parameters.max number of iterations>, | |
<Parameters.min frac reassigned >)) as centroids | |
ORDER BY data.pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment