aspremon / NaiveFeatureSelection

Code for NaiveFeatureSelection, i.e. feature selection in Naive Bayes, see https://arxiv.org/abs/1905.09884
MIT License
9 stars 7 forks source link

several clarifications for paper and code #4

Open Sandy4321 opened 4 years ago

Sandy4321 commented 4 years ago

great code and paper thanks I try to read your paper https://arxiv.org/pdf/1905.09884.pdf Can you please help with these 1 code for performance comparison with Zheng et al. (2018) for binary only data 2 figure 2 : what is used for second step for SMNB can you share code to reproduce experiment N2? 3 can you share code for demo for binary NB (SBNB) please 4 how was found Laplace smoothing parameter for SBNB and SMNB 5 some user manual would be great to have for example to understand nfs.mask_ array([False, False, False, ..., False, False, False]) etc

Thanks again

arminaskari commented 4 years ago

Thank you for your kind words.

  1. We ended up not comparing against Zheng et al in our experiments (since the data we dealt with is not binary data). If I were to go about implementing Zheng et al's algorithm, I would recommend using cvxpy or scipy.optimize since they are solving a simple convex optimization problem that can be encoded in either framework relatively quickly.

  2. Specifically in Figure 2, the second step we use a Multinomial Naive Bayes classifier. However in Appendix D you will also see we ran the same experiments with SVM and logistic regression in the second step. I will try to very soon to upload the code for experiment 2.

  3. We did not code binary NB yet. However, this is easy enough and I will add this in the repo and will try to do it as soon as possible.

  4. The way it was selected in the paper was that we selected the best laplace smoothing parameter for multinomial naive bayes (using cross validation) and then we just used the same laplace smoothing parameter for SMNB. We did this at the time to give the MNB model the benefit of the doubt, but you can imagine since k and alpha are both considered hyperparameters that you can cross validate both of them. However, depending on application, k may not need to be hyperparamter tuned as it is your desired sparsity level so if you require a certain number of features you can simply set k to the desired value.

  5. Will try to do this along with the other changes as soon as possible.

Sandy4321 commented 4 years ago

suuuuuper! thanks a lot for willing to help to learn your code it is really great paper - it is very difficult to develop new ideas for so well researched area where thousands of people working for hundreds year and you did it!!! now it is important to make it accessible to others to use it...