Model.regression_report / report

In [ ]:
Model.report(method: str = "metrics")

Computes a regression report using multiple metrics to evaluate the model (r2, mse, max error...).

Parameters

Name Type Optional Description
method
str
The method to use to compute the score.
  • anova : Computes the model ANOVA table.
  • details : Computes the model details.
  • metrics : Computes the model different metrics.

Returns

tablesample : An object containing the result. For more information, see utilities.tablesample.

Example

In [7]:
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.drop()
model.fit("public.winequality", ["alcohol", "fixed_acidity"], "quality")
# metrics
model.report()
Out[7]:
value
explained_variance0.200278059718928
max_error3.42100345960034
median_absolute_error0.536239695275772
mean_absolute_error0.637335798291648
mean_squared_error0.60986700452594
root_mean_squared_error0.7809398213216816
r20.200129728147483
r2_adj0.19988338682569295
aic-3206.8598680821424
bic-3186.522580649501
Rows: 1-10 | Columns: 2
In [9]:
# ANOVA
model.report("anova")
Out[9]:
Df
SS
MS
F
p_value
Regression2829.977510545617414.9887552728085687.05758874187522.1083023654898362e-271
Residual64943922.432443656620.6040086916625531
Total64964953.68570109281
Rows: 1-3 | Columns: 6
In [10]:
# details
model.report("details")
Out[10]:
value
Dep. Variable"quality"
ModelRandomForestRegressor
No. Observations6497.0
No. Predictors2
R-squared0.208178984227579
Adj. R-squared0.2079351218882588
F-statistic687.0575887418752
Prob (F-statistic)2.1083023654898362e-271
Kurtosis0.232322269343305
Skewness0.189622693372695
Jarque-Bera (JB)53.1115447611131
Rows: 1-11 | Columns: 2