Model.classification_report

In [ ]:
Model.classification_report(cutoff: float = 0.5)

Computes a classification report using multiple metrics to evaluate the model (AUC, accuracy, PRC AUC, F1...).

Parameters

Name Type Optional Description
cutoff
float / list
✓
Model Cutoff. If it is empty or invalid, the best cutoff will be used.

Returns

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

Example

In [46]:
from verticapy.learn.ensemble import RandomForestClassifier
# Binary Classification
model = RandomForestClassifier(name = "public.RF_titanic",
                               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.titanic", ["age", "fare", "gender"], "survived")
# Binary Classification: the cutoff is the probability
# to accept the class 1
model.classification_report(cutoff = 0.5)
value
auc0.8363509543235186
prc_auc0.8136421304830644
accuracy0.7911646586345381
log_loss0.200409253914396
precision0.7479674796747967
recall0.7058823529411765
f1_score0.7697318967677275
mcc0.5583244993710523
informedness0.5521633446767136
markedness0.5645544015248765
csi0.5702479338842975
cutoff0.5
Out[46]:

In [47]:
# Binary Classification: automatic cutoff
model.classification_report()
value
auc0.8363509543235186
prc_auc0.8136421304830644
accuracy0.7941767068273092
log_loss0.200409253914396
precision0.7372448979591837
recall0.7391304347826086
f1_score0.781824011726444
mcc0.5686265557600708
informedness0.5688825008983112
markedness0.5683707257737534
csi0.5850202429149798
cutoff0.403
Out[47]: