Error while executing kmean using madlib library on Greenplum

108 Views Asked by At

I am trying to run kmean algorithm using madlib library, tool used aginity tried executing :

SELECT * FROM madlib.kmeans_random('select "MPrice" as "MPrice" from "madlib"."sample_sordetail"','MPrice',2,'madlib.squared_dist_norm2','madlib.avg',10,0.001) 

my table name is sample_sordetail.

I am getting the error :

ERROR: XX000: plpy.Error: kmeans error: Data table does not exist! (plpython.c:4648)

Please suggest how to resolve this issue.

2

There are 2 best solutions below

1
On

After struggling a lot I got to know the error is due to the data format. The MPrice column should have type points double precision[]. Reference http://madlib.incubator.apache.org/docs/master/group__grp__kmeans.html

After changing MPrice to double precision I was able to execute kmean algorithm on the dataset.

4
On

madlib_kmean Please check the kmean_random parameter definition. rel_source -> TEXT. You need to put table name here. "select ......from ..." is not a table. You should be able to find the tutorial in this madlib website.