functions_old

Functions

r2_keras(y_true, y_pred)

Calculate the R-squared metric for Keras models.

msenonzero(y_true, y_pred)

Calculate the mean squared error ignoring zero values.

Module Contents

functions_old.r2_keras(y_true, y_pred)

Calculate the R-squared metric for Keras models.

Compute the coefficient of determination (R-squared) for regression tasks, ignoring zero values in the true labels.

Parameters:
  • y_true (tensorflow.Tensor) – The true labels.

  • y_pred (tensorflow.Tensor) – The predicted labels.

Returns:

r2 – The R-squared value.

Return type:

tensorflow.Tensor

functions_old.msenonzero(y_true, y_pred)

Calculate the mean squared error ignoring zero values.

Compute the MSE for regression tasks, ignoring zero values in the true labels.

Parameters:
  • y_true (tensorflow.Tensor) – The true labels.

  • y_pred (tensorflow.Tensor) – The predicted labels.

Returns:

mse – The mean squared error ignoring zeros.

Return type:

tensorflow.Tensor