How to decide threshold value in SelectFromModel() for selecting features?

前端 未结 1 483
忘了有多久
忘了有多久 2021-01-12 11:45

I am using random forest classifier for feature selection. I have 70 features in all and I want to select the most important features out of 70. Below code shows the classif

相关标签:
1条回答
  • 2021-01-12 11:58

    I would try the following approach:

    1. start with a low threshold, for example: 1e-4
    2. reduce your features using SelectFromModel fit & transform
    3. compute metrics (accuracy, etc.) for your estimator (RandomForestClassifier in your case) for selected features
    4. increase threshold and repeat all steps starting from point 1.

    Using this approach you can estimate what is the best threshold for your particular data and your estimator

    0 讨论(0)
提交回复
热议问题