Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
K-means does not accept an array expression as input for the data points.
- Error repro:
ERROR: plpy.SPIError: syntax error at or near "," (plpython.c:4648) LINE 7: ...AY[madlib.weighted_sample(_src.ARRAY[second_attack, treatmen... ^ QUERY: INSERT INTO pg_temp._madlib_kmeanspp_state SELECT 0, ( SELECT ARRAY[madlib.weighted_sample(_src.ARRAY[second_attack, treatment, trait_anxiety]::FLOAT8[], 1)] as b FROM _madlib_patients_filtered AS _src ) CONTEXT: Traceback (most recent call last): PL/Python function "internal_compute_kmeanspp_seeding", line 22, in <module> return kmeans.compute_kmeanspp_seeding(**globals()) PL/Python function "internal_compute_kmeanspp_seeding", line 70, in compute_kmeanspp_seeding PL/Python function "internal_compute_kmeanspp_seeding", line 308, in update PL/Python function "internal_compute_kmeanspp_seeding", line 110, in runSQL PL/Python function "internal_compute_kmeanspp_seeding" SQL statement "SELECT ( SELECT madlib.internal_compute_kmeanspp_seeding( '_madlib_kmeanspp_args', '_madlib_kmeanspp_state', textin(regclassout( $1 )), $2 ) )" PL/pgSQL function "kmeanspp_seeding" line 54 at assignment SQL statement "SELECT madlib.kmeans( $1 , $2 , madlib.kmeanspp_seeding( $1 , $2 , $3 , 'madlib.squared_dist_norm2'::VARCHAR), 'madlib.squared_dist_norm2', 'madlib.avg', 20, 0.001)" PL/pgSQL function "kmeanspp" line 4 at assignment