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

Gracefully fail t-SNE embedding when requested perplexity is higher than the number of samples #37

Open
huddlej opened this issue Aug 27, 2024 · 0 comments

Comments

@huddlej
Copy link
Contributor

huddlej commented Aug 27, 2024

Instead of failing with an uncaught exception like the following:

ValueError: perplexity must be less than n_samples

the t-SNE embedding should compare the number of samples in the input distance matrix to the perplexity and let the user know how to fix the error.

Another option would be to automatically use the minimum of the requested perplexity and given number of samples while printing a warning to the user. This approach would allow the embedding to run in most cases except when there are fewer than 2 samples.

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

No branches or pull requests

1 participant