A comprehensive deep learning project that leverages Long Short-Term Memory (LSTM) neural networks to forecast cryptocurrency prices. This project focuses on building, training, and evaluating an LSTM model to predict price trends, utilizing historical data and time-series analysis techniques. Ideal for those interested in financial forecasting, machine learning, and time-series prediction models.
- Project Overview
- Dataset
- Project Structure
- Installation
- Usage
- Results
- Limitations and Future Work
- Contributing
- License
This project aims to accurately predict cryptocurrency prices using historical data and deep learning models, specifically LSTM networks known for their effectiveness with time-series data. By leveraging historical data and adjusting hyperparameters, this model predicts trends that could be useful for financial analysis and strategic planning.
The data for this project includes historical closing prices of cryptocurrencies (e.g., Bitcoin, Ethereum). You can download this dataset from financial data sources such as:
The dataset should be saved as crypto_prices.csv
with at least a Date
and Close
column.
├── data/
│ └── crypto_prices.csv # Historical price data for cryptocurrencies
├── src/
│ ├── data_preprocessing.py # Data loading and preprocessing scripts
│ ├── model_training.py # Model creation, training, and evaluation
│ ├── predictions.py # Prediction scripts
│ └── visualization.py # Visualization of results
├── README.md # Project README file
└── CRYPTO_CURRENCY_FORECASTING_USING_LSTM.ipynb # Project notebook
Clone this repository and install the required dependencies.
git clone https://github.com/your-username/crypto-price-forecasting-lstm.git
cd crypto-price-forecasting-lstm
pip install -r requirements.txt
- Data Preprocessing: Run
data_preprocessing.py
to load and scale your data. - Model Training: Use
model_training.py
to set up and train the LSTM model. - Predictions: Use
predictions.py
to generate predictions based on the trained model. - Visualization: Execute
visualization.py
or view the plots in the notebook to visualize predictions.
You can also run the project directly by executing the Jupyter Notebook CRYPTO_CURRENCY_FORECASTING_USING_LSTM.ipynb
for a structured approach to data preprocessing, model training, and visualization.
The model's performance was evaluated using Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE). The results were as follows:
- Root Mean Squared Error (RMSE): 1751.87
- Mean Absolute Error (MAE): 1368.44
These metrics indicate that the model can closely approximate cryptocurrency price trends but still has some error, reflecting the inherent volatility of crypto markets. Below is an example plot comparing actual and predicted prices.
Although this model achieves a reasonable level of accuracy, certain limitations exist:
- Data Volatility: Cryptocurrency prices are highly volatile, which may affect prediction accuracy.
- Data Availability: Limited historical data can impact the LSTM model's ability to learn patterns.
Future work may include:
- Experimenting with ensemble models or attention mechanisms
- Integrating external factors like trading volume and market sentiment
- Testing additional architectures, such as GRUs or Transformer models
Feel free to submit pull requests to improve the model, add more features, or enhance documentation. Please follow the Contributor Guidelines.