Enum SolverType

Source
pub enum SolverType {
    L2R_LR = 0,
    L2R_L2LOSS_SVC_DUAL = 1,
    L2R_L2LOSS_SVC = 2,
    L2R_L1LOSS_SVC_DUAL = 3,
    MCSVM_CS = 4,
    L1R_L2LOSS_SVC = 5,
    L1R_LR = 6,
    L2R_LR_DUAL = 7,
    L2R_L2LOSS_SVR = 11,
    L2R_L2LOSS_SVR_DUAL = 12,
    L2R_L1LOSS_SVR_DUAL = 13,
}
Expand description

Types of generalized linear models supported by liblinear.

These combine several types of regularization schemes:

  • L1
  • L2

…and loss functions:

  • L1-loss for SVM
  • Regular L2-loss for SVM (hinge-loss)
  • Logistic loss for logistic regression

Variants§

§

L2R_LR = 0

L2-regularized logistic regression (primal).

§

L2R_L2LOSS_SVC_DUAL = 1

L2-regularized L2-loss support vector classification (dual).

§

L2R_L2LOSS_SVC = 2

L2-regularized L2-loss support vector classification (primal).

§

L2R_L1LOSS_SVC_DUAL = 3

L2-regularized L1-loss support vector classification (dual).

§

MCSVM_CS = 4

Support vector classification by Crammer and Singer.

§

L1R_L2LOSS_SVC = 5

L1-regularized L2-loss support vector classification.

§

L1R_LR = 6

L1-regularized logistic regression.

§

L2R_LR_DUAL = 7

L2-regularized logistic regression (dual).

§

L2R_L2LOSS_SVR = 11

L2-regularized L2-loss support vector regression (primal).

§

L2R_L2LOSS_SVR_DUAL = 12

L2-regularized L2-loss support vector regression (dual).

§

L2R_L1LOSS_SVR_DUAL = 13

L2-regularized L1-loss support vector regression (dual).

Implementations§

Source§

impl SolverType

Source

pub fn is_logistic_regression(&self) -> bool

Returns true if the solver is a probabilistic/logistic regression solver.

Supported solvers: L2R_LR, L1R_LR, L2R_LR_DUAL.

Source

pub fn is_support_vector_regression(&self) -> bool

Returns true if the solver is a support vector regression solver.

Supported solvers: L2R_L2LOSS_SVR, L2R_L2LOSS_SVR_DUAL, L2R_L1LOSS_SVR_DUAL.

Source

pub fn is_multi_class_classification(&self) -> bool

Returns true if the solver supports multi-class classification.

Supported solvers: All non-SVR solvers.

Trait Implementations§

Source§

impl Default for SolverType

Source§

fn default() -> Self

Default: L2R_LR

Auto Trait Implementations§

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.