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

Implement precomputed affinity class #217

Merged
merged 5 commits into from
Nov 9, 2022

Conversation

dkobak
Copy link
Contributor

@dkobak dkobak commented Oct 12, 2022

Implements #216.

Allows to do the following:

from openTSNE import TSNE
from openTSNE.affinity import PrecomputedAffinities

# Here P is either a np.array or a scipy.sparse matrix
Z = TSNE().fit(affinities = PrecomputedAffinities(P))

@pavlin-policar
Copy link
Owner

I think this functionality needs a test. Additionally, would it make sense to re-normalize the affinity matrix here? Or do we want to allow un-normalized affinity matrices? Perhaps a normalize parameter defaulting to True might be the way to go. What do you think?

@dkobak
Copy link
Contributor Author

dkobak commented Nov 9, 2022

Good idea about the normalize parameter. Added it, and added a couple of tests as well.

@pavlin-policar
Copy link
Owner

Wonderful, thanks! I've added a usage-test, which basically just checks that the whole thing works as intended, then I'll merge.

@pavlin-policar pavlin-policar merged commit 46d65ae into pavlin-policar:master Nov 9, 2022
@dkobak dkobak deleted the precomputed_affinity branch November 9, 2022 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants