Should a pandas dataframe column be converted in some way before passing it to a scikit learn regressor?

Viewed 10011

I have a pandas dataframe and passing df[list_of_columns] as X and df[[single_column]] as Y to a Random Forest regressor.

What does the following warnning mean and what should be done to resolve it?

DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().   probas = cfr.fit(trainset_X, trainset_Y).predict(testset_X)
4 Answers
Related