pmdarima.utils.check_endog

pmdarima.utils.check_endog(y, dtype=<class 'numpy.float64'>, copy=True, force_all_finite=False, preserve_series=True)[source][source]

Wrapper for check_array and column_or_1d from sklearn

Parameters:

y : array-like, shape=(n_samples,)

The 1d endogenous array.

dtype : string, type or None (default=np.float64)

Data type of result. If None, the dtype of the input is preserved. If “numeric”, dtype is preserved unless array.dtype is object.

copy : bool, optional (default=False)

Whether a forced copy will be triggered. If copy=False, a copy might still be triggered by a conversion.

force_all_finite : bool, optional (default=False)

Whether to raise an error on np.inf and np.nan in an array. The possibilities are:

  • True: Force all values of array to be finite.
  • False: accept both np.inf and np.nan in array.

preserve_series : bool, optional

Whether to preserve a pd.Series object. Will also attempt to squeeze a dataframe into a pd.Series.

Returns:

y : np.ndarray or pd.Series, shape=(n_samples,)

A 1d numpy ndarray