2D array coefficients

Hi,

What is the interest of having a 2D array for the coefficients of linear and logistic regression ?
Every time we need the coefficients, we write linear/logistic_regression.coefs_[0]. It would have been simpler if the attributes coefs_ of a linear regression or a logistic regression was a 1D array.
Is the 2D array type needed when we have to predict a multidimensional Y ?

The coef_ attribute is of shape (1, n_features) for binary classification tasks and of shape (n_classes, n_features) for the multi-class case.

So yes, the reason for such a choice is to be easily generalizable.

Thank you, I understand.