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

feature: improve price forecast #349

Merged
merged 17 commits into from
Jan 9, 2025
Merged

Conversation

NormannK
Copy link
Collaborator

@NormannK NormannK commented Jan 6, 2025

Modifying elecpriceakkudoktor.py so it can hold up to 5 weeks of data.
Depending on the amount of data we will run different forecasts.
predictions_vs_true_ets_130
metrics_over_iterations_ets_cap_48
With 5 weeks we will use ets.

Copy link
Collaborator

@b0661 b0661 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Some things can be done easier. Data records are always sorted by date unless you directly access self.records - so please never do.

src/akkudoktoreos/prediction/elecpriceakkudoktor.py Outdated Show resolved Hide resolved
price_weighted_mean = np.ma.average(prices_of_hour_masked, weights=weights)

return float(price_weighted_mean)

@cache_in_file(with_ttl="1 hour")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe caching can be done for a longer time as data is only updated once a day.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the api data is only updating once a day. problem is when we set the caching to long, we can ignore that update for some time.
worst case would be updatetime+cachetime.
1h would be on the save side.
id we would know when the api update is done we could check for the current time and cache 1day

src/akkudoktoreos/prediction/elecpriceakkudoktor.py Outdated Show resolved Hide resolved
src/akkudoktoreos/prediction/elecpriceakkudoktor.py Outdated Show resolved Hide resolved
src/akkudoktoreos/prediction/elecpriceakkudoktor.py Outdated Show resolved Hide resolved
src/akkudoktoreos/prediction/elecpriceakkudoktor.py Outdated Show resolved Hide resolved
src/akkudoktoreos/prediction/elecpriceakkudoktor.py Outdated Show resolved Hide resolved
@NormannK NormannK marked this pull request as ready for review January 8, 2025 18:10
# return history, history2, prediction # for debug main


"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you make this a comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unable to make it run bc of mypy if i keep it in.

Copy link
Collaborator

@b0661 b0661 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is good. Just the test must be updated to reflect the new logic.

@drbacke drbacke merged commit 05a1ade into feature/config-overhaul Jan 9, 2025
2 checks passed
@NormannK NormannK deleted the ElecPrice_forecast branch January 9, 2025 15:31
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.

3 participants