pub enum Loss {
    SquaredError,
    LogLikelyhood,
    LAD,
    RegLinear,
    RegLogistic,
    BinaryLogistic,
    BinaryLogitraw,
    MultiSoftprob,
    MultiSoftmax,
    RankPairwise,
}
Expand description

This enum defines the loss type.

We support three loss types for training and inference:

  1. SquaredError for regression. The label and the predicted value will be a float number.
  2. LogLikelyhood for binary classification. The label value should be -1 or 1. The predicted value should be a float number between 0 and 1, which is the possibility of label 1.
  3. LAD for regression. The label and the predicted value will be a float number.

Note that LogLikelyhood only support binary classification.

We also suppot seven objectives from Xgboost for inference. See xgboost

  1. RegLinear (“reg:linear” in xgboost): linear regression.
  2. RegLogistic (“reg:logistic” in xgboost): logistic regression.
  3. BinaryLogistic (“binary:logistic” in xgboost): logistic regression for binary classification, output probability
  4. BinaryLogitraw (“binary:logitraw” in xgboost): logistic regression for binary classification, output score before logistic transformation
  5. MultiSoftprob (“multi:softprob” in xgboost): multiclass classification. Call gbdt::predict_multiclass to get the predictions.
  6. MultiSoftmax (“multi:softmax” in xgboost): multiclass classification. Call gbdt::predict_multiclass to get the predictions.
  7. RankPairwise (“rank:pairwise” in xgboost): pairwise rank. See xgboost’s demo

Variants

SquaredError

SquaredError (“SquaredError”) for regression. The label and the predicted value will be a float number.

LogLikelyhood

LogLikelyhood (“LogLikelyhood”) for binary classification. The label value should be -1 or 1. The predicted value should be a float number between 0 and 1, which is the possibility of label 1.

LAD

LAD (“LAD”) for regression. The label and the predicted value will be a float number.

RegLinear

RegLinear (“reg:linear”) from Xgboost: linear regression.

RegLogistic

RegLogistic (“reg:logistic”) from Xgboost: logistic regression.

BinaryLogistic

BinaryLogistic (“binary:logistic”) from Xgboost: logistic regression for binary classification, output probability

BinaryLogitraw

BinaryLogitraw (“binary:logitraw”) from Xgboost: logistic regression for binary classification, output score before logistic transformation

MultiSoftprob

MultiSoftprob (“multi:softprob”) from Xgboost: multiclass classification. Call gbdt::predict_multiclass to get the predictions.

MultiSoftmax

MultiSoftmax (“multi:softmax”) from Xgboost: multiclass classification. Call gbdt::predict_multiclass to get the predictions.

RankPairwise

RankPairwise (“rank:pairwise”) from Xgboost: pairwise rank. See xgboost’s demo

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

SquaredError are used as default loss type.

Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.