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

[BUG] performance_metrics/forecasting/_functions.py unrunnable code #2135

Closed
TonyBagnall opened this issue Oct 2, 2024 · 0 comments · Fixed by #2137
Closed

[BUG] performance_metrics/forecasting/_functions.py unrunnable code #2135

TonyBagnall opened this issue Oct 2, 2024 · 0 comments · Fixed by #2137
Assignees
Labels
bug Something isn't working

Comments

@TonyBagnall
Copy link
Contributor

Describe the bug

more legacy nonsense. The functions geometric_mean_absolute_error and geometric_mean_squared_error contain untested code

            np.abs(errors),
            sample_weight=horizon_weight,
            axis=0,
        )

but the actual signature of _weighted_geometric_mean is
def _weighted_geometric_mean(y, weights=None, axis=None): (see #2134)

i.e. the parameter name is wrong! doctests all skipped for some reason.

Steps/Code to reproduce the bug

import numpy as np
from aeon.performance_metrics.forecasting import \
    geometric_mean_squared_error as gmse
y_true = np.array([3, -0.5, 2, 7, 2])
y_pred = np.array([2.5, 0.0, 2, 8, 1.25])
gmse(y_true, y_pred, horizon_weight=[0.5,0.3,0.2, .1,.1])

Expected results

runs

Actual results

C:\Code\aeon\venv\Scripts\python.exe C:\Code\aeon\aeon\local\debug.py 
Traceback (most recent call last):
  File "C:\Code\aeon\aeon\local\debug.py", line 6, in <module>
    gmse(y_true, y_pred, horizon_weight=[0.5,0.3,0.2, .1,.1])
  File "C:\Code\aeon\aeon\performance_metrics\forecasting\_functions.py", line 1427, in geometric_mean_squared_error
    output_errors = _weighted_geometric_mean(
TypeError: _weighted_geometric_mean() got an unexpected keyword argument 'sample_weight'

Versions

No response

@TonyBagnall TonyBagnall added the bug Something isn't working label Oct 2, 2024
@TonyBagnall TonyBagnall self-assigned this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant