0

I am trying to perform feature selection and to use RFECV from yellowbrick.model_selection. I have 48 features in my train set. But when I run the code in below, the visualizer finds number of features as 49.

xgboost_base_model = xgb.XGBClassifier(tree_method='hist')
visualizer_xgb = RFECV(xgboost_base_model, step=3, cv=3, scoring='roc_auc')
visualizer_xgb.fit(X_train, y_train)
visualizer_xgb.show()

enter image description here

Julia Meshcheryakova
  • 3,162
  • 3
  • 22
  • 42
ds_giz
  • 1
  • 1
    Welcome to SO! I paraphrased and shortened your question. Let me also ask you to output the x_train.head() - maybe there is some extra columns like int index in the input file? – Julia Meshcheryakova Dec 14 '22 at 20:41
  • I checked the shape of X_train and it is (20000,48). There is not any extra columns. – ds_giz Dec 14 '22 at 21:27
  • 1
    Could you try to create https://stackoverflow.com/help/minimal-reproducible-example with a tiny dataset that you can share (so the sensitive info replaced) – Julia Meshcheryakova Dec 14 '22 at 21:37

0 Answers0