AutoDataPrep simplifies the data preparation process by automating the different aspects of data cleaning and transformation, enabling seamless exploration, transformation, and optimization of datasets.
The function returns an instance of AutoDataPrep.
Optional Arguments
- task_type
- Specifies the task type for AutoDataPrep, whether to apply regression OR classification on the provided dataset. If you want AutoDataPrep() to decide the task type automatically, set task_type to "Default".
Permitted values: "Regression", "Classification", "Default"
Default value: "Default"
- verbose
- Specifies the detailed execution steps based on verbose level. Permitted values:
- 0: prints the progress bar.
- 1: prints the execution steps.
- 2: prints the intermediate data between the execution of each step.
Default value: 0
- skip phases
- Specifies the phases to be skipped during the AutoML run.Permitted values:
- "Feature_Exploration"
"Feature_Engineering"
"Data_Preparation"
Enable AutoML Pipeline to Start from Any Step and Allow Skipping Major/Minor Stages.Major Step Comments Feature Exploration Can be safely skipped. If skipped, statistical analysis for the provided dataset is not available. Feature Engineering If skipped, AutoML does not remove duplicates/redundant features, handle missing values, encode categorical features, or apply custom transforms. You must provide fully preprocessed numeric input during fit. Data Preparation If skipped, AutoML does not perform outlier handling, imbalance handling, scaling, or feature selection (RFE/LASSO/PCA). You must ensure training-ready features. - "Feature_Exploration"
- **kwargs
- Specifies the following additional arguments for AutoDataPrep:
- custom_config_file
- Specifies the path of JSON file in case of custom run.
- volatile
- Specifies whether to put the interim results of the functions in a volatile table or not. When set to True, results are stored in a volatile table, otherwise not.
Default value: False
- persist
- Specifies whether to persist the interim results of the functions in a table or not. When set to True, results are persisted in a table; otherwise, results are garbage collected at the end of the session.
Default value: False
- enable_lasso
- Specifies whether to use lasso regression for feature selection. By default, only RFE and PCA are used for feature selection.
Default value: False
Example Notes
- Get the connection to the database to execute the function.
- Import the required functions mentioned in the example from teradataml.
- Function raises error if not supported on the database you are connected to.
Example Setup
Load the example data.
>>> load_example_data("teradataml", "titanic")
Create teradataml DataFrames.
>>> titanic = DataFrame.from_table("titanic")
Example: Run AutoDataPrep for Classification Problem
Titanic dataset is used to predict the survival of passengers.
Create an instance of AutoDataPrep.
>>> aprep_obj = AutoDataPrep(task_type="Classification", verbose=2)
Fit the data.
>>> aprep_obj.fit(titanic, titanic.survived)
Retrieve the data after Auto Data Preparation.
>>> datas = aprep_obj.get_data()