Skip to content

TSDatasets.__init__ regressors logic #327

Closed
1 task done
julia-shenshina opened this issue Nov 29, 2021 · 0 comments · Fixed by #357
Closed
1 task done

TSDatasets.__init__ regressors logic #327

julia-shenshina opened this issue Nov 29, 2021 · 0 comments · Fixed by #357
Assignees
Labels
enhancement New feature or request

Comments

@julia-shenshina
Copy link
Contributor

julia-shenshina commented Nov 29, 2021

🚀 Feature Request

Now TSDataset handles regressors/exogs according to theirs column name prefixes. In this issue we want to fix it: now user should add info about regressor nature of data in df_exog.

Motivation

New way of work with regressors.

Proposal

  • Add TSDataset.__init__ argument known_future:
def __init__(self, df: pd.DataFrame, freq: str, df_exog: Optional[pd.DataFrame] = None, known_future: Optional[List[str]] = None):
        """Init TSDataset.
        Parameters
        ----------
        df:
            dataframe with timeseries
        freq:
            frequency of timestamp in df
        df_exog:
            dataframe with exogenous data;
            if the series is known in the future features' names should start with prefix 'regressor_`.
        known_future: 
            series from columns in df_exog[known_future] are regressors; if None given,  all the given in df_exog series are not regressors
        """
  • Replace _update_regressors in __init__ with new logic:
    • now only columns in known_future should be added to self._regressors
  • Change logic in _check_regressors:
    • now we don't have any prefixes and work only with columns in self._regressor

Test cases

Update existing cases with new logic

Alternatives

No response

Additional context

No response

Checklist

  • I discussed this issue with ETNA Team
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants