AutoML¶
In [ ]:
class AutoML(name: str,
estimator: (list, str) = "fast",
estimator_type: str = "auto",
metric: str = "auto",
cv: int = 3,
pos_label: (int, float, str) = None,
cutoff: float = -1,
nbins: int = 100,
lmax: int = 5,
optimized_grid: int = 2,
stepwise: bool = True,
stepwise_criterion: str = "aic",
stepwise_direction: str = "backward",
stepwise_max_steps: int = 100,
stepwise_x_order: str = "pearson",
preprocess_data: bool = True,
preprocess_dict: dict = {"identify_ts": False,},
print_info: bool = True,)
Tests multiple models to find the ones which maximize the input score.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
name | str | ❌ | Name of the model. |
estimator | list / 'native' / 'all' / object | ✓ | List of Vertica estimators with a fit method. Alternatively, you can specify 'native' for all native Vertica models, 'all' for all VerticaPy models and 'fast' for quick modeling. |
estimator_type | str | ✓ | Estimator Type.
|
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 while others are picked based on a default grid. If set to 2, no randomness is used and a default grid is returned. |
stepwise | bool | ✓ | If True, the stepwise algorithm will be used to determine the final model list of parameters. |
stepwise_criterion | str | ✓ | Criterion used when doing the final estimator stepwise.
|
stepwise_direction | str | ✓ | Which direction to start the stepwise search. Can be done 'backward' or 'forward'. |
stepwise_max_steps | int | ✓ | The maximum number of steps to be considered when doing the final estimator stepwise. |
x_order | str | ✓ | Method to preprocess X before using the stepwise algorithm.
|
preprocess_data | bool | ✓ | If True, the data will be preprocessed. |
preprocess_dict | dict | ✓ | Dictionary to pass to the AutoDataPrep class in order to preprocess the data before the clustering. |
print_info | bool | ✓ | If True, prints the model information at each step. |
Attributes¶
Name | Type | Description |
---|---|---|
preprocess_ | object | Model used to preprocess the data. |
best_model_ | object | Most efficient models found during the search. |
model_grid_ | tablesample | Grid containing the different models information. |
Main Methods¶
Name | Description |
---|---|
Trains the model. | |
Draws the AutoML Plot. |
AutoML also inherits the vModel methods.
Example¶
In [2]:
from verticapy.learn.delphi import AutoML
model = AutoML("titanic_autoML")
model.fit("public.titanic",
X = ["boat", "age", "fare", "pclass", "sex"],
y = "survived")
Out[2]:
In [3]:
model.plot("stepwise")
Out[3]:
In [4]:
model.plot()
Out[4]: