pub struct Perceptron {
pub max_iter: usize,
pub eta0: f32,
pub tol: f32,
pub shuffle: bool,
pub penalty: Option<PerceptronPenalty>,
pub alpha: f32,
/* private fields */
}Expand description
Perceptron classifier
Fields§
§max_iter: usize§eta0: f32§tol: f32§shuffle: bool§penalty: Option<PerceptronPenalty>§alpha: f32Implementations§
Source§impl Perceptron
impl Perceptron
pub fn new() -> Self
pub fn max_iter(self, n: usize) -> Self
pub fn eta0(self, eta: f32) -> Self
pub fn penalty(self, p: PerceptronPenalty) -> Self
pub fn fit(&mut self, x: &Tensor, y: &Tensor)
pub fn predict(&self, x: &Tensor) -> Tensor
pub fn score(&self, x: &Tensor, y: &Tensor) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Perceptron
impl RefUnwindSafe for Perceptron
impl Send for Perceptron
impl Sync for Perceptron
impl Unpin for Perceptron
impl UnwindSafe for Perceptron
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