linfa_tsne/
error.rs

1use thiserror::Error;
2
3/// Simplified `Result` using [`TSneError`](crate::TSneError) as error type
4pub type Result<T> = std::result::Result<T, TSneError>;
5
6/// Error variants from hyper-parameter construction or model estimation
7#[derive(Error, Debug)]
8pub enum TSneError {
9    #[error("negative perplexity")]
10    NegativePerplexity,
11    #[error("perplexity too large for number of samples")]
12    PerplexityTooLarge,
13    #[error("negative approximation threshold")]
14    NegativeApproximationThreshold,
15    #[error("embedding size larger than original dimensionality")]
16    EmbeddingSizeTooLarge,
17    #[error("number of preliminary iterations larger than total iterations")]
18    PreliminaryIterationsTooLarge,
19    #[error("invalid shaped array {0}")]
20    InvalidShape(#[from] ndarray::ShapeError),
21    #[error(transparent)]
22    BaseCrate(#[from] linfa::Error),
23}