ENH: Implement efficient _evaluate_by_index for RelativeLoss (#4304)#9400
Open
Vbhatt03 wants to merge 1 commit intosktime:mainfrom
Open
ENH: Implement efficient _evaluate_by_index for RelativeLoss (#4304)#9400Vbhatt03 wants to merge 1 commit intosktime:mainfrom
Vbhatt03 wants to merge 1 commit intosktime:mainfrom
Conversation
…4304) - Add direct point-wise evaluation instead of jackknife pseudo-sampling - Respects multioutput parameter for proper variable aggregation - Handles y_pred_benchmark correctly - All 224 tests passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Fixes #4304
What does this implement/fix? Explain your changes.
This PR implements the efficient
_evaluate_by_indexmethod for theRelativeLossforecast performance metric, replacing the computationally expensive jackknife pseudo-sampling approach with direct point-wise evaluation.Changes:
Added
_evaluate_by_indexmethod toRelativeLossclass that:y_pred_benchmarkparameter is providedmultioutput="raw_values"for point-wise evaluationloss_pred / max(loss_benchmark, EPS)where EPS prevents division by zeromultioutputparameterAdded necessary imports:
numpyfor array operationsEPSconstant fromsktime.performance_metrics.forecasting._functionsKey improvements:
Does your contribution introduce a new dependency?
No new dependencies. Uses only existing imports:
numpyandEPSfrom internal functions module.What should a reviewer concentrate their feedback on?
multioutputparameter and variable aggregationy_pred_benchmarkis required and handled appropriatelyMeanAbsoluteScaledError)Did you add any tests for the change?
The implementation uses existing test infrastructure passed by
RelativeLoss. All 224 performance metrics tests pass successfully, validating:_evaluate_by_indeximplementationy_pred_benchmark_evaluatemethodPR checklist