docstr: Fit the auto-arima estimator
  
  Fit an AutoARIMA to a vector, ``y``, of observations with an
  optional matrix of ``X`` variables.
  
  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.
  
  **fit_args : dict or kwargs
      Any keyword arguments to pass to the auto-arima function.
docstr_tok: ["Fit","the","auto-arima","estimator","Fit","an","AutoARIMA","to","a","vector",",","``","y","``",",","of","observations","with","an","optional","matrix","of","``","X","``","variables",".","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",".","*","*","fit_args",":","dict","or","kwargs","Any","keyword","arguments","to","pass","to","the","auto-arima","function","."]
code: def fit(self, y, X=None, **fit_args):
      """Fit the auto-arima estimator
  
      Fit an AutoARIMA to a vector, ``y``, of observations with an
      optional matrix of ``X`` variables.
  
      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.
  
      **fit_args : dict or kwargs
          Any keyword arguments to pass to the auto-arima function.
      """
      sarimax_kwargs = {} if not self.kwargs else self.kwargs
  
      self.model_ = auto_arima(
          y,
          X=X,
          start_p=self.start_p,
          d=self.d,
          start_q=self.start_q,
          max_p=self.max_p,
          max_d=self.max_d,
          max_q=self.max_q,
          start_P=self.start_P,
          D=self.D,
          start_Q=self.start_Q,
          max_P=self.max_P,
          max_D=self.max_D,
          max_Q=self.max_Q,
          max_order=self.max_order,
          m=self.m,
          seasonal=self.seasonal,
          stationary=self.stationary,
          information_criterion=self.information_criterion,
          alpha=self.alpha,
          test=self.test,
          seasonal_test=self.seasonal_test,
          stepwise=self.stepwise,
          n_jobs=self.n_jobs,
          start_params=self.start_params,
          trend=self.trend,
          method=self.method,
          maxiter=self.maxiter,
          offset_test_args=self.offset_test_args,
          seasonal_test_args=self.seasonal_test_args,
          suppress_warnings=self.suppress_warnings,
          error_action=self.error_action,
          trace=self.trace,
          random=self.random,
          random_state=self.random_state,
          n_fits=self.n_fits,
          return_valid_fits=False,  # only return ONE
          out_of_sample_size=self.out_of_sample_size,
          scoring=self.scoring,
          scoring_args=self.scoring_args,
          with_intercept=self.with_intercept,
          sarimax_kwargs=sarimax_kwargs,
          **fit_args,
      )
  
      return self
  
imports: import numpy
  from sklearn.linear_model import LinearRegression
  import functools
  import time
  import warnings
  from ..base import BaseARIMA
  from .None import _doc
  from .None import _validation
  from .utils import ndiffs, is_constant, nsdiffs
  from ..utils import diff, is_iterable, check_endog
  from ..utils.metaestimators import if_has_delegate
  from ._context import AbstractContext, ContextType
  from .None import _auto_solvers
  from ..compat.numpy import DTYPE
  from ..compat import statsmodels
label_desc: Use image node_id 2 for calling the AutoARIMA obj's underlying member method code with example usage: obj.fit(y, X) and returns: self