3
$\begingroup$

Assume that a classier has been trained already (no missing training data), but a prediction has been requested based on an observation that does not include every feature. How can we handle this missing feature?

$\endgroup$

2 Answers 2

2
$\begingroup$

In evaluation (test) phase, when data point $x_n$ has $d$ missing features at indices $M=\{m_1,...,m_d\}$, corresponding terms $P(x_i|C_k),i \in M$ are simply removed from the classifier. That is, classifier $$C(x_n) = \underset{k \in \{1,..,K\}}{\mbox{argmax }}P(C_k)\prod_{i}P(x_i=x_{n,i}|C_k)$$ is replaced with $$C(x_n) = \underset{k \in \{1,..,K\}}{\mbox{argmax }}P(C_k)\prod_{\color{blue}{i:i \notin M}}P(x_i=x_{n,i}|C_k)$$

where $i$ iterates over features, $x_{n,i}$ denotes the $i$-th feature of data point $n$, and there is $K$ classes in total.

$\endgroup$
1
$\begingroup$

You tend to avoid these situations while preprocessing your data. You impute the missing data. In production terms, frameworks like H2O handle quite elegantly. If you mean that there's a dimension mismatch, then H2O can still handle it.

H2O Missing values

$\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.