title: scikit-learn: add clf.prediction() to different dataframe
body: <p>I've trained my RandomForestClassifier() and am now looking to add my predictions to my newly imported test DF which I'm calling df_test. </p>
  
  <p>I have added my feature columns to the df_test dataframe, for the clf.predict method to use. </p>
  
  <p>I cannot figure out how to use my clf.predict() method in a way to add a new column to df_test. </p>
  
  <p>On My Training Data:</p>
  
  <pre><code>clf = RandomForestClassifier()
  clf.fit(df3[features], df['rounded_score'])
  pd.crosstab(clf.predict(df3[features]), df3['rounded_score'])
  </code></pre>
  
  <p>Get My Test Data Ready:</p>
  
  <pre><code>df_test = pd.read_csv("test.csv")
  df_test['match_ratio'] = df.apply(lambda x: fuzz.ratio(x['search_term'], x['product_title']), axis=1)
  df_test['partial_match_ratio'] = df.apply(lambda x: fuzz.partial_ratio(x['search_term'], x['product_title']), axis=1)
  df_test['tsort_match_ratio'] = df.apply(lambda x: fuzz.token_sort_ratio(x['search_term'], x['product_title']), axis=1)
  </code></pre>
  
  <p>I have tried about a dozen iterations of code like the below:</p>
  
  <pre><code>df_test['prediction'] = df_test[something].apply(lambda x: clf.predict(x))
  </code></pre>
  
  <p>But the predict method keeps telling me it's looking for a numpy array. So, I tried the following, which works:</p>
  
  <pre><code>mat = df_test[['match_ratio', 'partial_match_ratio', 'tsort_match_ratio']].as_matrix()
  for x in mat[:10]:
      print clf.predict(x)
  </code></pre>
  
  <p>But I can't figure out how to get this data into my df_test dataframe as a new column. My last consideration is appending the prediction to a regular python list, then somehow munging that into the dataframe...but that seems kinda messy. </p>