Skip to content

Commit

Permalink
fix issues with manifold tests throwing pep8 errors (scikit-learn#7209)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-carter authored and agramfort committed Aug 20, 2016
1 parent fa8fe85 commit 5c6409c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sklearn/manifold/tests/test_locally_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
eigen_solvers = ['dense', 'arpack']


#----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Test utility routines
def test_barycenter_kneighbors_graph():
X = np.array([[0, 1], [1.01, 1.], [2, 0]])
Expand All @@ -33,7 +33,7 @@ def test_barycenter_kneighbors_graph():
assert_less(linalg.norm(pred - X) / X.shape[0], 1)


#----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Test LLE by computing the reconstruction error on some manifolds.

def test_lle_simple_grid():
Expand Down
11 changes: 7 additions & 4 deletions sklearn/manifold/tests/test_t_sne.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,13 @@ def test_gradient():

P = _joint_probabilities(distances, desired_perplexity=25.0,
verbose=0)
fun = lambda params: _kl_divergence(params, P, alpha, n_samples,
n_components)[0]
grad = lambda params: _kl_divergence(params, P, alpha, n_samples,
n_components)[1]

def fun(params):
return _kl_divergence(params, P, alpha, n_samples, n_components)[0]

def grad(params):
return _kl_divergence(params, P, alpha, n_samples, n_components)[1]

assert_almost_equal(check_grad(fun, grad, X_embedded.ravel()), 0.0,
decimal=5)

Expand Down

0 comments on commit 5c6409c

Please sign in to comment.