This project utilizes a Recurrent Neural Network (RNN) with Long Short-Term Memory (LSTM) to predict future maximum temperatures based on historical weather data from Seattle. The project includes data preprocessing, model training, hyperparameter optimization, and visualization of predictions.
.
βββ Dataset.py # Data loading and preprocessing
βββ Model_RNN.py # RNN model construction
βββ Optimize.py # Hyperparameter optimization with Keras Tuner
βββ Train.py # Model training script
βββ Test.py # Model evaluation
βββ Visualisation.py # Visualization and image saving
βββ Logger.py # Custom logger with detailed and humorous logs
βββ Main.py # Main script to run the project
βββ requirements.txt # Python dependencies
βββ plots/ # Folder to save generated prediction plots
βββ app.log # Log file capturing all project logs
# Clone the repository
git clone https://github.com/your-repo/rnn-weather-prediction.git
cd rnn-weather-prediction
# Create a virtual environment
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate
# Install dependencies
pip install -r requirements.txt
python Main.py
- Logs will be recorded in
app.log
. - Prediction plots will be saved automatically in the
plots
directory.
rnn_weather_prediction.png
: Displays the predicted vs actual maximum temperatures.app.log
: Contains detailed logs including training progress, hyperparameter tuning, and potential errors.
pandas==1.5.3
numpy==1.24.3
scikit-learn==1.2.2
tensorflow==2.12.0
matplotlib==3.7.1
keras-tuner==1.3.5
The project uses Keras Tuner to find the best hyperparameters for the RNN model, including:
- LSTM units: Between 32 and 128
- Learning rate: Choices of 0.01, 0.001, and 0.0001
π INFO: Starting the application for RNN weather prediction π¦οΈ.
π DEBUG: Successfully loaded dataset! Size: (1461, 6).
π¨ ERROR: File not found: /mnt/data/seattle-weather.csv
π― INFO: Model training completed! Ready to predict the future.
If you encounter any issues, please open an issue or contact me directly.
π‘ Tip: Always activate your virtual environment before running the project!