-
|
Hi, I trained a shapelet model. how can i save and load it for inference? I used |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
|
Hello. Can you share the error you get and the code used to create / save / load the model ? |
Beta Was this translation helpful? Give feedback.
-
|
The serialization workflow seems KO when using keras optimizer rather than a str and/or non default n_shapelets_per_size args. I have tried to fix both json and pickle serialization / deserialization in #623, if you want to take a look. For the time being, I think it's better to explicitely not support hdf5 serialization for learning shapelets rather than extensively rework this part for this estimator only. |
Beta Was this translation helpful? Give feedback.
-
|
I was using this: and when I run |
Beta Was this translation helpful? Give feedback.
-
|
I see. so I tried this |
Beta Was this translation helpful? Give feedback.
-
|
I got the same error when using non default n_shapelets_per_size . This should be fixed in the main branch, you can test it with Your save and load instructions are correct should work . the _to_dict method is just intern machinery. By the way, the size of your shapelets seems huge (shapelet_sizes = {300:4} means 4 shapelets of 300 samples), what's the shape of your dataset? You can have a look here for an example (not relevant for the save load problem though). Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks. I will try that. About the shapelet size, I was going to ask you. My understanding could be incorrect. So I have lots of time series data, each of ~1000x3 size. I noticed there are usually 4 classes where each class can be max 300x3 size. That means each time series may contain multiple classes. |
Beta Was this translation helpful? Give feedback.
I got the same error when using non default n_shapelets_per_size . This should be fixed in the main branch, you can test it with
python -m pip install "tslearn[all_features] @ https://github.com/tslearn-team/tslearn/archive/main.zip"on top of your existing environment.Your save and load instructions are correct
should work . the _to_dict method is just intern machinery.
By the way, the size of your shapelets seems huge (shapelet_sizes = {300:4} means 4 shapelets of 300 samples), what's the shape of your dataset? You can have a look here for an example (not relevant for the save load prob…