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

Create an affinity object with precomputed affinity matrix #216

Closed
dkobak opened this issue Oct 7, 2022 · 1 comment
Closed

Create an affinity object with precomputed affinity matrix #216

dkobak opened this issue Oct 7, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@dkobak
Copy link
Contributor

dkobak commented Oct 7, 2022

If I have a sparse affinity matrix stored in P, I can run openTSNE as follows:

from openTSNE import TSNE
from openTSNE.affinity import Affinities

A = Affinities()
A.P = P
Z = TSNE().fit(affinities = A)

I was wondering it would make sense to implement the following API:

Z = TSNE().fit(affinities = Affinities(P))
@pavlin-policar
Copy link
Owner

Hmm, the Affinities object is really meant more of as a base-class, and I never intended it to be used in this way. But I suppose there is no reason this should not work fine. There are two options, I think. One is the API you suggest Affinities(P), but I think making a new class doing basically the same thing called PrecomputedAffinities(P) would fit more nicely into the API. Since we already have the PrecomputedNeighbors KNN index. That would definitely make sense.

Since you already have a use-case in mind, would you be willing to take a crack at it?

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

No branches or pull requests

2 participants