I am trying to put RandomForestRegressor in my training set,
rfr.fit(train_X , train_y)
but keep getting the following warning:
/usr/local/lib/python2.7/dist-packages/IPython/kernel/ main .py: 1: DataConversionWarning: column vector y was passed while waiting for a 1d array.Change the form y to (n_samples), for example using ravel (). if name == ' main ':
I use Pandas, and therefore suggested that the training set might need to be in numpy arrays, so-called .values:
train_y = train[label].values
train_X = train[features].values
Type and form check:
print type(train_X), train_X.shape
print type(train_y), train_y.shape
Returns:
<type 'numpy.ndarray'> (20457, 44)
<type 'numpy.ndarray'> (20457, 1)
Not sure what to do next, just found this answer , but it did not help.
, , . .