validation_curve¶
In [ ]:
validation_curve(estimator,
param_name: str,
param_range: list,
input_relation: (str, vDataFrame),
X: list,
y: str,
metric: str = "auto",
cv: int = 3,
pos_label: (int, float, str) = None,
cutoff: float = -1,
std_coeff: float = 1,
ax=None,
**style_kwds,)
Draws the validation curve.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
estimator | object | ❌ | Vertica estimator having a fit method. |
param_name | str | ❌ | Parameter name. |
param_range | list | ❌ | Parameter Range. |
input_relation | str / vDataFrame | ❌ | Input Relation. |
X | list | ❌ | List of the predictor columns. |
y | str | ❌ | Response Column. |
metric | str / list | ✓ | Metric used to do the model evaluation. It can also be a list of metrics.
For Classification:
For Regression:
|
cv | int | ✓ | Number of folds. |
pos_label | int / float / str | ✓ | The main class to be considered as positive (classification only). |
cutoff | float | ✓ | The model cutoff (classification only). |
std_coeff | float | ✓ | Value of the standard deviation coefficient used to compute the area plot around each score. |
ax | Matplotlib axes object | ✓ | The axes to plot on. |
**style_kwds | any | ✓ | Any optional parameter to pass to the Matplotlib functions. |
Returns¶
tablesample : An object containing the result. For more information, see utilities.tablesample.
Example¶
In [5]:
from verticapy.learn.ensemble import RandomForestClassifier
model = RandomForestClassifier(name = "public.RF_titanic")
from verticapy.learn.model_selection import validation_curve
validation_curve(model,
"max_depth",
[1, 5, 8, 10, 20, 30, 40, 50, 60],
input_relation = "public.titanic_clean",
X = ["age", "fare", "parch",],
y = "survived",
cv = 3,
metric = "auc",)
Out[5]:
