4
$\begingroup$

I have a binary outcome and my features are mostly continuous. However most of the features have missing data and are coded as missing. Missings are coded as 9999, 999999 etc.

How do i scale my features if i have something like this ? When the model gets implemented and in real time we will have missing values. So i am advised to keep the missing's and build the model.

$\endgroup$
4
  • $\begingroup$ Even standard scaling may not work ? somethig like scaledfeature = (feature - Mean)/stddev of feature ? $\endgroup$
    – user16789
    Commented May 31, 2013 at 15:31
  • 1
    $\begingroup$ can you not have something like "if value==missing then value = mean(feature)" ? $\endgroup$
    – user10961
    Commented May 31, 2013 at 15:40
  • 1
    $\begingroup$ That should work. Unless i get into data imputation techniques. $\endgroup$
    – user16789
    Commented May 31, 2013 at 16:00
  • $\begingroup$ yeah, that's what i'm getting at, taking the mean value is just a very simple approach $\endgroup$
    – user10961
    Commented May 31, 2013 at 16:14

2 Answers 2

3
$\begingroup$

Recently there was a very similar question. I would refer you to my answer: substituting by the mean value can hurt. There are principled ways, but I am not aware of any freely available implementations.

$\endgroup$
0
1
$\begingroup$

Substituting the mean is probably the best you can do if you don't want to change the size of your input, but it will run into problems when the model learns and relies on correlated inputs.

Another method would be to add a corresponding Boolean "sentinel input" to each input that indicates whether the input is missing or not. The model can theoretically learn to do the right thing when the input is missing provided you have sufficient data (with the input missing) to learn the additional parameters.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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