Model.score¶
In [ ]:
Model.score(method: str = "r2")
Scores the model.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
method | str | ✓ | The method to use to score the model.
|
Returns¶
float : score
Example¶
In [34]:
from verticapy.learn.ensemble import RandomForestRegressor
model = RandomForestRegressor(name = "public.RF_winequality",
n_estimators = 20,
max_features = "auto",
max_leaf_nodes = 32,
sample = 0.7,
max_depth = 3,
min_samples_leaf = 5,
min_info_gain = 0.0,
nbins = 32)
model.fit("public.winequality",
["alcohol", "fixed_acidity", "pH", "density"],
"quality")
# R2
model.score(method = "r2")
Out[34]:
In [35]:
# MSLE
model.score(method = "msle")
Out[35]:
In [36]:
# Mean Absolute Error
model.score(method = "mae")
Out[36]: