randomized_search_cv¶
In [ ]:
randomized_search_cv(estimator,
input_relation: (str, vDataFrame),
X: list,
y: str,
metric: str = "auto",
cv: int = 3,
pos_label: (int, float, str) = None,
cutoff: float = -1,
nbins: int = 1000,
lmax: int = 4,
optimized_grid: int = 1,
print_info: bool = True,)
Computes the K-Fold randomized search of an estimator.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
estimator | object | ❌ | Vertica estimator having a fit. |
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.
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). |
nbins | int | ✓ | Number of bins used to compute the different parameters categories. |
lmax | int | ✓ | Maximum length of each parameter list. |
optimized_grid | int | ✓ | If set to 0, the randomness is based on the input parameters. If set to 1, the randomness is limited to some parameters, the other ones are picked based on a default grid. If set to 2, there is no randomness and a default grid is returned. |
print_info | bool | ✓ | If set to True, prints the model information at each step. |
Returns¶
tablesample : An object containing the result. For more information, see utilities.tablesample.
Example¶
In [5]:
from verticapy.learn.linear_model import LogisticRegression
model = LogisticRegression(name = "public.LR_titanic",
tol = 1e-4,
max_iter = 100,
solver = 'Newton')
from verticapy.learn.model_selection import randomized_search_cv
randomized_search_cv(model,
input_relation = "public.titanic_clean",
X = ["age", "fare", "parch", "sex", "boat"],
y = "survived",
cv = 3,
metric = "auc",
lmax = 5)
Out[5]:
