def fit(self, X, y, store_covariance=None, tol=None):
        if store_covariance:
            warnings.warn("The parameter 'store_covariance' is deprecated as "
                          "of version 0.17 and will be removed in 0.19. The "
                          "parameter is no longer necessary because the value "
                          "is set via the estimator initialisation or "
                          "set_params method.", DeprecationWarning)
            self.store_covariance = store_covariance
        if tol:
            warnings.warn("The parameter 'tol' is deprecated as of version "
                          "0.17 and will be removed in 0.19. The parameter is "
                          "no longer necessary because the value is set via "
                          "the estimator initialisation or set_params method.",
                          DeprecationWarning)
            self.tol = tol
        X, y = check_X_y(X, y, ensure_min_samples=2, estimator=self)
        self.classes_ = unique_labels(y)

        if self.priors is None:  # estimate priors from sample
            _, y_t = np.unique(y, return_inverse=True)  # non-negative ints
            self.priors_ = bincount(y_t) / float(len(y))
        else:
            self.priors_ = np.asarray(self.priors)

        if (self.priors_ < 0).any():
            raise ValueError("priors must be non-negative")
        if self.priors_.sum() != 1:
            warnings.warn("The priors do not sum to 1. Renormalizing",
                          UserWarning)
            self.priors_ = self.priors_ / self.priors_.sum()

        if self.solver == 'svd':
            if self.shrinkage is not None:
                raise NotImplementedError('shrinkage not supported')
            self._solve_svd(X, y)
        elif self.solver == 'lsqr':
            self._solve_lsqr(X, y, shrinkage=self.shrinkage)
        elif self.solver == 'eigen':
            self._solve_eigen(X, y, shrinkage=self.shrinkage)
        else:
            raise ValueError("unknown solver {} (valid solvers are 'svd', "
                             "'lsqr', and 'eigen').".format(self.solver))
        if self.classes_.size == 2:  # treat binary case as a special case
            self.coef_ = np.array(self.coef_[1, :] - self.coef_[0, :], ndmin=2)
            self.intercept_ = np.array(self.intercept_[1] - self.intercept_[0],
                                       ndmin=1)
        return self
Fit LinearDiscriminantAnalysis model according to the given
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/discriminant_analysis.py/LinearDiscriminantAnalysis.fit