-
Notifications
You must be signed in to change notification settings - Fork 1
Use auto-arima to forecast live data #93
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements timeseries forecasting using auto_arima and integrates corresponding API and graphical changes.
- Adds a new GET_FORECAST_DATA route in frontend constants.
- Updates the graph component to fetch and display forecast data with adjusted time bounds and styling.
- Implements a new backend forecast endpoint and registers it with the component router.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Frontend/src/Components/Shared/misc-constants.js | Added GET_FORECAST_DATA route to support forecast API calls. |
| Frontend/src/Components/Graph/CustomGraph.js | Updated graph options and added forecast data fetching and display functionality. |
| Backend/core/comms.py | Modified unpack_data to replace inf values with -10000. |
| Backend/components/forecast.py | Added forecast endpoint using auto_arima for predictions. |
| Backend/components/component_router.py | Included the newly created forecast router. |
Comments suppressed due to low confidence (1)
Frontend/src/Components/Graph/CustomGraph.js:129
- The substring '_forcast' appears to be a misspelling. Consider standardizing this to '_forecast' to maintain consistency with the API route and backend naming.
if (item.dataset.key.indexOf("_forcast") !== -1) {
| }); | ||
| } | ||
| }, 10000); | ||
| console.log(forcastData); |
Copilot
AI
Jun 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or replace the console.log statement used for debugging to avoid unnecessary logging in production code.
| console.log(forcastData); | |
| // Removed unnecessary console.log statement for production. |
| # if the data is -inf or inf, we set it to -10000 | ||
| if fields[properties[i]] == float('inf') or fields[properties[i]] == float('-inf'): | ||
| fields[properties[i]] = -10000 |
Copilot
AI
Jun 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using a hardcoded value (-10000) to replace infinity may be confusing. Consider adding a comment or refactoring this logic into a named constant to clarify its purpose and allow for easier adjustments in the future.
| # if the data is -inf or inf, we set it to -10000 | |
| if fields[properties[i]] == float('inf') or fields[properties[i]] == float('-inf'): | |
| fields[properties[i]] = -10000 | |
| # if the data is -inf or inf, we replace it with REPLACEMENT_FOR_INFINITY | |
| if fields[properties[i]] == float('inf') or fields[properties[i]] == float('-inf'): | |
| fields[properties[i]] = REPLACEMENT_FOR_INFINITY |
Implements API and corresponding graph changes for timeseries forecasting using auto arima, model still needs further tuning.