From 397693a57232348dfcde0c1b28e19011bbc7de02 Mon Sep 17 00:00:00 2001 From: Rajat Sen Date: Mon, 3 Jun 2024 18:15:11 +0000 Subject: [PATCH] adding headers to some files. --- experiments/baselines/__init__.py | 13 +++++++++++++ experiments/baselines/timegpt_pipeline.py | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/experiments/baselines/__init__.py b/experiments/baselines/__init__.py index e69de29..2d9f7b3 100644 --- a/experiments/baselines/__init__.py +++ b/experiments/baselines/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. \ No newline at end of file diff --git a/experiments/baselines/timegpt_pipeline.py b/experiments/baselines/timegpt_pipeline.py index c4ab40e..c5a38f5 100644 --- a/experiments/baselines/timegpt_pipeline.py +++ b/experiments/baselines/timegpt_pipeline.py @@ -1,3 +1,17 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Optional, Tuple import os import pandas as pd @@ -226,6 +240,9 @@ def run_timegpt( df=padded_train_df, h=horizon, level=level, freq=freq, chunk_size=chunk_size ) total_time = time() - init_time + # In case levels are not returned we replace the levels with the mean predictions. + # Note that this does not affect the results table as we only compare on point + # forecastign metrics. for lvl in level: if f"{model.alias}-lo-{lvl}" not in fcsts_df.columns: fcsts_df[f"{model.alias}-lo-{lvl}"] = fcsts_df[model.alias]