Skip to content

Instantly share code, notes, and snippets.

@rjattrill
Created December 23, 2022 04:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rjattrill/74d2aee51f02ab98dc7a8aa461699f32 to your computer and use it in GitHub Desktop.
Save rjattrill/74d2aee51f02ab98dc7a8aa461699f32 to your computer and use it in GitHub Desktop.
Issue with excluded_model_types with AutoGluon
import pandas as pd
from autogluon.timeseries import TimeSeriesPredictor, TimeSeriesDataFrame
# Load the data into a TimeSeriesDataFrame
df = pd.read_csv(
"m4_hourly.csv",
parse_dates=["Date"],
)
ts_dataframe = TimeSeriesDataFrame.from_data_frame(
df,
id_column="M4id", # name of the column with unique ID of each time series
timestamp_column="Date", # name of the column with timestamps of observations
)
# Create & fit the predictor
predictor = TimeSeriesPredictor(
path="autogluon-m4-hourly", # models will be saved in this folder
target="Value", # name of the column with time series values
prediction_length=48, # number of steps into the future to predict
eval_metric="MAPE", # other options: "MASE", "sMAPE", "mean_wQuantileLoss", "MSE", "RMSE"
).fit(
train_data=ts_dataframe,
presets="fast_training", # other options: "fast_training", "high_quality", "best_quality"
time_limit=30, # training time in seconds
excluded_model_types=["ETS"]
)
# Generate the forecasts
predictions = predictor.predict(ts_dataframe)
out = predictions.head
print(out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment