Skip to content

Commit ea42c55

Browse files
committed
PEP8 in cross_validation module + tests
1 parent e62e9e1 commit ea42c55

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sklearn/cross_validation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,10 +1053,11 @@ def cross_val_predict(estimator, X, y=None, cv=None, n_jobs=1,
10531053
# Check for sparse predictions
10541054
if sp.issparse(preds[0]):
10551055
preds = sp.vstack(preds, format=preds[0].format)
1056-
else :
1056+
else:
10571057
preds = np.concatenate(preds)
10581058
return preds[inv_locs]
10591059

1060+
10601061
def _fit_and_predict(estimator, X, y, train, test, verbose, fit_params):
10611062
"""Fit estimator and predict values for a given dataset split.
10621063

sklearn/tests/test_cross_validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ def test_check_is_partition():
10971097
p[0] = 23
10981098
assert_false(cval._check_is_partition(p, 100))
10991099

1100+
11001101
def test_cross_val_predict_sparse_prediction():
11011102
# check that cross_val_predict gives same result for sparse and dense input
11021103
X, y = make_multilabel_classification(n_classes=2, n_labels=1,
@@ -1107,7 +1108,6 @@ def test_cross_val_predict_sparse_prediction():
11071108
y_sparse = csr_matrix(y)
11081109
classif = OneVsRestClassifier(SVC(kernel='linear'))
11091110
preds = cval.cross_val_predict(classif, X, y, cv=10)
1110-
preds_sparse = cval.cross_val_predict(classif, X_sparse,y_sparse, cv=10)
1111+
preds_sparse = cval.cross_val_predict(classif, X_sparse, y_sparse, cv=10)
11111112
preds_sparse = preds_sparse.toarray()
11121113
assert_array_almost_equal(preds_sparse, preds)
1113-

0 commit comments

Comments
 (0)