Module panama.metrics.py_metrics

Functions

def nmae(y_true: Union[numpy.ndarray, pandas.core.series.Series], y_pred: Union[numpy.ndarray, pandas.core.series.Series], y_true_norm: Union[numpy.ndarray, pandas.core.series.Series], y_pred_norm: Union[numpy.ndarray, pandas.core.series.Series], normalization_mode: str) ‑> float

Compute the normalized Mean Absolute Error (nMAE) between two arrays.

Parameters

y_true (np.array, pd.Series): Array of true values. y_pred (np.array, pd.Series): Array of predicted values. y_true_norm (np.array, pd.Series): Array of normalization factors for y_true. y_pred_norm (np.array, pd.Series): Array of normalization factors for y_pred. normalization_mode (str): The normalization mode to use. 'additive': Subtract the normalization factor from y_true. 'multiplicative': Divide y_true by the normalization factor.

Returns

float
normalized MAE value.
def nmape(y_true: Union[numpy.ndarray, pandas.core.series.Series], y_pred: Union[numpy.ndarray, pandas.core.series.Series], y_true_norm: Union[numpy.ndarray, pandas.core.series.Series], y_pred_norm: Union[numpy.ndarray, pandas.core.series.Series], normalization_mode: str) ‑> float

Compute the normalized Mean Absolute Percentage Error (nMAPE) between two arrays.

Parameters

y_true (np.array, pd.Series): Array of true values. y_pred (np.array, pd.Series): Array of predicted values. y_true_norm (np.array, pd.Series): Array of normalization factors for y_true. y_pred_norm (np.array, pd.Series): Array of normalization factors for y_pred. normalization_mode (str): The normalization mode to use. 'additive': Subtract the normalization factor from y_true. 'multiplicative': Divide y_true by the normalization factor.

Returns

float
normalized MAPE value.
def rtae(y_true: numpy.ndarray, y_pred: numpy.ndarray) ‑> float

Compute the Relative Total Absolte Error between two arrays.

Parameters

y_true (np.array, pd.Series): Array of true values. y_pred (np.array, pd.Series): Array of predicted values.

Returns

float
RTAE value.
def smape(y_true: Union[numpy.ndarray, pandas.core.series.Series], y_pred: Union[numpy.ndarray, pandas.core.series.Series]) ‑> numpy.float64

Computes the Symmetric Mean Absolute Percentage Error (SMAPE) between two arrays.

Parameters

y_true (np.array, pd.Series): Array of true values. y_pred (np.array, pd.Series): Array of predicted values.

Returns

float
Symmetric MAPE value.