For my classification task i have 3 features a,b,c. Feature c is missing for some datas. I can have already a good score for my classifier training with the two other features a,b and even better if I don't look at the missing data and I train with a,b,c.

Is it possible to train my classifier with features a,b,c on all the data which don't have missing values, and in my prediction phase, if the feature c is missing, to predict the class like if I had train my classifier with a and b?

  • 1
    $\begingroup$ A tedious way could be to train two different classifiers. One using a, b, and c as features by removing the instances that don't have values for c, and the other classifier using a and b only on the entire data. Then during the prediction phase, depending on whether the data has feature c missing or not, choose the appropriate classifier. $\endgroup$ – tomar__ Oct 25 '17 at 9:40
  • $\begingroup$ Please clarify the question: are you suggesting training two distinct classifiers (as addressed in the comment by @tomar__) or are you asking if your classification algorithm would be robust enough to generalize well to cases (not seen in training) where c is missing (assuming you can represent that). In the latter case, please provide information about your classification algorithm. $\endgroup$ – mjul Oct 25 '17 at 9:54
  • $\begingroup$ I would like to do why @tomar__ said, but is it possible to do it with just one classifier: Train on a,b,c and if in my test phase, c is missing, I rely just on feature a,b like If I had an other classifier train on a,b. $\endgroup$ – thovex Oct 25 '17 at 10:02

Try a few options and pick the best.

  1. Fill in the mean/median from known $c$'s in the $a,b,c$ model
  2. Create a linear regression model to predict $c$ from $a,b$, fill the estimate $c$ from this model in the $a,b,c$ model
  3. Train both models and use the applicable one

Personally, I think 2. will work best in most cases, but 1. can already be sufficient when $c$ is not correlated to $a$ or $b$.

  • $\begingroup$ I would say 3. is the way to go if there is no correlation as the c median can induce an error. It's better to have no data than bad data. $\endgroup$ – Wli Oct 25 '17 at 13:41
  • $\begingroup$ The point of invalid data = bad data must indeed be considered, and only trying will show if there is a positive effect, a negative effect, or no effect at all. $\endgroup$ – Pieter21 Oct 25 '17 at 15:22

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.