Struct LogisticRegression

Source
pub struct LogisticRegression<TX: Number + FloatNumber + RealNumber, TY: Number + Ord, X: Array2<TX>, Y: Array1<TY>> { /* private fields */ }
Expand description

Logistic Regression

Implementations§

Source§

impl<TX: Number + FloatNumber + RealNumber, TY: Number + Ord, X: Array2<TX>, Y: Array1<TY>> LogisticRegression<TX, TY, X, Y>

Source

pub fn fit( x: &X, y: &Y, parameters: LogisticRegressionParameters<TX>, ) -> Result<LogisticRegression<TX, TY, X, Y>, Failed>

Fits Logistic Regression to your data.

  • x - NxM matrix with N observations and M features in each observation.
  • y - target class values
  • parameters - other parameters, use Default::default() to set parameters to default values.
Source

pub fn predict(&self, x: &X) -> Result<Y, Failed>

Predict class labels for samples in x.

  • x - KxM data where K is number of observations and M is number of features.
Source

pub fn coefficients(&self) -> &X

Get estimates regression coefficients, this create a sharable reference

Source

pub fn intercept(&self) -> &X

Get estimate of intercept, this create a sharable reference

Source

pub fn classes(&self) -> &Vec<TY>

Get classes, this create a sharable reference

Trait Implementations§

Source§

impl<TX: Debug + Number + FloatNumber + RealNumber, TY: Debug + Number + Ord, X: Debug + Array2<TX>, Y: Debug + Array1<TY>> Debug for LogisticRegression<TX, TY, X, Y>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TX: Number + FloatNumber + RealNumber, TY: Number + Ord, X: Array2<TX>, Y: Array1<TY>> PartialEq for LogisticRegression<TX, TY, X, Y>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<TX: Number + FloatNumber + RealNumber, TY: Number + Ord, X: Array2<TX>, Y: Array1<TY>> Predictor<X, Y> for LogisticRegression<TX, TY, X, Y>

Source§

fn predict(&self, x: &X) -> Result<Y, Failed>

Estimate target values from new data. Read more
Source§

impl<TX: Number + FloatNumber + RealNumber, TY: Number + Ord, X: Array2<TX>, Y: Array1<TY>> SupervisedEstimator<X, Y, LogisticRegressionParameters<TX>> for LogisticRegression<TX, TY, X, Y>

Source§

fn new() -> Self

Empty constructor, instantiate an empty estimator. Object is dropped as soon as fit() is called. used to pass around the correct fit() implementation. by calling ::fit(). mostly used to be used with model_selection::cross_validate(...)
Source§

fn fit( x: &X, y: &Y, parameters: LogisticRegressionParameters<TX>, ) -> Result<Self, Failed>

Fit a model to a training dataset, estimate model’s parameters. Read more

Auto Trait Implementations§

§

impl<TX, TY, X, Y> Freeze for LogisticRegression<TX, TY, X, Y>
where X: Freeze,

§

impl<TX, TY, X, Y> RefUnwindSafe for LogisticRegression<TX, TY, X, Y>

§

impl<TX, TY, X, Y> Send for LogisticRegression<TX, TY, X, Y>
where X: Send, TX: Send, Y: Send, TY: Send,

§

impl<TX, TY, X, Y> Sync for LogisticRegression<TX, TY, X, Y>
where X: Sync, TX: Sync, Y: Sync, TY: Sync,

§

impl<TX, TY, X, Y> Unpin for LogisticRegression<TX, TY, X, Y>
where X: Unpin, TX: Unpin, Y: Unpin, TY: Unpin,

§

impl<TX, TY, X, Y> UnwindSafe for LogisticRegression<TX, TY, X, Y>
where X: UnwindSafe, TX: UnwindSafe, Y: UnwindSafe, TY: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.