pub struct Nabla;
Expand description
Nabla is where all the magic happens and where all the gradients are calculated.
Implementations§
Source§impl Nabla
Calculates the gradients (nabla) for linear regression with multiple features
impl Nabla
Calculates the gradients (nabla) for linear regression with multiple features
Source§impl Nabla
impl Nabla
Sourcepub fn linear_regression(
X: &NDArray,
y: &NDArray,
alpha: f64,
epochs: usize,
) -> (Vec<f64>, Vec<f64>)
pub fn linear_regression( X: &NDArray, y: &NDArray, alpha: f64, epochs: usize, ) -> (Vec<f64>, Vec<f64>)
Performs linear regression using gradient descent with multiple features
§Arguments
X
- The input feature matrix as an NDArray.y
- The output target as an NDArray.alpha
- The learning rate.epochs
- The number of iterations for gradient descent.
§Returns
A tuple containing the optimized parameters and the history of MSE for each epoch.
Auto Trait Implementations§
impl Freeze for Nabla
impl RefUnwindSafe for Nabla
impl Send for Nabla
impl Sync for Nabla
impl Unpin for Nabla
impl UnwindSafe for Nabla
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more