<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello,<br></div>I am studying this example from <span class="gmail-il">scikit</span>-<span class="gmail-il">learn</span>'s site:<br><a href="http://scikit-learn.org/stable/tutorial/text_analytics/working_with_text_data.html" target="_blank">http://<span class="gmail-il">scikit</span>-<span class="gmail-il">learn</span>.org/<wbr>stable/tutorial/text_<wbr>analytics/working_with_text_<wbr>data.html</a><br><br></div>The problem that I need to solve is very similar to this example, except I have one<br></div>additional feature column (part #) that is categorical of type string.  My label or target<br>values consist of just 2 values: 0 or 1.<br></div><div><br></div>With that additional feature column, I am transforming it with a LabelEncoder and <br></div>then I am encoding it with the OneHotEncoder.<br><br></div>Then I am concatenating that one-hot encoded column (part #) to the text/document <br>feature column (complaint), which I had applied the CountVectorizer and TfidfTransformer transformations.<br></div><div><br></div>Then I chose the MultinomialNB model to fit my concatenated training data with.<br><br></div>The problem I run into is when I invoke the prediction, I get a dimension mis-match error.<br><br>Here's my jupyter notebook gist:<br><a href="http://nbviewer.jupyter.org/gist/anonymous/59ba930a783571c85ef86ba41424b311" target="_blank">http://nbviewer.jupyter.org/<wbr>gist/anonymous/<wbr>59ba930a783571c85ef86ba41424b3<wbr>11</a><br><br></div>I would gladly appreciate it if someone can guide me where I went wrong.  Thanks!<br><br></div>- Daniel</div>