I have a data frame which has lots of variables and I want to use elastic net in order to reduce the dimensionality, but each variable has also NAs present in it (missing values).

What I've done is to calculate decile-bins in each variable (10 or less bins in each variable - depends on the value range) and then transform each variable into a categorical variable where each observation will be replaced with the bin range it belongs to. My question is - I am still left with NAs, only now it is a category.

R's glmnet cannot work with NAs being present in the data frame so I was thinking to replace those NAs by some arbitrary value (e.g., 99). Can I do that? Will it affect the dimension reduction process carried out by Elastic Net?

  • $\begingroup$ How does linear regression reduce dimensionality? $\endgroup$ – Jakub Bartczuk Jan 14 '18 at 10:46
  • $\begingroup$ Well, this is the lasso part in elastic net $\endgroup$ – Corel Jan 14 '18 at 11:04
  • $\begingroup$ That's feature selection for a concrete model, not dimensionality reduction. $\endgroup$ – Jakub Bartczuk Jan 14 '18 at 18:39
  • 1
    $\begingroup$ There are several references to methods of regularization in order to perform feature selection which is basically a dimension reduction. I can input the variables I'm left with in a completely different model afterwards. $\endgroup$ – Corel Jan 14 '18 at 18:46

Your Answer

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

Browse other questions tagged or ask your own question.