You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your work on this package. I'm running into an issue with the created Date features when setting fiscal_year_start to a value other than 1. For example, when using afiscal_year_start value of 11 below, I would expect the Date_half and Date_quarter values to be 1 for November. For Date_month it could be either 11 or 1 (understandable either way), but for Date_month.lbl it should be "November". Note that October & November (identified in the Date column) should be in different quarters here (Q4 & Q1 respectively). However, they're both in Q3.
library(tidyverse)
library(finnts)
#> Loading required package: modeltimedf<- tibble(
Date= seq.Date(from= ymd("2020-11-01"), to= ymd("2023-10-01"), by="month"),
y= rnorm(36, 100, 5),
x= rnorm(36, 100, 5),
id="y"
)
run_info<- set_run_info(
experiment_name="Run 1",
run_name="Date Extraction Check"
)
#> Finn Submission Info#> • Experiment Name: Run 1#> • Run Name: Date Extraction Check-20240404T110928Z#>
prep_data(
run_info=run_info,
input_data=df,
combo_variables="id",
target_variable="y",
date_type="month",
forecast_horizon=1,
external_regressors="x",
hist_start_date= min(df$Date),
hist_end_date= max(df$Date),
fiscal_year_start=11
)
#> ℹ Prepping Data#> ✔ Prepping Data [1.8s]#> df_r1_fiscal_11<- get_prepped_data(run_info=run_info, recipe="R1") |>
select(Date, Date_year, Date_half, Date_quarter, Date_month, Date_month.lbl)
df_r1_fiscal_11#> # A tibble: 37 × 6#> Date Date_year Date_half Date_quarter Date_month Date_month.lbl#> <date> <dbl> <dbl> <dbl> <dbl> <chr> #> 1 2020-11-01 2021 2 3 9 September #> 2 2020-12-01 2021 2 4 10 October #> 3 2021-01-01 2021 2 4 11 November #> 4 2021-02-01 2021 2 4 12 December #> 5 2021-03-01 2022 1 1 1 January #> 6 2021-04-01 2022 1 1 2 February #> 7 2021-05-01 2022 1 1 3 March #> 8 2021-06-01 2022 1 2 4 April #> 9 2021-07-01 2022 1 2 5 May #> 10 2021-08-01 2022 1 2 6 June #> # ℹ 27 more rowsdf_r2_fiscal_11<- get_prepped_data(run_info=run_info, recipe="R2") |>
select(Date, Date_year, Date_half, Date_quarter, Date_month, Date_month.lbl)
df_r2_fiscal_11#> # A tibble: 37 × 6#> Date Date_year Date_half Date_quarter Date_month Date_month.lbl#> <date> <dbl> <dbl> <dbl> <dbl> <chr> #> 1 2020-11-01 2021 2 3 9 September #> 2 2020-12-01 2021 2 4 10 October #> 3 2021-01-01 2021 2 4 11 November #> 4 2021-02-01 2021 2 4 12 December #> 5 2021-03-01 2022 1 1 1 January #> 6 2021-04-01 2022 1 1 2 February #> 7 2021-05-01 2022 1 1 3 March #> 8 2021-06-01 2022 1 2 4 April #> 9 2021-07-01 2022 1 2 5 May #> 10 2021-08-01 2022 1 2 6 June #> # ℹ 27 more rows
I would need to change the fiscal_year_start value to 3 to correct my Date_half and Date_quarter values to what is needed when my fiscal_year_start is actually November. Now Date_half and Date_quarter values are 1 for November, December, and January which is correct when the fiscal year starts in November. However, the Date_month.lbl is "January" which is still incorrect:
run_info<- set_run_info(
experiment_name="Run 1",
run_name="Date Extraction Check"
)
#> Finn Submission Info#> • Experiment Name: Run 1#> • Run Name: Date Extraction Check-20240404T110930Z#>
prep_data(
run_info=run_info,
input_data=df,
combo_variables="id",
target_variable="y",
date_type="month",
forecast_horizon=1,
external_regressors="x",
hist_start_date= min(df$Date),
hist_end_date= max(df$Date),
fiscal_year_start=3
)
#> ℹ Prepping Data#> ✔ Prepping Data [793ms]#> df_r1_fiscal_3<- get_prepped_data(run_info=run_info, recipe="R1") |>
select(Date, Date_year, Date_half, Date_quarter, Date_month, Date_month.lbl)
df_r1_fiscal_3#> # A tibble: 37 × 6#> Date Date_year Date_half Date_quarter Date_month Date_month.lbl#> <date> <dbl> <dbl> <dbl> <dbl> <chr> #> 1 2020-11-01 2021 1 1 1 January #> 2 2020-12-01 2021 1 1 2 February #> 3 2021-01-01 2021 1 1 3 March #> 4 2021-02-01 2021 1 2 4 April #> 5 2021-03-01 2021 1 2 5 May #> 6 2021-04-01 2021 1 2 6 June #> 7 2021-05-01 2021 2 3 7 July #> 8 2021-06-01 2021 2 3 8 August #> 9 2021-07-01 2021 2 3 9 September #> 10 2021-08-01 2021 2 4 10 October #> # ℹ 27 more rowsdf_r2_fiscal_3<- get_prepped_data(run_info=run_info, recipe="R2") |>
select(Date, Date_year, Date_half, Date_quarter, Date_month, Date_month.lbl)
df_r2_fiscal_3#> # A tibble: 37 × 6#> Date Date_year Date_half Date_quarter Date_month Date_month.lbl#> <date> <dbl> <dbl> <dbl> <dbl> <chr> #> 1 2020-11-01 2021 1 1 1 January #> 2 2020-12-01 2021 1 1 2 February #> 3 2021-01-01 2021 1 1 3 March #> 4 2021-02-01 2021 1 2 4 April #> 5 2021-03-01 2021 1 2 5 May #> 6 2021-04-01 2021 1 2 6 June #> 7 2021-05-01 2021 2 3 7 July #> 8 2021-06-01 2021 2 3 8 August #> 9 2021-07-01 2021 2 3 9 September #> 10 2021-08-01 2021 2 4 10 October #> # ℹ 27 more rowsCreatedon2024-04-04with [reprexv2.1.0](https://reprex.tidyverse.org/)
Hi,
Thank you for your work on this package. I'm running into an issue with the created Date features when setting
fiscal_year_start
to a value other than 1. For example, when using afiscal_year_start
value of 11 below, I would expect theDate_half
andDate_quarter
values to be 1 for November. ForDate_month
it could be either 11 or 1 (understandable either way), but forDate_month.lbl
it should be "November". Note that October & November (identified in the Date column) should be in different quarters here (Q4 & Q1 respectively). However, they're both in Q3.I would need to change the
fiscal_year_start
value to 3 to correct myDate_half
andDate_quarter
values to what is needed when myfiscal_year_start
is actually November. NowDate_half
andDate_quarter
values are 1 for November, December, and January which is correct when the fiscal year starts in November. However, theDate_month.lbl
is "January" which is still incorrect:Session Info
The text was updated successfully, but these errors were encountered: