-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
As per Numpy's release notes, using the aliases of builtin types like np.int is deprecated.
Yet, it is used in one of the tutorial notebooks. I noticed it.
This is the error message that you see, if you try to visualize Zero-one loss in the interactive demo 3, under section 3.1:
AttributeError: module 'numpy' has no attribute 'float'.
Full error message
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
[/usr/local/lib/python3.11/dist-packages/ipywidgets/widgets/interaction.py](https://localhost:8080/#) in observer(change)
78 with out:
79 clear_output(wait=True)
---> 80 f(**kwargs)
81 show_inline_matplotlib_plots()
82 for k,w in controls.items():
3 frames
[/usr/local/lib/python3.11/dist-packages/numpy/__init__.py](https://localhost:8080/#) in __getattr__(attr)
392
393 if attr in __former_attrs__:
--> 394 raise AttributeError(__former_attrs__[attr])
395
396 if attr in __expired_attributes__:
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, 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.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecationsHere's a screenshot, when Zero-One Loss is selected:
However, it works fine for other losses. One example:

Metadata
Metadata
Assignees
Labels
No labels