This project predicts future Bitcoin (BTC) prices using a Long Short-Term Memory (LSTM) neural network. The model is trained on historical BTC price data fetched from the CoinGecko API. It can predict BTC prices for the next 10 days (hourly predictions).
- Fetch BTC Data: Historical BTC prices are fetched from the CoinGecko API.
- Preprocess Data: The data is normalized and split into training and testing sets.
- Build and Train Model: An LSTM model is trained on the preprocessed data.
- Predict Future Prices: The model predicts future BTC prices for the next 10 days.
- Visualization: The historical, validation, and predicted future prices are plotted for visualization.
- Python 3.6+
- TensorFlow 2.x
- Pandas
- NumPy
- scikit-learn
- Matplotlib
- Requests
- Clone this repository:
git clone https://github.com/tanvirhasan2019/crypto-price-prediction.git cd btc-price-prediction
- Install the required packages:
pip install -r requirements.txt
- Run the Script:
python btc_price_prediction.py
- View the Output: The script will fetch the latest BTC data, train the LSTM model, and display the historical and predicted prices in a plot.
Here's an example of the prediction output generated by the model:
├── crypto_price_prediction.py # Main script for training and predicting BTC prices
├── crypto_price_prediction.ipynb # Main script for training and predicting BTC prices
├── README.md # Project documentation
├── requirements.txt # List of required Python packages
└── sample_output.png # Example output image