Skip to content

Commit 5c5fbf5

Browse files
committed
COSMIT pep8 cleanups
1 parent a6723ed commit 5c5fbf5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

sklearn/cross_validation.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,10 @@ def __init__(self, y, n_folds=3, indices=None, shuffle=False,
410410
min_labels = np.min(label_counts)
411411
if self.n_folds > min_labels:
412412
warnings.warn(("The least populated class in y has only %d"
413-
" members, which is too few. The minimum"
414-
" number of labels for any class cannot"
415-
" be less than n_folds=%d."
416-
% (min_labels, self.n_folds)), Warning)
413+
" members, which is too few. The minimum"
414+
" number of labels for any class cannot"
415+
" be less than n_folds=%d."
416+
% (min_labels, self.n_folds)), Warning)
417417

418418
# don't want to use the same seed in each label's shuffle
419419
if self.shuffle:
@@ -1250,7 +1250,7 @@ def _fit_and_predict(estimator, X, y, train, test, verbose, fit_params):
12501250
# Adjust length of sample weights
12511251
fit_params = fit_params if fit_params is not None else {}
12521252
fit_params = dict([(k, _index_param_value(X, v, train))
1253-
for k, v in fit_params.items()])
1253+
for k, v in fit_params.items()])
12541254

12551255
X_train, y_train = _safe_split(estimator, X, y, train)
12561256
X_test, _ = _safe_split(estimator, X, y, test, train)
@@ -1441,7 +1441,7 @@ def _fit_and_score(estimator, X, y, scorer, train, test, verbose,
14411441
# Adjust length of sample weights
14421442
fit_params = fit_params if fit_params is not None else {}
14431443
fit_params = dict([(k, _index_param_value(X, v, train))
1444-
for k, v in fit_params.items()])
1444+
for k, v in fit_params.items()])
14451445

14461446
if parameters is not None:
14471447
estimator.set_params(**parameters)
@@ -1798,7 +1798,8 @@ def train_test_split(*arrays, **options):
17981798
"assumed True in 0.18 and removed.", DeprecationWarning)
17991799
if allow_lists is False or allow_nd is False:
18001800
arrays = [check_array(x, 'csr', allow_nd=allow_nd,
1801-
force_all_finite=False, ensure_2d=False) if x is not None else x
1801+
force_all_finite=False, ensure_2d=False)
1802+
if x is not None else x
18021803
for x in arrays]
18031804

18041805
if test_size is None and train_size is None:

0 commit comments

Comments
 (0)