changes cluster centers to json

This commit is contained in:
Andy Eschbacher
2016-11-10 16:56:04 +00:00
parent a188b2e104
commit 64c4b6611c
2 changed files with 7 additions and 5 deletions

View File

@@ -15,14 +15,14 @@ CREATE OR REPLACE FUNCTION CDB_KMeansNonspatial(
query TEXT,
colnames TEXT[],
num_clusters INTEGER,
id_col TEXT DEFAULT 'cartodb_id',
id_colname TEXT DEFAULT 'cartodb_id',
standarize BOOLEAN DEFAULT true
)
RETURNS TABLE(cluster_label text, cluster_center text, rowid bigint) AS $$
RETURNS TABLE(cluster_label text, cluster_center json, rowid bigint) AS $$
from crankshaft.clustering import kmeans_nonspatial
return kmeans_nonspatial(query, colnames, num_clusters,
id_col, standarize)
id_colname, standarize)
$$ LANGUAGE plpythonu;