When you initialize the setup function, you will be asked to confirm data types through a user input. More often when you run the scripts as a part of workflows or execute it as remote kernels (for e.g. Kaggle Notebooks), then in such case, it is required to provide the data types programmatically rather than through the user input box.
See example below using %u201Cinsurance%u201D dataset.
# import regression module from pycaret.regression import * # init setup reg1 = setup(data, target = 'charges', silent=True, categorical_features=['sex', 'smoker', 'region', 'children'], numeric_features=['age', 'bmi'])
The silent parameter is set to True to avoid input, categorical_features parameter takes the name of categorical columns as string, and numeric_features parameter takes the name of numeric columns as a string.
Comments