1

I am running some Linear Discriminant Analysis on some stock market data. I am following the lab in Chapter 4 of 'An Introduction to Statistical Learning'. My problem involves 2 predictors (x variables) and 2 classes to which they can be assigned.

I am using scikit learn to do this. However, when printing out my matrix of coefficients I am confused by its dimensions. By coefficients I am referring to the coefficients which are multiplied by the predictor values in the following equation:

enter image description here

Seeing as I have 2 predictors, and 2 possible classes in my problem, I would expect this matrix of coefficients to be 2 x 2. So 2 coefficients per class k - one for each predictor. However, according to the scikit learn documentation the array should have the following shape:

shape = [rank, n_classes - 1] (https://scikit-learn.org/0.15/modules/generated/sklearn.lda.LDA.html)

In my case the rank is equivalent to the number of predictors i have. Can anyone explain why the number of columns is 'n_classes - 1', and not simply n_classes?

Sean
  • 587
  • 4
  • 20

0 Answers0