I have a highly sparse dataset that I am using to predict a continuous variable via a random forest regression. I have achieved an acceptable level of performance following cross-validation, and I am now thinking of potential ways I might further improve accuracy.

Given that my dataset is highly sparse, I was thinking that recursive feature elimination (using the cross validated version in sklearn) might be a good way to go. My understanding is that this will give me the 'optimal' number of features and thus may reduce issues related to over-fitting.

My question is, is it then appropriate to re-run the analysis with these optimized features, or am I in someway biasing the model? I have a test set that has not been used at all in training/validation, so I am assuming that as long as I don't leak info between training and testing, I should be good. But I'm unclear if these assumptions are correct.

Is this a suitable use of RFE, or should i be considering a different path?

For info, my training/validation dataset is 370 rows, with approx. 900 features.


370 rows, with approx. 900 features is not optimal. I would suggest some dimension reduction. PCA, factor analysis, PLS regression are some alternatives.

You could try a lasso- / elasticnet -regression as well.

Here is a good guide. https://scikit-learn.org/stable/tutorial/machine_learning_map/index.html


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.