Model.to_memmodel¶
In [ ]:
Model.to_memmodel()
Example¶
In [5]:
from verticapy.learn.ensemble import RandomForestClassifier
model = RandomForestClassifier(name = "public.rf_iris",
n_estimators = 3,
max_depth = 3)
model.fit("public.iris", ["PetalLengthCm",
"SepalLengthCm",
"SepalWidthCm"],
"Species")
mmodel = model.to_memmodel()
mmodel
Out[5]:
In [6]:
# Scoring using Standard SQL
mmodel.predict_sql(["PetalLengthCm",
"SepalLengthCm",
"SepalWidthCm"])
Out[6]:
In [7]:
# Computing probabilites using Standard SQL
mmodel.predict_proba_sql(["PetalLengthCm",
"SepalLengthCm",
"SepalWidthCm"])
Out[7]:
In [8]:
# Scoring in-memory
mmodel.predict([[1.2, 5.6, 7.9],
[2.3, 1.3, 5.5]])
Out[8]:
In [9]:
# Computing the probabilities in-memory
mmodel.predict_proba([[1.2, 5.6, 7.9],
[2.3, 1.3, 5.5]])
Out[9]:
