standardize id_col naming convention

This commit is contained in:
Andy Eschbacher
2017-01-10 10:52:10 -05:00
parent a32b212412
commit ee5e7d81ae
2 changed files with 3 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ As a standard machine learning method, k-means clustering is an unsupervised lea
| query | TEXT | SQL query to expose the data to be used in the analysis (e.g., `SELECT * FROM iris_data`). It should contain at least the columns specified in `colnames` and the `id_colname`. |
| colnames | TEXT[] | Array of columns to be used in the analysis (e.g., `Array['petal_width', 'sepal_length', 'petal_length']`). |
| no\_clusters | INTEGER | Number of clusters for the classification of the data |
| id_colname (optaional) | TEXT | The id column (default: 'cartodb_id') for identifying rows |
| id_col (optional) | TEXT | The id column (default: 'cartodb_id') for identifying rows |
| standarize (optional) | BOOLEAN | Setting this to true (default) standardizes the data to have a mean at zero and a standard deviation of 1 |
### Returns

View File

@@ -21,7 +21,7 @@ CREATE OR REPLACE FUNCTION CDB_KMeansNonspatial(
colnames TEXT[],
num_clusters INTEGER,
standardize BOOLEAN DEFAULT true,
id_colname TEXT DEFAULT 'cartodb_id'
id_col TEXT DEFAULT 'cartodb_id'
)
RETURNS TABLE(cluster_label text, cluster_center json, silhouettes numeric, rowid bigint) AS $$
@@ -29,7 +29,7 @@ RETURNS TABLE(cluster_label text, cluster_center json, silhouettes numeric, rowi
kmeans = Kmeans()
return kmeans.nonspatial(query, colnames, num_clusters,
standardize=standardize,
id_col=id_colname)
id_col=id_col)
$$ LANGUAGE plpythonu;