Model.classification_report / report¶
In [ ]:
Model.report(cutoff = [],
labels: list = [],
nbins: int = 10000)
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. |
nbins | int | ✓ | [Used to compute ROC AUC, PRC AUC and the best cutoff] An integer value that determines the number of decision boundaries. Decision boundaries are set at equally spaced intervals between 0 and 1, inclusive. Greater values for nbins give more precise estimations of the metrics, but can potentially decrease performance. The maximum value is 999,999. If negative, the maximum value is used. |
Returns¶
tablesample : An object containing the result. For more information, see utilities.tablesample.
Example¶
In [6]:
from verticapy.datasets import load_iris
iris = load_iris()
# 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(iris, ["PetalLengthCm", "PetalWidthCm"], "Species")
# Multiclass Classification: Using a fixed cutoff
model.report(cutoff = 0.33)
Out[6]:
In [7]:
# Multiclass Classification: Using automatic cutoffs
model.report()
Out[7]:
In [8]:
# Multiclass Classification: Customized Cutoffs
model.report(cutoff = [0.8, 0.4, 0.2])
Out[8]:
In [9]:
# Multiclass Classification: Choosing the categories
model.report(labels = ["Iris-versicolor", "Iris-virginica"])
Out[9]: