Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions sklearn/neighbors/nca.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from ..utils.random import check_random_state
from ..utils.validation import (check_is_fitted, check_array, check_X_y,
check_scalar)
from ..externals.six import integer_types
from ..exceptions import ConvergenceWarning


Expand Down Expand Up @@ -300,8 +299,7 @@ def _validate_params(self, X, y):

# Check the preferred dimensionality of the projected space
if self.n_components is not None:
check_scalar(self.n_components, 'n_components',
integer_types, 1)
check_scalar(self.n_components, 'n_components', int, 1)

if self.n_components > X.shape[1]:
raise ValueError('The preferred dimensionality of the '
Expand All @@ -320,9 +318,9 @@ def _validate_params(self, X, y):
.format(X.shape[1],
self.components_.shape[1]))

check_scalar(self.max_iter, 'max_iter', integer_types, 1)
check_scalar(self.max_iter, 'max_iter', int, 1)
check_scalar(self.tol, 'tol', float, 0.)
check_scalar(self.verbose, 'verbose', integer_types, 0)
check_scalar(self.verbose, 'verbose', int, 0)

if self.callback is not None:
if not callable(self.callback):
Expand Down