Serializing UMAP
Open
Nobody has claimed this yet.
Good Reads
- Dominant language
- Python
- Stars
- 8.3k
- Forks
- 871
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 5
Description
Hi! 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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported pickle.dump failure with a trained UMAP object and compare it with protocol=-1. Investigate how the UMAP object is serialized and determine a supported approach that avoids the slots error; done means the recommended serialization path works reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100