f1_score¶
In [ ]:
f1_score(y_true: str,
y_score: str,
input_relation: Union[str, vDataFrame],
pos_label: Union[int, float, str] = 1)
Computes the F1-score.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
y_true | str | ❌ | Response column. |
y_score | str | ❌ | 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. |
pos_label | int / float / str | ✓ | Represents the positive response class. One of the response column classes must be positive to compute the F1-score. |
Returns¶
float : score
Example¶
In [118]:
from verticapy import vDataFrame
vDataFrame("example_classification")
Out[118]:
In [119]:
from verticapy.learn.metrics import f1_score
f1_score("y_true", "y_pred", "example_classification")
Out[119]:
