79340829

Date: 2025-01-08 21:49:02
Score: 0.5
Natty:
Report link

In 2025, this is not possible with sklearn (I spent a while looking for a solution)

This is a valid task in multi-class logistic regression. You are asking to find a single set of coefficients that simultaneously explain all of the classes. Sklearn (and other packages) find a set of coefficients for each class, which is why it returns a 6x4 matrix - you have 6 features and 4 targets.

The PyLogit package can fit your model. There is an example of performing logistic regression on a dataset with 4 input features and 4 targets - see Specify and Estimate a Multinomial Logit (MNL) Model.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: beenjaminnn