def fit(self, X, y):
n_samples, n_features = X.shape<EOL>self.alpha = np.zeros(n_samples, dtype=np.float64)<EOL>K = self.kernel.compute(X, X)<EOL>for t in range(self.n_iter):<EOL><INDENT>for i in range(n_samples):<EOL><INDENT>pred = np.dot(K[:, i], self.alpha)<EOL>update = self.loss.get_update(pred, y[i])<EOL>if update != <NUM_LIT:0>:<EOL><INDENT>self.alpha[i] += update * self.eta<EOL><DEDENT>self.alpha *= (<NUM_LIT:1> - self.eta * self.lmbda)<EOL><DEDENT><DEDENT>sv = self.alpha != <NUM_LIT:0><EOL>self.alpha = self.alpha[sv]<EOL>self.sv = X[sv]<EOL>print("<STR_LIT>" % (len(self.alpha), n_samples))<EOL>
:param X:
:param y:
:return: