PENCIL icon indicating copy to clipboard operation
PENCIL copied to clipboard

Examples fail

Open TimoLassmann opened this issue 9 months ago • 4 comments

Hi, The example code fails on my system (both R and python tutorial). There seems to be an issue with parsing the predictions / numpy versions:


<>/PENCIL/env/lib/python3.9/site-packages/seaborn/_oldcore.py:1498: FutureWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, CategoricalDtype) instead
  if pd.api.types.is_categorical_dtype(vector):
<>/PENCIL/env/lib/python3.9/site-packages/seaborn/_oldcore.py:1498: FutureWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, CategoricalDtype) instead
  if pd.api.types.is_categorical_dtype(vector):
<>/PENCIL/env/lib/python3.9/site-packages/seaborn/_oldcore.py:1498: FutureWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, CategoricalDtype) instead
  if pd.api.types.is_categorical_dtype(vector):
<>/PENCIL/env/lib/python3.9/site-packages/seaborn/_oldcore.py:1498: FutureWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, CategoricalDtype) instead
  if pd.api.types.is_categorical_dtype(vector):
<>/PENCIL/pencil/utils.py:286: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
  Yp = np.array(Y_pred.reshape(-1,1), dtype=np.object)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "<>/PENCIL/pencil/pencil.py", line 271, in fit_transform
    h, r = self.transform(data, labels, savefig=savefig, **kwargs)
  File "<>/PENCIL/pencil/pencil.py", line 241, in transform
    h, r = test[self.mode](
  File "<>/PENCIL/pencil/pencil_evaluator.py", line 290, in mul_class_test
    plot_mul_class_umap(Yte, pred_labels, r, embedding=umap_embedding, X=Xte.cpu().numpy(), class_names=class_names)
  File "<>/PENCIL/pencil/utils.py", line 286, in plot_mul_class_umap
    Yp = np.array(Y_pred.reshape(-1,1), dtype=np.object)
  File "<>/PENCIL/env/lib/python3.9/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
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#deprecations

TimoLassmann avatar Sep 18 '23 08:09 TimoLassmann