deephyper.ensemble.loss.AbsoluteError

deephyper.ensemble.loss.AbsoluteError#

class deephyper.ensemble.loss.AbsoluteError[source]#

Bases: Loss

The usual absolute loss (y_true - y_pred)**2.

It is used to estimate the median of P(Y|X=x).

Methods

__call__(y_true: ndarray, y_pred: ndarray | Dict[str, ndarray]) ndarray[source]#

Compute the absolute error.

Parameters:
  • y_true (np.ndarray) – the true target values.

  • y_pred (np.ndarray or Dict[str, np.ndarray]) – the predicted target values. If it is a

  • _Dict[str

  • "loc". (np.ndarray]_ then it should contain a key)

Returns:

the loss value with first dimension n_samples.

Return type:

np.ndarray