'SVD solver.
Parameters
X : array-like, shape (n_samples, n_features)
Training data.
y : array-like, shape (n_samples,) or (n_samples, n_targets)
Target values.'

def _solve_svd(self, X, y):

    (n_samples, n_features) = X.shape
    n_classes = len(self.classes_)
    self.means_ = _class_means(X, y)
    if self.store_covariance:
        self.covariance_ = _class_cov(X, y, self.priors_)
    Xc = []
    for (idx, group) in enumerate(self.classes_):
        Xg = X[(y == group), :]
        Xc.append((Xg - self.means_[idx]))
    self.xbar_ = np.dot(self.priors_, self.means_)
    Xc = np.concatenate(Xc, axis=0)
    std = Xc.std(axis=0)
    std[(std == 0)] = 1.0
    fac = (1.0 / (n_samples - n_classes))
    X = (np.sqrt(fac) * (Xc / std))
    (U, S, V) = linalg.svd(X, full_matrices=False)
    rank = np.sum((S > self.tol))
    if (rank < n_features):
        warnings.warn('Variables    are    collinear.')
    scalings = ((V[:rank] / std).T / S[:rank])
    X = np.dot((np.sqrt(((n_samples * self.priors_) * fac)) * (self.means_ - self.xbar_).T).T, scalings)
    (_, S, V) = linalg.svd(X, full_matrices=0)
    self.explained_variance_ratio_ = ((S ** 2) / np.sum((S ** 2)))[:self._max_components]
    rank = np.sum((S > (self.tol * S[0])))
    self.scalings_ = np.dot(scalings, V.T[:, :rank])
    coef = np.dot((self.means_ - self.xbar_), self.scalings_)
    self.intercept_ = (((-0.5) * np.sum((coef ** 2), axis=1)) + np.log(self.priors_))
    self.coef_ = np.dot(coef, self.scalings_.T)
    self.intercept_ -= np.dot(self.xbar_, self.coef_.T)
