Error with Sklearn Random Forest Regressor
The shape of X
should be [n_samples, n_features]
, you can transform X
by
X = X[:, None]
It is treating your list of samples X as 1 sample as a vector so the following works
rgr = regressor.fit(map(lambda x: [x],X),y)
There might be a more efficient way of doing this in numpy with vstack.