Skip to content

Commit 0e56ae3

Browse files
authored
MAINT: Remove np.int_ and np.uint (scikit-learn#27523)
1 parent fb0ab5a commit 0e56ae3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sklearn/ensemble/_hist_gradient_boosting/grower.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TreeNode:
3939
----------
4040
depth : int
4141
The depth of the node, i.e. its distance from the root.
42-
sample_indices : ndarray of shape (n_samples_at_node,), dtype=np.uint
42+
sample_indices : ndarray of shape (n_samples_at_node,), dtype=np.uint32
4343
The indices of the samples at the node.
4444
sum_gradients : float
4545
The sum of the gradients of the samples at the node.
@@ -50,7 +50,7 @@ class TreeNode:
5050
----------
5151
depth : int
5252
The depth of the node, i.e. its distance from the root.
53-
sample_indices : ndarray of shape (n_samples_at_node,), dtype=np.uint
53+
sample_indices : ndarray of shape (n_samples_at_node,), dtype=np.uint32
5454
The indices of the samples at the node.
5555
sum_gradients : float
5656
The sum of the gradients of the samples at the node.

sklearn/preprocessing/_discretization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class KBinsDiscretizer(TransformerMixin, BaseEstimator):
9898
The edges of each bin. Contain arrays of varying shapes ``(n_bins_, )``
9999
Ignored features will have empty arrays.
100100
101-
n_bins_ : ndarray of shape (n_features,), dtype=np.int_
101+
n_bins_ : ndarray of shape (n_features,), dtype=np.int64
102102
Number of bins per feature. Bins whose width are too small
103103
(i.e., <= 1e-8) are removed with a warning.
104104
@@ -439,7 +439,7 @@ def inverse_transform(self, Xt):
439439
for jj in range(n_features):
440440
bin_edges = self.bin_edges_[jj]
441441
bin_centers = (bin_edges[1:] + bin_edges[:-1]) * 0.5
442-
Xinv[:, jj] = bin_centers[np.int_(Xinv[:, jj])]
442+
Xinv[:, jj] = bin_centers[(Xinv[:, jj]).astype(np.int64)]
443443

444444
return Xinv
445445

0 commit comments

Comments
 (0)