HuberLoss

class HuberLoss(delta=1.0, **kwargs)[source]

Bases: KernelLoss

This class provides a Huber loss function for regression. It is robust to outliers by using a combination of squared error for small errors and absolute error for large errors.

Parameters:
  • delta (float) – The threshold at which to change from squared to linear loss.

  • **kwargs – Arbitrary keyword arguments to pass to SVR constructor.

Methods

evaluate(parameter_values, quantum_kernel, data, labels)[source]

An abstract method for evaluating the loss of a kernel function on a labeled dataset.

Parameters:
  • parameter_values (Sequence[float]) – An array of values to assign to the user params

  • quantum_kernel (TrainableKernel) – A trainable quantum kernel object to evaluate

  • data (ndarray) – An (N, M) matrix containing the data N = # samples, M = dimension of data

  • labels (ndarray) – A length-N array containing the truth labels

Returns:

A loss value

Return type:

float