tsai icon indicating copy to clipboard operation
tsai copied to clipboard

bug in forecasting splits indices computation

Open lo-zed opened this issue 1 year ago • 1 comments

When function get_forecasting_splits is used with the argument unique_id_cols, the computation for the split indices is wrong. The function only substracts fcst_history - 1 from the data frame indices, which is incorrect since this can accumulate when several ids are present.

See the attached code for a minimal example and a proposition on how to solve it.

bug_report_indices.txt

Edit: changed the zip file to a txt file

lo-zed avatar May 30 '23 13:05 lo-zed

line 87 of my file 'bug_report_indices.txt' I forgot to add [0] at the end. The line should read

            valid_idxs = np.where((usable_step_codes >= valid_start))[0]  # CORRECTED

lo-zed avatar May 31 '23 08:05 lo-zed