Skip to content

Commit

Permalink
Merge pull request #153 from microsoft/mitokic/01272024/hts-drivers
Browse files Browse the repository at this point in the history
Mitokic/01272024/hts drivers
  • Loading branch information
mitokic authored Mar 5, 2024
2 parents df32abe + 840dd10 commit 095570f
Show file tree
Hide file tree
Showing 8 changed files with 470 additions and 52 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: finnts
Title: Microsoft Finance Time Series Forecasting Framework
Version: 0.4.0.9000
Version: 0.4.0.9001
Authors@R:
c(person(given = "Mike",
family = "Tokic",
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# finnts 0.4.0.9000 (DEVELOPMENT VERSION)
# finnts 0.4.0.9001 (DEVELOPMENT VERSION)

## Improvements

- Added support for hierarchical forecasting with external regressors

## Bug Fixes

Expand Down
8 changes: 4 additions & 4 deletions R/forecast_time_series.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,19 @@ forecast_backwards_compatibility <- function(run_info,
dplyr::collect() %>%
tidyr::unite(
col = "Combo",
combo_variables,
tidyselect::all_of(combo_variables),
sep = "---",
remove = FALSE
) %>%
dplyr::rename(Target = target_variable) %>%
dplyr::rename(Target = tidyselect::all_of(target_variable)) %>%
dplyr::mutate(
Model_ID = NA,
lo_95 = Target,
lo_80 = Target,
hi_80 = Target,
hi_95 = Target
) %>%
dplyr::select(Combo, combo_variables, Model_ID, Date, Target, lo_95, lo_80, hi_80, hi_95)
dplyr::select(Combo, tidyselect::all_of(combo_variables), Model_ID, Date, Target, lo_95, lo_80, hi_80, hi_95)
) %>%
dplyr::mutate(Type = ifelse(is.na(Model_ID), "Historical", "Forecast")) %>%
dplyr::relocate(Type, .before = Date) %>%
Expand All @@ -298,7 +298,7 @@ forecast_backwards_compatibility <- function(run_info,
dplyr::filter(Run_Type == "Back_Test") %>%
dplyr::mutate(MAPE = abs((Forecast - Target) / Target)) %>%
dplyr::select(
Combo, combo_variables, Train_Test_ID, Date, Model_ID, Horizon,
Combo, tidyselect::all_of(combo_variables), Train_Test_ID, Date, Model_ID, Horizon,
Forecast, Target, MAPE, Best_Model
) %>%
dplyr::rename(
Expand Down
Loading

0 comments on commit 095570f

Please sign in to comment.