gregbellan / Stabl

BSD 3-Clause Clear License
49 stars 15 forks source link

Is there a way to specify the number of features to be selected? #19

Closed CallMeDek closed 3 days ago

CallMeDek commented 4 days ago

Hi,

Thank you for your work! I really enjoy applying it for my research.

I wonder if I am able to set the number of features to be extracted by command option.

Just like it would take at least 10, 20, 30 and so on.

Otherwise, could you tell me the section of codes related to the function?

Thank you

xavdurand commented 3 days ago

Hello @CallMeDek ,

The core feature of Stabl is precisely to select the right number of features using the synthetic features. If you want to do this because no features are selected, you can use the parameter explore=True that will select n_explore top features when no features are selected.

If you still want to select the top k features, you can set artificial_type=None (so no artificial features are added) and change the function _get_support_mask

https://github.com/gregbellan/Stabl/blob/1d07f85a13cfbecb4f08ce21075bf4fbb8e34678/stabl/stabl.py#L1315-L1332

CallMeDek commented 3 days ago

Thank you @xavdurand,

It helps me a lot. I had to deal with the problem the you mentioned. I will try the solution you told me.

Thanks.