Skip to content

[MRG] Addresses test errors on numpy-dev #9683

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 1 commit into from
Sep 4, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion sklearn/ensemble/gradient_boosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ZeroEstimator(object):
"""An estimator that simply predicts zero. """

def fit(self, X, y, sample_weight=None):
if np.issubdtype(y.dtype, int):
if np.issubdtype(y.dtype, np.signedinteger):
# classification
self.n_classes = np.unique(y).shape[0]
if self.n_classes == 2:
Expand Down
2 changes: 1 addition & 1 deletion sklearn/feature_extraction/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ def transform(self, X, copy=True):
-------
vectors : sparse matrix, [n_samples, n_features]
"""
if hasattr(X, 'dtype') and np.issubdtype(X.dtype, np.float):
if hasattr(X, 'dtype') and np.issubdtype(X.dtype, np.floating):
# preserve float family dtype
X = sp.csr_matrix(X, copy=copy)
else:
Expand Down
2 changes: 1 addition & 1 deletion sklearn/learning_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def _translate_train_sizes(train_sizes, n_max_training_samples):
n_ticks = train_sizes_abs.shape[0]
n_min_required_samples = np.min(train_sizes_abs)
n_max_required_samples = np.max(train_sizes_abs)
if np.issubdtype(train_sizes_abs.dtype, np.float):
if np.issubdtype(train_sizes_abs.dtype, np.floating):
if n_min_required_samples <= 0.0 or n_max_required_samples > 1.0:
raise ValueError("train_sizes has been interpreted as fractions "
"of the maximum number of training samples and "
Expand Down
2 changes: 1 addition & 1 deletion sklearn/model_selection/_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ def _translate_train_sizes(train_sizes, n_max_training_samples):
n_ticks = train_sizes_abs.shape[0]
n_min_required_samples = np.min(train_sizes_abs)
n_max_required_samples = np.max(train_sizes_abs)
if np.issubdtype(train_sizes_abs.dtype, np.float):
if np.issubdtype(train_sizes_abs.dtype, np.floating):
if n_min_required_samples <= 0.0 or n_max_required_samples > 1.0:
raise ValueError("train_sizes has been interpreted as fractions "
"of the maximum number of training samples and "
Expand Down
2 changes: 1 addition & 1 deletion sklearn/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def safe_mask(X, mask):
mask
"""
mask = np.asarray(mask)
if np.issubdtype(mask.dtype, np.int):
if np.issubdtype(mask.dtype, np.signedinteger):
return mask

if hasattr(X, "toarray"):
Expand Down