pub struct LogisticRegression {
pub coef_: Option<Vec<Vec<f32>>>,
pub intercept_: Option<Vec<f32>>,
pub penalty: Penalty,
pub c: f32,
pub fit_intercept: bool,
pub max_iter: usize,
pub tol: f32,
pub multi_class: MultiClass,
/* private fields */
}Expand description
Logistic Regression for binary and multiclass classification
Fields§
§coef_: Option<Vec<Vec<f32>>>§intercept_: Option<Vec<f32>>§penalty: Penalty§c: f32§fit_intercept: bool§max_iter: usize§tol: f32§multi_class: MultiClassImplementations§
Source§impl LogisticRegression
impl LogisticRegression
pub fn new() -> Self
pub fn penalty(self, penalty: Penalty) -> Self
pub fn c(self, c: f32) -> Self
pub fn max_iter(self, n: usize) -> Self
pub fn multi_class(self, mc: MultiClass) -> Self
pub fn fit(&mut self, x: &Tensor, y: &Tensor)
pub fn predict(&self, x: &Tensor) -> Tensor
pub fn predict_proba(&self, x: &Tensor) -> Tensor
pub fn score(&self, x: &Tensor, y: &Tensor) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogisticRegression
impl RefUnwindSafe for LogisticRegression
impl Send for LogisticRegression
impl Sync for LogisticRegression
impl Unpin for LogisticRegression
impl UnwindSafe for LogisticRegression
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more