model = forest.fit(train_fold, train_y.values.ravel())
model = forest.fit(train_fold, train_y.values.ravel())
Explanation:
.values will give the values in a numpy array (shape: (n,1))
.ravel will convert that array shape to (n, ) (i.e. flatten it)