vDataFrame.score¶
In [ ]:
vDataFrame.score(y_true: str,
y_score: str,
method: str,
nbins: int = 30,)
Computes the score using the input columns and the input method.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
y_true | str | ❌ | Response column. |
y_score | str | ❌ | Prediction. |
method | str | ❌ | The method to use to compute the score. For Classification:
For Regression:
Plots:
|
nbins | int | ✓ | [Only when method is set to auc|prc_auc|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 AUC, but can potentially decrease performance. The maximum value is 999,999. If negative, the maximum value is used. |
In [62]:
from verticapy.datasets import load_titanic
titanic = load_titanic().select(["age", "fare", "survived"])
display(titanic)
In [63]:
from verticapy.learn.linear_model import LogisticRegression
model = LogisticRegression(name = "public.LR_titanic",
tol = 1e-4,
C = 1.0,
max_iter = 100,
solver = 'CGD',
l1_ratio = 0.5)
model.fit("public.titanic", ["fare", "age"], "survived")
model.predict(titanic, name = "survived_pred")
Out[63]:
In [64]:
# Computing AUC
titanic.score(y_true = "survived",
y_score = "survived_pred",
method = "auc")
Out[64]:
In [65]:
# Computing MSE
titanic.score(y_true = "survived",
y_score = "survived_pred",
method = "mse")
Out[65]:
In [39]:
# Drawing ROC Curve
titanic.score(y_true = "survived",
y_score = "survived_pred",
method = "roc")
In [40]:
# Drawing PRC Curve
titanic.score(y_true = "survived",
y_score = "survived_pred",
method = "prc")
See Also¶
| vDataFrame.aggregate | Computes the vDataFrame input aggregations. |
