Skip to content

Commit 9a1aac6

Browse files
committed
fix the issue with np.bool
From the numpy version 1.20, the np.bool was removed.
1 parent fe8b9c0 commit 9a1aac6

File tree

14 files changed

+24
-24
lines changed

14 files changed

+24
-24
lines changed

.DS_Store

6 KB
Binary file not shown.

hbbrain/.DS_Store

6 KB
Binary file not shown.

hbbrain/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
4343
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
4444
#
45-
__version__ = "0.1.5"
45+
__version__ = "0.1.6"
4646

4747

4848
# On OSX, we can get a runtime error due to multiple OpenMP libraries loaded

hbbrain/mixed_data/eiol_gfmm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,8 +1414,8 @@ def _simple_pruning(self, Xl_val, Xu_val, Xcat_val, y_val, acc_threshold=0.5, ke
14141414

14151415
# pruning handling based on the validation results
14161416
n_hyperboxes = hyperboxes_performance.shape[0]
1417-
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
1418-
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
1417+
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
1418+
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
14191419
for i in range(n_hyperboxes):
14201420
if (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1] != 0) and (hyperboxes_performance[i, 0] / (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1]) >= acc_threshold):
14211421
id_remained_excl_empty_boxes[i] = True

hbbrain/mixed_data/freq_cat_onln_gfmm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,8 @@ def _simple_pruning(self, Xl_val, Xu_val, Xcat_val, y_val, acc_threshold=0.5, ke
11891189

11901190
# pruning handling based on the validation results
11911191
n_hyperboxes = hyperboxes_performance.shape[0]
1192-
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
1193-
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
1192+
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
1193+
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
11941194
for i in range(n_hyperboxes):
11951195
if (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1] != 0) and (hyperboxes_performance[i, 0] / (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1]) >= acc_threshold):
11961196
id_remained_excl_empty_boxes[i] = True

hbbrain/mixed_data/onehot_onln_gfmm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def one_hot_encoding_cat_feature(X, categorical_features, encodings=None):
8484
encoding = encodings[i]
8585

8686
oh_transformed = encoding.transform(X[:, [val]]).toarray()
87-
oh_transformed_reshape = [np.array(j, dtype=np.bool)
87+
oh_transformed_reshape = [np.array(j, dtype=bool)
8888
for j in oh_transformed]
8989
X_out[:, val] = oh_transformed_reshape
9090

@@ -1056,8 +1056,8 @@ def _simple_pruning(self, Xl_val, Xu_val, Xd_val, y_val, acc_threshold=0.5, keep
10561056

10571057
# pruning handling based on the validation results
10581058
n_hyperboxes = hyperboxes_performance.shape[0]
1059-
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
1060-
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
1059+
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
1060+
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
10611061
for i in range(n_hyperboxes):
10621062
if (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1] != 0) and (hyperboxes_performance[i, 0] / (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1]) >= acc_threshold):
10631063
id_remained_excl_empty_boxes[i] = True

hbbrain/numerical_data/.DS_Store

8 KB
Binary file not shown.

hbbrain/numerical_data/batch_learner/accel_agglo_gfmm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,8 @@ def simple_pruning(self, Xl_val, Xu_val, y_val, acc_threshold=0.5, keep_empty_bo
572572

573573
# pruning handling based on the validation results
574574
n_hyperboxes = hyperboxes_performance.shape[0]
575-
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
576-
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
575+
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
576+
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
577577
for i in range(n_hyperboxes):
578578
if (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1] != 0) and (hyperboxes_performance[i, 0] / (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1]) >= acc_threshold):
579579
id_remained_excl_empty_boxes[i] = True

hbbrain/numerical_data/batch_learner/agglo_gfmm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def _fit(self, Xl, Xu, y, pre_incl_sample=None):
269269
n_current_hyperboxes = self.V.shape[0]
270270
label_list = np.unique(self.C[self.C != UNLABELED_CLASS])[::-1]
271271
label_mask = np.zeros(
272-
shape=(n_current_hyperboxes, len(label_list)), dtype=np.bool)
272+
shape=(n_current_hyperboxes, len(label_list)), dtype=bool)
273273
for i in range(len(label_list)):
274274
label_mask[:, i] = (self.C == label_list[i]) | (
275275
self.C == UNLABELED_CLASS)
@@ -643,8 +643,8 @@ def simple_pruning(self, Xl_val, Xu_val, y_val, acc_threshold=0.5, keep_empty_bo
643643

644644
# pruning handling based on the validation results
645645
n_hyperboxes = hyperboxes_performance.shape[0]
646-
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
647-
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
646+
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
647+
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
648648
for i in range(n_hyperboxes):
649649
if (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1] != 0) and (hyperboxes_performance[i, 0] / (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1]) >= acc_threshold):
650650
id_remained_excl_empty_boxes[i] = True

hbbrain/numerical_data/incremental_learner/inf_onln_gfmm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ def simple_pruning(self, Xl_val, Xu_val, y_val, acc_threshold=0.5, keep_empty_bo
600600

601601
# pruning handling based on the validation results
602602
n_hyperboxes = hyperboxes_performance.shape[0]
603-
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
604-
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(np.bool)
603+
id_remained_excl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
604+
id_remained_incl_empty_boxes = np.zeros(n_hyperboxes).astype(bool)
605605
for i in range(n_hyperboxes):
606606
if (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1] != 0) and (hyperboxes_performance[i, 0] / (hyperboxes_performance[i, 0] + hyperboxes_performance[i, 1]) >= acc_threshold):
607607
id_remained_excl_empty_boxes[i] = True

0 commit comments

Comments
 (0)