lmcinnes / lmcinnes/umap

Serializing UMAP

Open
#273 7 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.