Handle unseen categorical string Spark CountVectorizer
<p>I have seen <code>StringIndexer</code> has problems with unseen labels (see <a href="https://stackoverflow.com/questions/34681534/spark-ml-stringindexer-handling-unseen-labels">here</a>). </p>

<p>My question are:</p>

<ol>
<li><p>Does <code>CountVectorizer</code> have the same limitation? How does it treat a string not in the vocabulary? </p></li>
<li><p>Moreover, is the vocabulary size affected by the input data or is it fixed according to the vocabulary size parameter?</p></li>
<li><p>Last, from ML point of view, assuming a simple classifier such as Logistic Regression, shouldn't an unseen category be encoded as a row of zeros so to be treated as "unknown" so to get some sort of default prediction?</p></li>
</ol>