
    DjR	                     >    d dl Z d dl mZ d dlmZ  G d dee      Zy)    N)ABCMeta)BaseEstimatorc                       e Zd ZdZej
                  d        ZddZej
                  d	d       Zej
                  d        Z	ej
                  d
d       Z
y)	BaseARIMAzA base ARIMA classc                      y)zFit an ARIMA modelN )selfyXfit_argss       QC:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\pmdarima/base.pyfitzBaseARIMA.fit           Nc                 T     | j                   ||fi |  | j                  d||d|S )a  Fit an ARIMA to a vector, ``y``, of observations with an
        optional matrix of ``exogenous`` variables, and then generate
        predictions.

        Parameters
        ----------
        y : array-like or iterable, shape=(n_samples,)
            The time-series to which to fit the ``ARIMA`` estimator. This may
            either be a Pandas ``Series`` object (statsmodels can internally
            use the dates in the index), or a numpy array. This should be a
            one-dimensional array of floats, and should not contain any
            ``np.nan`` or ``np.inf`` values.

        X : array-like, shape=[n_obs, n_vars], optional (default=None)
            An optional 2-d array of exogenous variables. If provided, these
            variables are used as additional features in the regression
            operation. This should not include a constant or trend. Note that
            if an ``ARIMA`` is fit on exogenous features, it must be provided
            exogenous features for making predictions.

        n_periods : int, optional (default=10)
            The number of periods in the future to forecast.

        fit_args : dict or kwargs, optional (default=None)
            Any keyword args to pass to the fit method.
        )	n_periodsr   r   )r   predict)r	   r
   r   r   r   s        r   fit_predictzBaseARIMA.fit_predict   s6    6 	A"" t||Ai1AAAr   c                      y)z"Create forecasts on a fitted modelNr   )r	   r   r   return_conf_intalphakwargss         r   r   zBaseARIMA.predict6   r   r   c                      y)zGet in-sample forecastsNr   )r	   r   startenddynamicr   s         r   predict_in_samplezBaseARIMA.predict_in_sample;   r   r   c                      y)zUpdate an ARIMA modelNr   )r	   r
   r   maxiterr   s        r   updatezBaseARIMA.update?   r   r   )N
   )Fg?)NN)__name__
__module____qualname____doc__abcabstractmethodr   r   r   r   r    r   r   r   r   r      sr    ! !BD 	1 1 	& & 	$ $r   r   )	metaclass)r&   r   sklearn.baser   r   r   r   r   <module>r*      s   
   &
4$ 4$r   