Closed stephenpardy closed 1 year ago
Hi, I came across the same problems. Shouldn't the np.float changed to np.float64, and np.int to np.int32 though? So it's consistent with the rest of the code I proposed another PR https://github.com/linkedin/FastTreeSHAP/pull/22 Please correct me if I'm wrong!
@julnow see discussion in numpy: https://numpy.org/devdocs/release/1.20.0-notes.html#using-the-aliases-of-builtin-types-like-np-int-is-deprecated the np.int
np.bool
and np.float
are all aliasing the python builtins, so to avoid any change in behavior it is recommended to move the regular builtins. Moving to the np.int32
could potentially change behavior, but may be preferred depending on the use case.
@stephenpardy thanks!
Thanks @stephenpardy for pointing out the outdated numpy aliases issue and making this great PR! I will go and merge it.
This PR removes some outdated aliases from the code. Numpy has deprecated
np.int
np.bool
andnp.float
- these use to just point to the existing python builtin types. This change simply moves the call to these builtins.Fixes #20