deephyper.ensemble.loss.SquaredError

deephyper.ensemble.loss.SquaredError#

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

Bases: Loss

The usual square loss (y_true - y_pred)**2 used to estimate E[Y|X=x].

Methods

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

Compute the loss function.

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

  • y_pred (np.ndarray or dict) – the predicted target values.

Returns:

the loss value with first dimension n_samples.

Return type:

np.ndarray