I'm implementing a multinomial logistic regression model in Python using Scikit-learn. Here's my code:
X = pd.concat([each for each in feature_cols], axis=1)
y = train[["<5", "5-6", "6-7", "7-8", "8-9", "9-10"]]
lm = LogisticRegression(multi_class='multinomial', solver='lbfgs')
lm.fit(X, y)
However, I'm getting ValueError: bad input shape (50184, 6)
when it tries to execute the last line of code.
X
is a DataFrame
with 50184 rows, 7 columns. y
also has 50184 rows, but 6 columns.
I ultimately want to predict in what bin (<5, 5-6, etc.) the outcome falls. All the independent and dependent variables used in this case are dummy columns which have a binary value of either 0 or 1. What am I missing?