joshlk / k-means-constrained

K-Means clustering - constrained with minimum and maximum cluster size. Documentation: https://joshlk.github.io/k-means-constrained
https://github.com/joshlk/k-means-constrained
BSD 3-Clause "New" or "Revised" License
192 stars 43 forks source link

Warning correction #11

Closed HediHargam closed 3 years ago

HediHargam commented 3 years ago

Hello,

Amazing repo and very useful algorithm !

I opened this issue to maybe correct a warning that generate a lot of warning messages when running the fit_predict method of KMeansConstrained :

""" k_means_constrained/sklearn_import/metrics/pairwise.py:575: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations dtype = np.float """

In a nutshell, it suggest to replace np.float and np.float32 by float in pairwise.py :)

joshlk commented 3 years ago

Thanks for taking the time to open an issue and letting me know. I have fixed the issue and updated the code 😃 . Josh