You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a pip install for tpot, however, when it tries to instantiate the class OneHotEncoder, the class has one input parameter of dtype, and it uses np.float. np.float was a deprecated alias for the builtin float.
Process to reproduce the issue
pip install tpot
from tpot import TPOTRegressor
AttributeError: module 'numpy' has no attribute 'float'.
The text was updated successfully, but these errors were encountered:
I had the same issue. Monkey patching can be solution which is discouraged in general, but seems harmless to me for this case. Please be cautious to use this workaround.
import numpy as np
# Define a new float class that behaves like the built-in float
class MyFloat(float):
pass
# Monkey patch the numpy module to replace np.float with MyFloat
np.float = MyFloat
# Now when the library code uses np.float, it will be interpreted as MyFloat
This was fixed by #1280, but until there's a new tpot release, you'll either have to use a workaround or do a pip install git+ to ensure that you're installing with the latest version available on GitHub.
Looks like the new release is out. One lingering compatibility issue, noted on conda-forge/tpot-feedstock#34, the use of load_boston has been removed from scikit-learn, causing the test suite to fail with the following error:
ERROR: Failure: ImportError (
`load_boston` has been removed from scikit-learn since version 1.2.
We'll do some pins/patches to get it out the door there, and see how it goes 🤞
Context of the issue
I did a pip install for tpot, however, when it tries to instantiate the class OneHotEncoder, the class has one input parameter of dtype, and it uses np.float.
np.float
was a deprecated alias for the builtinfloat
.Process to reproduce the issue
The text was updated successfully, but these errors were encountered: