solvr 0.2.0

Advanced computing library for real-world problem solving - optimization, differential equations, interpolation, statistics, and more
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Regression analysis algorithms.
use crate::DType;

use super::LinregressResult;
use numr::error::Result;
use numr::ops::TensorOps;
use numr::runtime::Runtime;
use numr::tensor::Tensor;

/// Regression analysis algorithms for tensors.
///
/// Provides methods for fitting regression models to tensor data.
pub trait RegressionAlgorithms<R: Runtime<DType = DType>>: TensorOps<R> {
    /// Simple linear regression.
    ///
    /// Fits y = slope * x + intercept using ordinary least squares.
    fn linregress(&self, x: &Tensor<R>, y: &Tensor<R>) -> Result<LinregressResult>;
}