Serializing UMAP
See original GitHub issueHi! thanks for implementing UMAP it’s very handy! When serializing a trained UMAP object via pickle I had the following error:
pickle.dump(myumap, open('pickle.pkl', 'w'))
TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled
A workaround I’ve found is:
pickle.dump(myumap, open('pickle.pkl', 'w'), protocol=-1)
Do you think it is safe? Is there a better/recommended serialization approach?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
UMapBuildDataRegistry::Serialize
Handles reading, writing, and reference collecting using FArchive. This implementation handles all FProperty serialization, but can be overridden for native ...
Read more >How to Use UMAP — umap 0.5 documentation
If you are not so familiar with sklearn this tutorial will step you through the basics of using UMAP to transform and visualise...
Read more >UMAP
public class UMAP extends java.lang.Object implements java.io.Serializable. Uniform Manifold Approximation and Projection. UMAP is a dimension reduction ...
Read more >Asset Serialization (Text based uAsset and uMap) - Reddit
Asset Serialization (Text based uAsset and uMap). Hey all, I've been moving over from using Unity to Unreal for the past couple months....
Read more >Saving Sklearn Model to Pickle - Pema Grg
Saving the model and vectorizer as pickle. The pickle module implements binary protocols for serializing and de-serializing a Python object structure.“Pickling” ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
bump. I need to use loaded umap (pickle, joblib, etc) for inference (“You’ll only need [._rp_trees] it if you want to transform new data”). I think that might be a main reason people would want to serialize incidentally; future inference. Thanks for the project!
I think the simplest thing is to delete the
_rp_trees
attribute. You’ll only need it if you want to transform new data, and for the use cases you describe that should be fine. I’ll try to figure out a more long term fix when I get some time.