classification_report¶
In [ ]:
classification_report(y_true: str = "",
y_score: list = [],
input_relation: Union[str, vDataFrame] = "",
labels: list = [],
cutoff: Union[float, list] = [],
estimator = None,
nbins: int = 10000)
Computes a classification report using multiple metrics (AUC, accuracy, PRC AUC, F1...). It will consider each category as positive and switch to the next one during the computation.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
y_true | str | ✓ | Response column. |
y_score | list | ✓ | List containing the probability and the prediction. |
input_relation | str / vDataFrame | ✓ | The relation used for scoring. This relation can be a view, table, or customized relation. For example, you could write: "(SELECT ... FROM ...) x" as long as an alias is given at the end of the relation. |
labels | list | ✓ | List of the response column categories to use. |
cutoff | float / list | ✓ | Cutoff for which the tested category will be accepted as prediction. In case of multiclass classification, the list will represent the the classes threshold. If it is empty, the best cutoff will be used. |
estimator | object | ✓ | Estimator to use to compute the classification report. |
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 [110]:
from verticapy import vDataFrame
vDataFrame("example_classification")
Out[110]:
In [111]:
from verticapy.learn.metrics import classification_report
classification_report("y_true",
["y_score", "y_pred"],
"example_classification")
Out[111]: