1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use linfa::Float;
use thiserror::Error;
pub type Result<T, F> = std::result::Result<T, LinearError<F>>;
#[derive(Error, Debug)]
pub enum LinearError<F: Float> {
#[error("argmin {0}")]
Argmin(#[from] argmin::core::Error),
#[error(transparent)]
BaseCrate(#[from] linfa::Error),
#[error("At least one sample needed")]
NotEnoughSamples,
#[error("At least one target needed")]
NotEnoughTargets,
#[error("penalty should be positive, but is {0}")]
InvalidPenalty(F),
#[error("tweedie distribution power should not be in (0, 1), but is {0}")]
InvalidTweediePower(F),
#[error("some value(s) of y are out of the valid range for power value {0}")]
InvalidTargetRange(F),
#[error(transparent)]
LinalgError(#[from] ndarray_linalg::error::LinalgError),
}