lightautoml.tasks.losses

Wrappers of loss and metric functions for different machine learning algorithms.

Base Classes

MetricFunc

Wrapper for metric.

Loss

Loss function with target transformation.

Wrappers for LightGBM

Classes

LGBFunc

Wrapper of metric function for LightGBM.

LGBLoss

Loss used for LightGBM.

Functions

softmax_ax1

Softmax columnwise.

lgb_f1_loss_multiclass

Custom loss for optimizing f1.

Wrappers for CatBoost

Classes

CBLoss

Loss used for CatBoost.

CBCustomMetric

Metric wrapper class for CatBoost.

CBRegressionMetric

Regression metric wrapper for CatBoost.

CBClassificationMetric

Classification metric wrapper for CatBoost.

CBMulticlassMetric

Multiclassification metric wrapper for CatBoost.

Functions

cb_str_loss_wrapper

CatBoost loss name wrapper, if it has keyword args.

Wrappers for Sklearn

Classes

SKLoss

Loss used for scikit-learn.

Wrappers for Torch

Classes

TorchLossWrapper

Customize PyTorch-based loss.

TORCHLoss

Loss used for PyTorch.

Functions

torch_rmsle

Computes Root Mean Squared Logarithmic Error.

torch_quantile

Computes Mean Quantile Error.

torch_fair

Computes Mean Fair Error.

torch_huber

Computes Mean Huber Error.

torch_f1

Computes F1 macro.

torch_mape

Computes Mean Absolute Percentage Error.