Enum Objective

Source
pub enum Objective {
Show 15 variants RegLinear, RegLogistic, BinaryLogistic, BinaryLogisticRaw, GpuRegLinear, GpuRegLogistic, GpuBinaryLogistic, GpuBinaryLogisticRaw, CountPoisson, SurvivalCox, MultiSoftmax(u32), MultiSoftprob(u32), RankPairwise, RegGamma, RegTweedie(Option<f32>),
}
Expand description

Learning objective used when training a booster model.

Variants§

§

RegLinear

Linear regression.

§

RegLogistic

Logistic regression.

§

BinaryLogistic

Logistic regression for binary classification, outputs probability.

§

BinaryLogisticRaw

Logistic regression for binary classification, outputs scores before logistic transformation.

§

GpuRegLinear

GPU version of RegLinear.

§

GpuRegLogistic

GPU version of RegLogistic.

§

GpuBinaryLogistic

GPU version of RegBinaryLogistic.

§

GpuBinaryLogisticRaw

GPU version of RegBinaryLogisticRaw.

§

CountPoisson

Poisson regression for count data, outputs mean of poisson distribution.

§

SurvivalCox

Cox regression for right censored survival time data (negative values are considered right censored).

predictions are returned on the hazard ratio scale (i.e., as HR = exp(marginal_prediction) in the proportional hazard function h(t) = h0(t) * HR).

§

MultiSoftmax(u32)

Multiclass classification using the softmax objective, with given number of classes.

§

MultiSoftprob(u32)

Multiclass classification using the softmax objective, with given number of classes.

Outputs probabilities per class.

§

RankPairwise

Ranking task which minimises pairwise loss.

§

RegGamma

Gamma regression with log-link. Output is the mean of the gamma distribution.

§

RegTweedie(Option<f32>)

Tweedie regression with log-link. Takes an optional tweedie variance power parameter which controls the variance of the Tweedie distribution.

  • Set closer to 2 to shift towards a gamma distribution
  • Set closer to 1 to shift towards a Poisson distribution

range: (1, 2)

Set to None to use XGBoost’s default (currently 1.5).

Trait Implementations§

Source§

impl Clone for Objective

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Objective

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ToString for Objective

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl Copy for Objective

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.