Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confidence Interval Define Inside MultiSeriesArimaModel.predict_timeseries #144

Open
Boskicl opened this issue Mar 8, 2024 · 1 comment

Comments

@Boskicl
Copy link

Boskicl commented Mar 8, 2024

Inside:
class MultiSeriesArimaModel(AbstractArimaModel):

There is:

    def predict_timeseries(
        self,
        horizon: int = None,
        include_history: bool = True,
        df: Optional[pd.DataFrame] = None) -> pd.DataFrame:
        """
        Predict target column for given horizon_timedelta and history data.
        :param horizon: Int number of periods to forecast forward.
        :param include_history: Boolean to include the historical dates in the data
            frame for predictions.
        :param df: A pd.Dataframe containing regressors (exogenous variables), if they were used to train the model.
        :return: A pd.DataFrame with the forecast components.
        """
        horizon = horizon or self._horizon
        ids = self._pickled_models.keys()
        preds_dfs = list(map(lambda id_: self._predict_timeseries_single_id(id_, horizon, include_history, df), ids))
        return pd.concat(preds_dfs).reset_index(drop=True)

Which calls:
self._predict_timeseries_single_id()

Then calls the original class:
ArimaModel()

Which has multiple function calls and eventually:

def _forecast(
    self,
    horizon: int = None,
    X: pd.DataFrame = None) -> pd.DataFrame:
    horizon = horizon or self._horizon
    preds, conf = self.model().predict(
        horizon,
        X=X,
        return_conf_int=True)
    ds_indices = self._get_ds_indices(start_ds=self._end_ds, periods=horizon + 1, frequency=self._frequency)[1:]
    preds_pd = pd.DataFrame({'ds': ds_indices, 'yhat': preds})
    preds_pd[["yhat_lower", "yhat_upper"]] = conf
    return preds_pd

How can I input my own customer Confidence interval? Essentially the conf for the forecast? Why does calling,
MultiSeriesArimaModel.predict_timeseries()
Not have a confidence input? Why can't I input 90%? or 70%?

@Boskicl Boskicl changed the title Confidence Interval Define Confidence Interval Define Inside MultiSeriesArimaModel.predict_timeseries Mar 8, 2024
@Boskicl
Copy link
Author

Boskicl commented Mar 8, 2024

All of this is inside model.py at path:
automl/blob/main/runtime/databricks/automl_runtime/forecast/pmdarima/model.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant