Skip to content

[WIP] Replace externals.six.integer_types with int #13342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 1, 2019
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