This repository contains code and models for weather forecasting using TBATS (Trigonometric seasonality, Box-Cox transformation, ARMA errors, Trend, and Seasonal components) models. TBATS models are particularly effective for time series forecasting with complex seasonal patterns.
The dataset used in this project can be downloaded from Kaggle. It comprises daily weather data with 12,784 entries, spanning from January 2, 1980, to January 1, 2015.
Two TBATS models were trained for this project:
- Mean Squared Error: 1.8585
- Mean Absolute Error: 1.0448
- Root Mean Squared Error: 1.3632
- Mean Squared Error: 1.8529
- Mean Absolute Error: 1.0437
- Root Mean Squared Error: 1.3632
These metrics indicate the accuracy achieved by each model in forecasting the weather based on the dataset.
The repository includes a Jupyter notebook TBATS.ipynb
that contains the complete pipeline for data preprocessing, model training (TBATS), evaluation, and forecast analysis for the next 15 years.
-
Data Preprocessing: Steps for cleaning, transforming, and preparing the dataset.
-
Model Training: Implementation of TBATS models for both yearly and yearly-monthly seasonality.
-
Evaluation: Assessing model performance using various metrics and visualizing forecast results against actual data.
-
Forecast and Analysis: Generating forecasts for the next 15 years based on trained models and analyzing the predictions.
To get started with using the code and models in this repository, follow these steps:
-
Clone the repository:
git clone https://github.com/ahmedshahwar/weather-forecast.git cd weather-forecast
-
Install dependencies: Ensure you have Python 3.x installed along with necessary libraries like
numpy
,pandas
,tbats
,matplotlib
,scikit-lean
, andpickle
. -
Run the
TBATS.ipynb
notebook:- Use this notebook to replicate the preprocessing, model training, evaluation, and forecasting steps on your dataset.
-
Explore and analyze results:
- Modify the notebook as needed to fit your specific forecasting requirements and data characteristics.