Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Adaptation and Asynchronous Prediction Combination #3003

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Sn0w3y
Copy link
Contributor

@Sn0w3y Sn0w3y commented Feb 5, 2025

Summary

This PR addresses the remaining TODO items by integrating the adaptation logic and properly combining asynchronous predictions. The changes include:

  • LstmTrain:

    • Integrated the model adaptation step by calling ReadAndSaveModels.adapt() before training.
    • Ensured training and validation data are preprocessed (removing negatives and applying constant scaling) consistently.
  • PredictorLstmImpl:

    • Combined asynchronous prediction futures using CompletableFuture.allOf() to ensure that all required predictions complete before combining results.
    • Added exception handling around the asynchronous calls to wrap any errors in a RuntimeException with a clear message.

Changes

  • LstmTrain.java

    • Adaptation step added:
      ReadAndSaveModels.adapt(hyperParameters, constantScaling(removeNegatives(validationData), 1), validationDate);
    • Preprocessed training and validation data are now consistently passed to the training batch.
  • PredictorLstmImpl.java

    • Asynchronous prediction futures for trend and seasonality are now combined:
      CompletableFuture.allOf(seasonalityFuture, trendFuture, dayPlus1SeasonalityFuture).join();
    • The predictions are retrieved and combined, with added exception handling:
      try {
          // ... [prediction combination logic]
      } catch (Exception e) {
          throw new RuntimeException("Error in getting prediction execution", e);
      }

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3003      +/-   ##
=============================================
- Coverage      57.01%   56.99%   -0.02%     
+ Complexity      9834     9829       -5     
=============================================
  Files           2280     2280              
  Lines          97642    97642              
  Branches        7082     7082              
=============================================
- Hits           55661    55641      -20     
- Misses         39923    39942      +19     
- Partials        2058     2059       +1     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant