Model.to_sklearn

In [ ]:
Model.to_sklearn()

Converts the Vertica model to an sklearn model.

Returns

object : sklearn model.

Example

In [6]:
from verticapy.learn.linear_model import LogisticRegression
model = LogisticRegression(name = "public.logit_titanic")
model.drop()
model.fit("public.titanic", 
          ["fare", "age"], 
          "survived")
skmodel = model.to_sklearn()
type(skmodel)
Out[6]:
sklearn.linear_model._logistic.LogisticRegression
In [8]:
skmodel.predict([[93., 11.]])
Out[8]:
array([1])
In [9]:
skmodel.predict_proba([[93., 11.]])
Out[9]:
array([[0.34126229, 0.65873771]])