-
-
Notifications
You must be signed in to change notification settings - Fork 342
Add-LSTM #247
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
Add-LSTM #247
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 introduces a comprehensive implementation of Long Short-Term Memory (LSTM) neural networks for time series forecasting in R, providing a complete workflow from data preprocessing to prediction visualization.
- Implements LSTM model architecture with configurable parameters for time series prediction
- Provides comprehensive data preprocessing including normalization and sequence generation
- Includes evaluation metrics, visualization capabilities, and multi-step ahead prediction functionality
…l pivot_longer for plotting
|
LSTM script improvements: All changes maintain original functionality; the model workflow and outputs remain the same. |
|
@siriak please have a look |
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
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Co-authored-by: Copilot <[email protected]>
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
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
| # Ensure consistent column names with pivot_longer | ||
| names(plot_data_long) <- c("Index", "variable", "value") | ||
| } else { | ||
| stop("Please install 'tidyr' or 'reshape2' to create the plot (install.packages('tidyr')).") |
Copilot
AI
Oct 24, 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.
The error message references only 'tidyr' in the install command, but the message states both packages are options. Consider clarifying: stop(\"Please install 'tidyr' or 'reshape2' to create the plot: install.packages('tidyr') or install.packages('reshape2')\") to avoid confusion.
| stop("Please install 'tidyr' or 'reshape2' to create the plot (install.packages('tidyr')).") | |
| stop("Please install 'tidyr' or 'reshape2' to create the plot: install.packages('tidyr') or install.packages('reshape2').") |
siriak
left a comment
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.
Looks good, thanks!
PR: LSTM Time Series Forecasting in R
This PR introduces a fully documented implementation of a Long Short-Term Memory (LSTM) neural network in R for time series prediction and forecasting.
The implementation leverages the
kerasandtensorflowpackages to build, train, and evaluate LSTM models capable of learning temporal dependencies in sequential data.Overview
The provided LSTM workflow covers:
Data Preprocessing:
Model Architecture:
Training and Evaluation:
Prediction Capabilities:
ggplot2Best Practices:
This LSTM implementation is suitable for:
Complexity
The approach demonstrates how LSTMs can model sequential dependencies more effectively than traditional regression or moving-average methods.