title: sklearn Logistic Regression ValueError: X has 42 features per sample; expecting 1423
body: <p>I'm stuck trying to fix an issue.
  Here is what I'm trying to do :</p>
  
  <p>I'd like to predict missing values (Nan) (categorical one) using logistic regression.
  Here is my code :</p>
  
  <p>df_1 : my dataset with missing values only in the "Metier" feature (missing values I'm trying to predict)</p>
  
  <pre><code>X_train = pd.get_dummies(df_1[df_1['Metier'].notnull()].drop(columns='Metier'),drop_first = True)
  X_test = pd.get_dummies(df_1[df_1['Metier'].isnull()].drop(columns='Metier'),drop_first = True,dummy_na = True)
  
  Y_train = df_1[df_1['Metier'].notnull()]['Metier']
  Y_test = df_1[df_1['Metier'].isnull()]['Metier']
  
  from sklearn.linear_model import LogisticRegression
  classifier = LogisticRegression(random_state = 0)
  
  classifier.fit(X_train, Y_train)
  
  classifier.score(X_train,Y_train) = 0.705112088833019
  </code></pre>
  
  <p>BUT when I'm trying to get the prediction on <code>Y_test</code> It says : </p>
  
  <blockquote>
    <p>ValueError: X has 42 features per sample; expecting 1423</p>
  </blockquote>
  
  <p>I would highly appreciate If someone could give me a hand.</p>
  
  <p>Thanks a lot :)</p>