Recursive Feature Elimination
Hi,
I am working on a machine learning project. I am trying to rank the features using RFE and I kept getting the following error:
y = df['Churn_num']
model = LogisticRegression() rfe = RFE(logistic_regression, 11)
rfe = rfe.fit(X, y)
print('Selected features: %s' % list(X.columns[rfe.support_])) What am I doing wrong and how can I fix it? Thank you, Indy
ValueError: could not convert string to float: ''X = df.drop(['Churn_num'],axis=1)
Here is my code:
y = df['Churn_num']
model = LogisticRegression() rfe = RFE(logistic_regression, 11)
rfe = rfe.fit(X, y)
print('Selected features: %s' % list(X.columns[rfe.support_])) What am I doing wrong and how can I fix it? Thank you, Indy
1 answers ( 0 marked as helpful)
Hi Inderjeet,
thank you so much for reaching out! Could you please share which lecture or course your question is related to? Thank you so much in advance!
Best,
The 365 Team