def fit_transform(self, X, y=None):
n = X.shape[<NUM_LIT:0>]<EOL>if X.shape != (n, n):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>memory = get_memory(self.memory)<EOL>discard_X = not self.copy and self.negatives_likely<EOL>vals, vecs = memory.cache(scipy.linalg.eigh, ignore=['<STR_LIT>'])(<EOL>X, overwrite_a=discard_X)<EOL>vals = vals[:, None]<EOL>self.clip_ = np.dot(vecs, np.sign(vals) * vecs.T)<EOL>if discard_X or vals[<NUM_LIT:0>, <NUM_LIT:0>] < <NUM_LIT:0>:<EOL><INDENT>del X<EOL>np.abs(vals, out=vals)<EOL>X = np.dot(vecs, vals * vecs.T)<EOL>del vals, vecs<EOL>X = Symmetrize(copy=False).fit_transform(X)<EOL><DEDENT>return X<EOL>
Flips the negative eigenvalues of X.

Parameters
----------
X : array, shape [n, n]
    The *symmetric* input similarities. If X is asymmetric, it will be
    treated as if it were symmetric based on its lower-triangular part.

Returns
-------
Xt : array, shape [n, n]
    The transformed training similarities.