title: scikit-learn RandomForestClassifier, stopped working, advice on how to debug
body: <p>I am doing a grid search on a RandomForestClassifier and my code has been working until I changed the features and suddenly the code generates the following error (at line classifier.fit)</p>
  
  <p>I did not change any code, but reduced the feature dimensions from 16 to 8. I am totally confused as to what I should look into. What does this error mean?</p>
  
  <p>Error:</p>
  
  <pre><code>multiprocessing.pool.RemoteTraceback: 
  """
  Traceback (most recent call last):
    File "/home/zqz/Programs/anaconda3/lib/python3.5/site-packages/sklearn/externals/joblib/_parallel_backends.py", line 344, in __call__
  return self.func(*args, **kwargs)
  File "/home/zqz/Programs/anaconda3/lib/python3.5/site-packages/sklearn/externals/joblib/parallel.py", line 131, in __call__
  return [func(*args, **kwargs) for func, args, kwargs in self.items]
  File "/home/zqz/Programs/anaconda3/lib/python3.5/site-packages/sklearn/externals/joblib/parallel.py", line 131, in &lt;listcomp&gt;
  return [func(*args, **kwargs) for func, args, kwargs in self.items]
  File "/home/zqz/Programs/anaconda3/lib/python3.5/site-packages/sklearn/ensemble/forest.py", line 120, in _parallel_build_trees
  tree.fit(X, y, sample_weight=curr_sample_weight, check_input=False)
  File "/home/zqz/Programs/anaconda3/lib/python3.5/site-packages/sklearn/tree/tree.py", line 739, in fit
  X_idx_sorted=X_idx_sorted)
  File "/home/zqz/Programs/anaconda3/lib/python3.5/site-packages/sklearn/tree/tree.py", line 246, in fit
  raise ValueError("max_features must be in (0, n_features]")
  ValueError: max_features must be in (0, n_features]
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>    classifier = RandomForestClassifier(n_estimators=20, n_jobs=-1)
      rfc_tuning_params = {"max_depth": [3, 5, None],
                           "max_features": [1, 3, 5, 7, 10],
                           "min_samples_split": [2, 5, 10],
                           "min_samples_leaf": [1, 3, 10],
                           "bootstrap": [True, False],
                           "criterion": ["gini", "entropy"]}
      classifier = GridSearchCV(classifier, param_grid=rfc_tuning_params, cv=nfold,
                                n_jobs=cpus)
      model_file = os.path.join(os.path.dirname(__file__), "random-forest_classifier-%s.m" % task)
      classifier.fit(X_train, y_train) #line that causes the error
      nfold_predictions=cross_val_predict(classifier.best_estimator_, X_train, y_train, cv=nfold)
  </code></pre>