Skip to content

Commit

Permalink
docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
es94129 committed Oct 9, 2024
1 parent 036a440 commit 25b1f17
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions runtime/databricks/automl_runtime/forecast/deepar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
def set_index_and_fill_missing_time_steps(df: pd.DataFrame, time_col: str,
frequency: str,
id_cols: Optional[List[str]] = None):
"""
Transform the input dataframe to an acceptable format for the GluonTS library.
- Set the time column as the index
- Impute missing time steps between the min and max time steps
:param df: the input dataframe that contains time_col
:param time_col: time column name
:param frequency: the frequency of the time series
:param id_cols: the column names of the identity columns for multi-series time series; None for single series
:return: single-series - transformed dataframe;
multi-series - dictionary of transformed dataframes, each key is the (concatenated) id of the time series
"""
# TODO (ML-46009): Compare with the ARIMA implementation

total_min, total_max = df[time_col].min(), df[time_col].max()
Expand Down

0 comments on commit 25b1f17

Please sign in to comment.