This Jupyter Notebook implements a Recurrent Neural Network (RNN) model to predict maximum temperatures for the subsequent day in Seattle, Washington, USA, based on historical weather data spanning from 2012 to 2015. The project aims to demonstrate the effectiveness of machine learning, particularly RNNs, in weather forecasting tasks.
The dataset used in this notebook contains daily meteorological observations, including variables such as date, precipitation, maximum and minimum temperatures, wind speed, and weather type. The dataset provides a comprehensive overview of climatic trends and variations in Seattle over the specified four-year period.
-
Data Preprocessing:
- Adding a target variable column representing the maximum temperature forecasted for the following day.
- Normalizing the data and splitting it into training and testing subsets.
- Feature selection and extraction.
-
Model Implementation:
- Configuring the RNN architecture with input, hidden, and output layers.
- Utilizing the tanh activation function for hidden state computation.
- Training the model and evaluating its performance using various metrics.
-
Results and Discussion:
- Analysis of performance metrics including Mean Squared Error (MSE), Mean Absolute Error (MAE), R-squared Fit, and Loss.
- Visualization of model predictions against actual values.
The notebook demonstrates the capability of RNNs in accurately forecasting maximum temperatures, showcasing their relevance in weather prediction tasks for informed decision-making across various sectors.
- Python 3
- Jupyter Notebook
- Libraries: pandas, numpy, scikit-learn, matplotlib, seaborn
- Ensure Python 3 is installed on your system.
- Install Jupyter Notebook using
pip install jupyter. - Install required libraries using
pip install pandas numpy scikit-learn matplotlib seaborn. - Download the dataset and the notebook file.
- Open the notebook in Jupyter Notebook and execute each cell sequentially to reproduce the results.