microsoft / FLAML

A fast library for AutoML and tuning. Join our Discord: https://discord.gg/Cppx2vSPVP.
https://microsoft.github.io/FLAML/
MIT License
3.75k stars 495 forks source link

ml.py contains conflicting references to Numpy #1285

Closed ptkasper closed 3 months ago

ptkasper commented 3 months ago

flaml/automl/ml.py

On line 249, you have: "return np.inf" with lower case i but on line 326 you have "best_val_loss=np.Inf" with upper case I.

The latter one is deprecated in Numpy 2.0 and causes an error with e.g. Autogen (or pyautogen):

AttributeError: np.Inf was removed in the NumPy 2.0 release. Use np.inf instead.. Did you mean: 'inf'?

File "\Lib\site-packages\flaml\automl\automl.py", line 15, in from flaml.automl.state import SearchState, AutoMLState Line 326, in best_val_loss=np.Inf,