title: Python: An index error that inhibits a Random forest model from working
body: <p>I have some kind of an indexing flaw in my Random forest model. I did not encounter this with Gaussian process regressor. The data is the same in both cases.</p>
  <p>Data</p>
  <pre><code>#Decision matrix X
  sampler = qmc.LatinHypercube(d=4)
  
  u_bounds = np.array([5.0, 5.0, 10.0, 10.0])
  l_bounds = np.array([0.125, 0.125, 0.1, 0.1])
  data = sampler.lhs_method(100)*(u_bounds-(l_bounds)) + (l_bounds)
  
  #Output value matrix y
  y=np.zeros((100,2)) 
  for i in range(np.shape(data)[0]):
      y[i,0], y[i,1] = objectives(data[i,0], data[i,1], data[i,2], data[i,3]) 
  </code></pre>
  <p>Training the model and implementing it. This works.</p>
  <pre><code>from sklearn.model_selection import train_test_split 
  X_train, X_test, y_train, y_test = train_test_split(X,y, 
  test_size=0.2, random_state = 42)
  
  kernel = DotProduct() + WhiteKernel()
  gpr = GaussianProcessRegressor(kernel=kernel,
           random_state=0).fit(X_train, y_train)
  gpr.score(X_test, y_test)
  
  gpr.fit(data, y[:,0])
  gpr.score(data, y[:,0])
  f1_score = gpr.score(data, y[:,0])
  print(f1_score)
  </code></pre>
  <p>The same with Random forest</p>
  <pre><code>X, y = make_regression(n_features=4, n_informative=2,
                          random_state=0, shuffle=False)
  RF = RandomForestRegressor(max_depth=2, random_state=0)
  RF.fit(X, y)
  RF.score(X, y)
  </code></pre>
  <p>But why this does not work?</p>
  <pre><code>RF.fit(data, y[:,0])
  RF.score(data, y[:,0])
  </code></pre>
  <p>Error message: <code>IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed</code></p>
  <p>Should I try to fix it with something like this: <code>np.atleast_2d(y[i,0])</code>? This gives the same error.</p>