Skip to content

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

@huddlej

Description

@huddlej

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions