Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisibleDeprecationWarning #83

Open
jmrichardson opened this issue Sep 10, 2020 · 1 comment
Open

VisibleDeprecationWarning #83

jmrichardson opened this issue Sep 10, 2020 · 1 comment

Comments

@jmrichardson
Copy link

jmrichardson commented Sep 10, 2020

Description

Hi, I am getting many of these warnings with ShapeletTransform:

D:\Anaconda3\envs\tipjar\lib\site-packages\numpy\core\_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
  return array(a, dtype, copy=False, order=order)

Steps/Code to Reproduce

st = ShapeletTransform(n_jobs=cpus)
    features = st.fit_transform(X_trn_seg, y_trn_seg)

Versions

NumPy 1.19.1
SciPy 1.4.1
Scikit-Learn 0.23.1
Numba 0.49.1
Pyts 0.11.0

@johannfaouzi
Copy link
Owner

Hi,

Thanks for the report. If I had to guess, I would say that this warning is raised when the shapelets are saved as an array of arrays and the dtype is not specified when creating this array:

shapelets = np.asarray(list(chain.from_iterable(shapelets)))

If I add a dtype='object' when creating this array, there is no warning anymore.

One temporary fix for your project is to simply suppress this warning. I won't probably make a release that just fixes this issue.

PR welcomed if you want to do it, otherwise I'll do it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants