use ndarray::Array1;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LinkFunction {
Identity,
Log,
Logit,
}
#[derive(Clone, Debug, PartialEq)]
pub struct GeneralizedLinearModel {
pub coefficients: Array1<f64>,
pub intercept: f64,
pub link: LinkFunction,
}
impl GeneralizedLinearModel {
#[must_use]
pub const fn new(coefficients: Array1<f64>, intercept: f64, link: LinkFunction) -> Self {
Self {
coefficients,
intercept,
link,
}
}
#[must_use]
pub fn n_features(&self) -> usize {
self.coefficients.len()
}
}