'Least squares solver.
The least squares solver computes a straightforward solution of the
optimal decision rule based directly on the discriminant functions. It
can only be used for classification (with optional shrinkage), because
estimation of eigenvectors is not performed. Therefore, dimensionality
reduction with the transform is not supported.
Parameters
X : array-like, shape (n_samples, n_features)
Training data.
y : array-like, shape (n_samples,) or (n_samples, n_classes)
Target values.
shrinkage : string or float, optional
Shrinkage parameter, possible values:
- None: no shrinkage (default).
- \'auto\': automatic shrinkage using the Ledoit-Wolf lemma.
- float between 0 and 1: fixed shrinkage parameter.
Notes
This solver is based on [1]_, section 2.6.2, pp. 39-41.
References
.. [1] R. O. Duda, P. E. Hart, D. G. Stork. Pattern Classification
(Second Edition). John Wiley & Sons, Inc., New York, 2001. ISBN
0-471-05669-3.'

def _solve_lsqr(self, X, y, shrinkage):

    self.means_ = _class_means(X, y)
    self.covariance_ = _class_cov(X, y, self.priors_, shrinkage)
    self.coef_ = linalg.lstsq(self.covariance_, self.means_.T)[0].T
    self.intercept_ = (((-0.5) * np.diag(np.dot(self.means_, self.coef_.T))) + np.log(self.priors_))
