functions ========= .. py:module:: functions Attributes ---------- .. autoapisummary:: functions.target_version Functions --------- .. autoapisummary:: functions.r2_keras functions.msenonzero Module Contents --------------- .. py:data:: target_version :value: '2.17.0' .. py:function:: 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. :param y_true: The true labels. :type y_true: `tensorflow.Tensor` :param y_pred: The predicted labels. :type y_pred: `tensorflow.Tensor` :returns: **r2** -- The R-squared value. :rtype: `tensorflow.Tensor` .. py:function:: 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. :param y_true: The true labels. :type y_true: `tensorflow.Tensor` :param y_pred: The predicted labels. :type y_pred: `tensorflow.Tensor` :returns: **mse** -- The mean squared error ignoring zeros. :rtype: `tensorflow.Tensor`