How do I get column names of a model created in PyCaret

26 Views Asked by At

I am trying to create a PyCaret Model

# load dataset
from pycaret.datasets import get_data
insurance = get_data('insurance')

# init environment
from pycaret.regression import *

r1 = setup(insurance, target = 'charges', session_id = 123,
           normalize = True,
           polynomial_features = True,
           bin_numeric_features= ['age', 'bmi'])

I see 55 columns are now created. How do I get column names of PyCaret Model

1

There are 1 best solutions below

0
Ajay Ohri On

train a model

lr = create_model('lr')

#get model column names

lr.feature_names_in_