1

I am trying to predict data on XGBRegressor but when i fit the model it give me value error of invalid shape.

from xgboost import XGBRegressor

my_model = XGBRegressor() my_model.fit(X_train,y_train)

ValueError: Invalid shape: (4074, 5) for label

Sajjad Ali
  • 33
  • 6

1 Answers1

1

If you want to have multiple outputs then use MultiOutputRegressor, as described here, otherwise y_train must have only 1 dimension.

Bence
  • 46
  • 4