Model.classification_report¶
In [ ]:
Model.classification_report(cutoff = [],
labels: list = [])
Computes a classification report using multiple metrics to evaluate the model (AUC, accuracy, PRC AUC, F1...). In case of multiclass classification, it will consider each category as positive and switch to the next one during the computation.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
cutoff | float / list | ✓ | Cutoff for which the tested category will be accepted as prediction. In case of multiclass classification, each tested category becomes the positives and the others are merged into the negatives. The list will represent the classes threshold. If it is empty or invalid, the best cutoff will be used. |
labels | list | ✓ | List of the different labels to be used during the computation. |
Returns¶
tablesample : An object containing the result. For more information, see utilities.tablesample.
Example¶
In [49]:
# Multiclass Classification
from verticapy.learn.ensemble import RandomForestClassifier
model = RandomForestClassifier(name = "public.RF_iris",
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.iris", ["PetalLengthCm", "PetalWidthCm"], "Species")
# Multiclass Classification: Using a fixed cutoff
model.classification_report(cutoff = 0.33)
Out[49]:
In [50]:
# Multiclass Classification: Using automatic cutoffs
model.classification_report()
Out[50]:
In [41]:
# Multiclass Classification: Customized Cutoffs
model.classification_report(cutoff = [0.8, 0.4, 0.2])
Out[41]:
In [42]:
# Multiclass Classification: Choosing the categories
model.classification_report(labels = ["Iris-versicolor", "Iris-virginica"])
Out[42]:
