Page 1 of 1

Vertica Logistic Reg Function

Posted: Fri Feb 23, 2018 8:55 am
by neha_datopic
Hi,

I am trying to execute the Machine Learning Example of Vertica. I have created the schema and copied the data.
Now when i am creating the Logistic Model using the below query

SELECT logistic_Reg('logistic_reg_mtcars', 'mtcars_train', 'am', 'cyl, wt' USING PARAMETERS exclude_columns='hp');

I get error. The Error message is:

ERROR 3457: Function logisticReg(unknown, unknown, unknown, unknown) does not exist, or permission is denied for logisticReg(unknown, unknown, unknown, unknown)
HINT: No function matches the given name and argument types. You may need to add explicit type casts

If anyone can help please.

Thanks,
Neha

Re: Vertica Logistic Reg Function

Posted: Sat Feb 24, 2018 4:33 pm
by JimKnicely
Hi,

The privileges on the ML functions must not be granted to PUBLIC.

Have the admin user run the following script in vsql to reinstall the ML Package:

vsql -f /opt/vertica/packages/MachineLearning/ddl/install.sql

After re-installing you should see the EXECUTE privilege granted to PUBLIC:

dbadmin=> SELECT * FROM grants WHERE object_name = 'predict_linear_reg';
grant_id | grantor_id | grantor | privileges_description | object_schema | object_name | object_id | object_type | grantee_id | grantee
-------------------+-------------------+---------+------------------------+---------------+--------------------+-------------------+-------------+-------------------+---------
45035996273716036 | 45035996273704962 | dbadmin | EXECUTE* | public | predict_linear_reg | 45035996273716034 | PROCEDURE | 45035996273704962 | dbadmin
45035996273716038 | 45035996273704962 | dbadmin | EXECUTE | public | predict_linear_reg | 45035996273716034 | PROCEDURE | 45035996273704964 | public
(2 rows)