I have trouble using RandomForest fit function
This is my training set
P1 Tp1 IrrPOA Gz Drz2
0 0.0 7.7 0.0 -1.4 -0.3
1 0.0 7.7 0.0 -1.4 -0.3
2 ... ... ... ... ...
3 49.4 7.5 0.0 -1.4 -0.3
4 47.4 7.5 0.0 -1.4 -0.3
... (10k rows)
I want to predict P1 thanks to all the other variables using sklearn.ensemble RandomForest
colsRes = ['P1']
X_train = train.drop(colsRes, axis = 1)
Y_train = pd.DataFrame(train[colsRes])
rf = RandomForestClassifier(n_estimators=100)
rf.fit(X_train, Y_train)
Here is the error I get:
ValueError: Unknown label type: array([[ 0. ],
[ 0. ],
[ 0. ],
...,
[ 49.4],
[ 47.4],
I did not find anything about this label error, I use Python 3.5. Any advice would be a great help !