Handling unknown values for label encoding
<p>How can I handle unknown values for label encoding in sk-learn?
The label encoder will only blow up with an exception that new labels were detected.</p>

<p>What I want is the <strong>encoding of categorical variables</strong> via <strong>one-hot</strong>-encoder. However, sk-learn does not support strings for that. So I used a label encoder on each column. </p>

<p>My problem is that in my cross-validation step of the pipeline unknown labels show up.
The basic one-hot-encoder would have the option to ignore such cases.
An apriori <code>pandas.getDummies /cat.codes</code> is not sufficient as the pipeline should work with real-life, fresh incoming data which might contain unknown labels as well.</p>

<p>Would it be possible to use a <code>CountVectorizer</code> for this purpose?</p>