memModel.predict_sql

In [ ]:
memModel.predict_sql(X: list)

Returns the SQL code to deploy the model.

Parameters

Name Type Optional Description
X
list
❌
Names or values of the input predictors.

Returns

str : SQL code.

Example

In [16]:
from verticapy.learn.memmodel import memModel
model = memModel("BinaryTreeClassifier", {"children_left": [1, 3, None, None, None], 
                                          "children_right": [2, 4, None, None, None],
                                          "feature": [0, 1, None, None, None],
                                          "threshold": ['female', 30, None, None, None],
                                          "value": [None, None, [0.8, 0.1, 0.1], [0.1, 0.8, 0.1], [0.2, 0.2, 0.6]],
                                          "classes": ['a', 'b', 'c',]})
model.predict_sql(["sex", "fare"])
Out[16]:
"(CASE WHEN sex = 'female' THEN (CASE WHEN fare < '30' THEN 'b' ELSE 'c' END) ELSE 'a' END)"