'Project data to maximize class separation.
Parameters
X : array-like, shape (n_samples, n_features)
Input data.
Returns
X_new : array, shape (n_samples, n_components)
Transformed data.'

def transform(self, X):

    if (self.solver == 'lsqr'):
        raise NotImplementedError("transform    not    implemented    for    'lsqr'    solver    (use    'svd'    or    'eigen').")
    check_is_fitted(self, ['xbar_', 'scalings_'], all_or_any=any)
    X = check_array(X)
    if (self.solver == 'svd'):
        X_new = np.dot((X - self.xbar_), self.scalings_)
    elif (self.solver == 'eigen'):
        X_new = np.dot(X, self.scalings_)
    return X_new[:, :self._max_components]
