Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hayatiyrtgl/cryptocurrency_time_series_rnn
Python script for training a Simple RNN model on cryptocurrency price data to predict future prices, including data exploration and evaluation
https://github.com/hayatiyrtgl/cryptocurrency_time_series_rnn
data-analysis data-science data-visualization keras pandas pandas-python prediction predictive-modeling python python-script rnn rnn-tensorflow tensorflow time-series time-series-analysis
Last synced: 3 days ago
JSON representation
Python script for training a Simple RNN model on cryptocurrency price data to predict future prices, including data exploration and evaluation
- Host: GitHub
- URL: https://github.com/hayatiyrtgl/cryptocurrency_time_series_rnn
- Owner: HayatiYrtgl
- License: mit
- Created: 2024-04-25T07:51:03.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-25T07:52:13.000Z (7 months ago)
- Last Synced: 2024-04-25T08:46:53.246Z (7 months ago)
- Topics: data-analysis, data-science, data-visualization, keras, pandas, pandas-python, prediction, predictive-modeling, python, python-script, rnn, rnn-tensorflow, tensorflow, time-series, time-series-analysis
- Language: Jupyter Notebook
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This code is a Python script for building and training a Simple Recurrent Neural Network (RNN) using Keras to predict cryptocurrency prices. Here's a breakdown of what each section does:
1. **Importing Libraries**: This section imports necessary libraries such as pandas, numpy, scikit-learn, keras, and matplotlib.
2. **Reading Data**: Reads cryptocurrency price data from a CSV file.
3. **Data Exploration**:
- Checks for missing values.
- Displays data types and descriptive statistics.
- Visualizes data using scatter plots and a heatmap of correlations between features.4. **Data Preprocessing**:
- Converts the timestamp column to datetime format.
- Sets the timestamp column as the index.5. **Train-Test Split**:
- Manually splits the data into training and testing sets.
- Defines a function `train_test_split` to create input-output pairs for training the model.6. **Creating the RNN Model**:
- Uses Keras Sequential API to define an RNN model.
- The model consists of an Input layer, a SimpleRNN layer with 60 units and 'tanh' activation function, and a Dense output layer.
- Compiles the model using mean squared error loss and Adam optimizer, with R2Score as a metric.7. **Training the Model**:
- Fits the model to the training data with early stopping and model checkpointing callbacks.
- Validates the model on a validation split of the training data.8. **Evaluation**:
- Predicts cryptocurrency prices using the trained model.
- Plots the predicted prices against the true prices for evaluation.Overall, this script demonstrates a basic workflow for building and training a recurrent neural network for cryptocurrency price prediction using historical data.