Skip to content

Issue 2: Hardcoded Forecast Step and Lack of Dynamic Test Data Alignment #12

@PrinceSajjadHussain

Description

@PrinceSajjadHussain

Title: Forecast Step and Test Alignment Issues

Body:

  1. Hardcoded Forecast Step: The code hardcodes step = 50 for the forecast length. This limits the flexibility of the script. It's better to make this a configurable parameter, potentially through user input or a command-line argument.
  2. Fixed Alignment: fc_pred.index = test[:step].index makes the forecast index alignment brittle. If len(test) is less than step, this will raise an IndexError. The logic assumes that you always want to forecast the first step days of the test set, which might not be what the user intended.
  3. Implicit Assumption: The assumption that you want to compare the forecast to the beginning of the test set is not explicitly stated. There could be a desire to offset the comparison window.

Recommendation:

  1. Make step a configurable parameter.
  2. Add a check to ensure that len(test) is greater than or equal to step before attempting the index alignment. If it's not, either reduce step or handle the case appropriately (e.g., issue a warning and use the available test data).
  3. Consider allowing the user to specify a start index for the comparison within the test data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions