Loss

class lightautoml.tasks.losses.base.Loss[source]

Bases: object

Loss function with target transformation.

property fw_func

Forward transformation for target values and item weights.

Returns

Callable transformation.

property bw_func

Backward transformation for predicted values.

Returns

Callable transformation.

metric_wrapper(metric_func, greater_is_better, metric_params=None)[source]

Customize metric.

Parameters
  • metric_func (Callable) – Callable metric.

  • greater_is_better (Optional[bool]) – Whether or not higher value is better.

  • metric_params (Optional[Dict]) – Additional metric parameters.

Return type

Callable

Returns

Callable metric.

set_callback_metric(metric, greater_is_better=None, metric_params=None, task_name=None)[source]

Callback metric setter.

Parameters

Note

Value of task_name should be one of following options:

  • ‘binary’

  • ‘reg’

  • ‘multiclass’