flennerhag / mlens

ML-Ensemble – high performance ensemble learning
http://ml-ensemble.com
MIT License
843 stars 108 forks source link

Error in index/base.py when using NumPy 1.24 or higher - Replace `np.int` with `np.int_` #153

Open KimJongkwang opened 11 months ago

KimJongkwang commented 11 months ago

I encountered an issue when using mlens that relates to the index/base.py file. Specifically, in line 83, the code sizes = (n // p) * np.ones(p, dtype=np.int) throws an error when using NumPy version 1.24 or higher.

It appears that the use of np.int has been deprecated in NumPy 1.20 and later versions. To resolve this issue, I suggest replacing dtype=np.int with dtype=np.int. The corrected code should look like this: `sizes = (n // p) * np.ones(p, dtype=np.int)`.

Please consider making this modification to ensure compatibility with NumPy versions 1.24 and higher.

Thank you.