Why am i only seeing one set of intercepts, coefs for lda? shouldn't there be two for a two class outcome?
My code:
train_X = stock_data.loc[stock_data.Year == 2020,['mean_return','volatility']]
test_X = stock_data.loc[stock_data.Year == 2021,['mean_return','volatility']]
train_y = np.ravel(stock_data.loc[stock_data.Year == 2020,['Label']].values)
test_y = np.ravel(stock_data.loc[stock_data.Year == 2021,['Label']].values)
qda = QuadraticDiscriminantAnalysis(store_covariance=True)
lda = LinearDiscriminantAnalysis(store_covariance=True)
lda.fit(train_X,train_y)
(lda.intercept_, lda.coef_)
Gives
(array([0.43428967]), array([[-0.6935597 , -0.02651876]])).
I would have expected pairs of outputs with element corresponding to each class based on the sklearn documentation.
Am I misreading the docs, and these coefficients are in fact for a log of odds?
For qda, why is coef_ not an attribute, and should I construct the decision function equation based on the stored covariances and means for each class?
Also, how do I determine which label corresponds to the first or second covariance matrix?