Ë
    ý�Djm  ã                   ó$   — d dl mZ ddlZdgZd„ Zy)é   )Úcheck_endogé    NÚsmapec                 óò   — t        | dd¬«      } t        |dd¬«      }t        j                  || z
  «      }t        j                  |dz  t        j                  |«      t        j                  | «      z   z  «      S )ac  Compute the Symmetric Mean Absolute Percentage Error.

    The symmetric mean absolute percentage error (SMAPE) is an accuracy measure
    based on percentage (or relative) errors. Defined as follows:

        :math:`\frac{100\%}{n}\sum_{t=1}^{n}{\frac{|F_{t}-A_{t}|}{
        (|A_{t}|+|F_{t}|)/2}}`

    Where a perfect SMAPE score is 0.0, and a higher score indicates a higher
    error rate.

    Parameters
    ----------
    y_true : array-like, shape=(n_samples,)
        The true test values of y.

    y_pred : array-like, shape=(n_samples,)
        The forecasted values of y.

    Examples
    --------
    A typical case:
    >>> import numpy as np
    >>> y_true = np.array([0.07533, 0.07533, 0.07533, 0.07533,
    ...                    0.07533, 0.07533, 0.0672, 0.0672])
    >>> y_pred = np.array([0.102, 0.107, 0.047, 0.1,
    ...                    0.032, 0.047, 0.108, 0.089])
    >>> smape(y_true, y_pred)
    42.60306631890196

    A perfect score:
    >>> smape(y_true, y_true)
    0.0

    References
    ----------
    .. [1] https://en.wikipedia.org/wiki/Symmetric_mean_absolute_percentage_error
    F)ÚcopyÚpreserve_serieséÈ   )r   ÚnpÚabsÚmean)Úy_trueÚy_predÚabs_diffs      úTC:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\pmdarima/metrics.pyr   r   	   sn   € ôN ØØØô€Fô
 ØØØô€Fô
 �v‰v�f˜v‘oÓ&€HÜ�7‰7�H˜s‘N¤b§f¡f¨V£n´r·v±v¸f³~Ñ&EÑFÓHÐHó    )Úutilsr   Únumpyr
   Ú__all__r   © r   r   ú<module>r      s   ðõ Û àˆ)€ó2Ir   