title: Why can't I save my trained RandomForestRegressor model?
body: <p>I have a trained RandomForestRegressor model I would like to save to a file for re-use.  I'm following the instructions on the scikit-learn persistence page, and can save the trained model.  The problem is that I cannot seem to re-use it because scikit-learn does not recognize it as trained.</p>
  
  <pre><code>model = RandomForestRegressor(n_estimators=100, max_features='sqrt',    max_depth=12, n_jobs=24)
  model.fit(training_input,training_target_values)
  joblib.dump(model, './trained_model/tree.pkl')
  </code></pre>
  
  <p>But when I try to re-use the model:</p>
  
  <pre><code>model = joblib.load('./trained_model/tree.pkl') 
  prediction = np.array(model.predict(patient_arr))
  </code></pre>
  
  <p>I get the error:</p>
  
  <p>File "/usr/local/lib/python2.7/dist-packages/sklearn/ensemble/forest.py", line 614, in predict
      check_is_fitted(self, 'n_outputs_')
    File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 627, in check_is_fitted
      raise NotFittedError(msg % {'name': type(estimator).<strong>name</strong>})
  sklearn.utils.validation.NotFittedError: This RandomForestRegressor instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.</p>
  
  <p>I've also tried:</p>
  
  <pre><code>trained_model = model.fit(training_input,training_target_values)
  joblib.dump(trained_model, './trained_model/tree.pkl')
  </code></pre>
  
  <p>with the same results.</p>