Skip to content

Commit 71f2531

Browse files
authored
fix(test): replace np.float_ to np.float64 (#1119)
1 parent 9f0bc8f commit 71f2531

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

mlxtend/_base/_regressor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self):
1616
pass
1717

1818
def _check_target_array(self, y, allowed=None):
19-
if not isinstance(y[0], (float, np.float_)):
19+
if not isinstance(y[0], (float, np.float64)):
2020
raise AttributeError("y must be a float array.\nFound %s" % y.dtype)
2121

2222
def fit(self, X, y, init_params=True):

mlxtend/_base/tests/test_classifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_check_labels_not_ok_1():
5151

5252

5353
def test_check_labels_integer_notok():
54-
y = np.array([1.0, 2.0], dtype=np.float_)
54+
y = np.array([1.0, 2.0], dtype=np.float64)
5555
cl = BlankClassifier(print_progress=0, random_seed=1)
5656
with pytest.raises(AttributeError) as excinfo:
5757
cl._check_target_array(y)

mlxtend/_base/tests/test_cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_check_labels_not_ok_1():
5151

5252

5353
def test_check_labels_integer_notok():
54-
y = np.array([1.0, 2.0], dtype=np.float_)
54+
y = np.array([1.0, 2.0], dtype=np.float64)
5555
cl = BlankClassifier(print_progress=0, random_seed=1)
5656
with pytest.raises(AttributeError) as excinfo:
5757
cl._check_target_array(y)

mlxtend/classifier/multilayerperceptron.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _fit(self, X, y, init_params=True):
143143
prev_grad_b_out = np.zeros(shape=self.b_["out"].shape)
144144
prev_grad_w_out = np.zeros(shape=self.w_["out"].shape)
145145

146-
y_enc = self._one_hot(y=y, n_labels=self.n_classes, dtype=np.float_)
146+
y_enc = self._one_hot(y=y, n_labels=self.n_classes, dtype=np.float64)
147147

148148
self.init_time_ = time()
149149

mlxtend/classifier/softmax_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _fit(self, X, y, init_params=True):
141141
)
142142
self.cost_ = []
143143

144-
y_enc = self._one_hot(y=y, n_labels=self.n_classes, dtype=np.float_)
144+
y_enc = self._one_hot(y=y, n_labels=self.n_classes, dtype=np.float64)
145145

146146
self.init_time_ = time()
147147
rgen = np.random.RandomState(self.random_seed)

mlxtend/math/linalg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def vectorspace_orthonormalization(ary, eps=1e-13): # method='gram-schmidt',
4545
# 2c) Normalize if linearly independent,
4646
# and set to zero otherwise
4747

48-
arr = ary.astype(np.float_).copy()
48+
arr = ary.astype(np.float64).copy()
4949

5050
for i in range(arr.shape[1]):
5151
for j in range(i):

mlxtend/plotting/tests/test_decision_regions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_y_int_ary():
9494
"Try passing the array as y.astype(np.int_)",
9595
plot_decision_regions,
9696
X[:, :2],
97-
y.astype(np.float_),
97+
y.astype(np.float64),
9898
sr,
9999
)
100100

0 commit comments

Comments
 (0)