I'm trying to understand how the RidgeClassifier
from sklearn.linear_model
works for Multi class case. I found a similar question here. However I am unable to follow
According to what I understand from the answer there.
import numpy as np
X = np.random.random((5,4))
y = [0,1,0,2,2]
############## This method #################
from sklearn.preprocessing import LabelBinarizer
y_new = LabelBinarizer().fit_transform(y)
from sklearn.linear_model import Ridge
r = Ridge()
r.fit(X,y_new)
r.coef_
############# is same as this ##############
from sklearn.linear_model import RidgeClassifier
clf = RidgeClassifier()
clf.fit(X,y)
clf.coef_
However the coef_
is not same. What actually happens for the Multi class case?