learning_curve¶
In [ ]:
learning_curve(estimator,
input_relation: (str, vDataFrame),
X: list,
y: str,
sizes: list = [0.1, 0.33, 0.55, 0.78, 1.0],
method = "efficiency",
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 learning curve.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
estimator | object | ❌ | Vertica estimator having a fit method. |
input_relation | str / vDataFrame | ❌ | Input Relation. |
X | list | ❌ | List of the predictor columns. |
y | str | ❌ | Response Column. |
sizes | list | ✓ | Different sizes of the dataset used to train the model. Multiple models will be trained using the different sizes. |
metric | str / list | ✓ | Method used to plot the curve.
|
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 [14]:
from verticapy.learn.ensemble import RandomForestClassifier
model = RandomForestClassifier(name = "public.RF_titanic")
from verticapy.learn.model_selection import learning_curve
# Efficiency
learning_curve(model,
input_relation = "public.titanic",
X = ["age", "fare", "parch",],
y = "survived",
method = "efficiency",
cv = 3,
metric = "auc",)
Out[14]:
In [15]:
# Scalability
learning_curve(model,
input_relation = "public.titanic",
X = ["age", "fare", "parch",],
y = "survived",
method = "scalability",
cv = 3,
metric = "auc",)
Out[15]:
In [16]:
# Performance
learning_curve(model,
input_relation = "public.titanic",
X = ["age", "fare", "parch",],
y = "survived",
method = "performance",
cv = 3,
metric = "auc",)
Out[16]:
