Why does fit_transform with OneHotEncoding not maintain the transformation for my X variable?

I am using a pipeline to transform my X variable that has categorical features using OneHotEncoding; however, even after I fit_transfrom X, when I print X, I still see categorical values:

X = df.drop('Loan_Status', axis='columns') y = df['Loan_Status']  from sklearn.compose import make_column_transformer from sklearn.preprocessing import OneHotEncoder  column_trans = make_column_transformer(     (OneHotEncoder(), ['Loan_ID', 'Gender', 'Married', 'Education',                       'Self_Employed','Property_Area']),     remainder='passthrough')  column_trans.fit_transform(X) 

Am I missing a step to ensure my X variable maintains the encoded features?

Thanks for your time.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.