rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.82k stars 853 forks source link

Leftover use of np.int and np.bool #1034

Closed carlsmedstad closed 1 year ago

carlsmedstad commented 1 year ago

Describe the bug

There is still some places where np.int and np.bool are used which should be replaces with np.int_ and np.bool_ respectively:

$ grep -R 'np.bool)'
mlxtend/evaluate/holdout.py:        train_mask = np.ones(X.shape[0], dtype=np.bool)
$ grep -R 'np.int)'
docs/sources/user_guide/classifier/OneRClassifier.ipynb:    "    return X_discretized.astype(np.int)\n",
mlxtend/evaluate/bias_variance_decomp.py:            var += (pred != main_predictions).astype(np.int)
carlsmedstad commented 1 year ago

The following fixes the tests:

sed -i 's/astype(np.int)/astype(np.int_)/g' mlxtend/evaluate/bias_variance_decomp.py
sed -i 's/dtype=np.bool/dtype=np.bool_/g' mlxtend/evaluate/holdout.py
rasbt commented 1 year ago

Should be fixed now :)