code: def fit(self, X, y=None):
          
          X = self._check_array(X)
  
          solver_kwargs = self._get_solver_kwargs()
  
          self._coef = algorithms._solvers[self.solver](X, y, **solver_kwargs)
          if self.fit_intercept:
              self.coef_ = self._coef[:-1]
              self.intercept_ = self._coef[-1]
          else:
              self.coef_ = self._coef
          return self
docs: Fit the model on the training data
  
          Parameters
          ----------
          X: array-like, shape (n_samples, n_features)
          y : array-like, shape (n_samples,)
  
          Returns
          -------
          self : objectj