From 0a01292dbf514b0cff4131d90ca67cb8ced96852 Mon Sep 17 00:00:00 2001 From: Gael Varoquaux Date: Sat, 27 Oct 2012 23:03:40 +0200 Subject: [PATCH] BUG: restore numpy 1.3 compatbibility --- sklearn/cluster/spectral.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sklearn/cluster/spectral.py b/sklearn/cluster/spectral.py index eda4696ccb9..f589cfe9b30 100644 --- a/sklearn/cluster/spectral.py +++ b/sklearn/cluster/spectral.py @@ -303,7 +303,7 @@ def discretize(vectors, copy=True, max_svd_restarts=30, n_iter_max=20, for j in range(1, n_components): # Accumulate c to ensure row is as orthogonal as possible to # previous picks as well as current one - c += np.abs(vectors.dot(rotation[:, j - 1])) + c += np.abs(np.dot(vectors, rotation[:, j - 1])) rotation[:, j] = vectors[c.argmin(), :].T last_objective_value = 0.0 @@ -312,7 +312,7 @@ def discretize(vectors, copy=True, max_svd_restarts=30, n_iter_max=20, while not has_converged: n_iter += 1 - t_discrete = vectors.dot(rotation) + t_discrete = np.dot(vectors, rotation) labels = t_discrete.argmax(axis=1) vectors_discrete = csc_matrix( @@ -335,7 +335,7 @@ def discretize(vectors, copy=True, max_svd_restarts=30, n_iter_max=20, else: # otherwise calculate rotation and continue last_objective_value = ncut_value - rotation = Vh.T.dot(U.T) + rotation = np.dot(Vh.T, U.T) if not has_converged: raise LinAlgError('SVD did not converge')