classification_report¶
In [ ]:
classification_report(y_true: str = "",
y_score: list = [],
input_relation: (str, vDataFrame) = "",
cursor = None,
labels: list = [],
cutoff: (float, list) = [],
estimator = None)
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. |
cursor | DBcursor | ✓ | Vertica DB cursor. |
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. |
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]:
