randomized_features_search_cv¶
In [ ]:
randomized_features_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,
training_score: bool = True,
comb_limit: int = 100,
skip_error: bool = True,
print_info: bool = True,)
Computes the k-fold grid search of an estimator using different combinations of features. It can be used to find parameters that optimize the model.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
estimator | object | ❌ | Vertica estimator having a fit method. |
input_relation | str / vDataFrame | ❌ | Relation to use to train the model. |
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). |
training_score | bool | ✓ | If set to True, the training score will be computed with the validation score. |
comb_limit | int | ✓ | Maximum number of features combinations used to train the model. |
skip_error | bool | ✓ | If set to True and an error occurs, it will be displayed and not raised. |
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 [61]:
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_features_search_cv
randomized_features_search_cv(model,
input_relation = "public.titanic",
X = ["age", "fare", "pclass"],
y = "survived",
cv = 3)
Out[61]: