https://github.com/laura-projects-work/weather-forecasting
Weather forecasting using time series data in R.
https://github.com/laura-projects-work/weather-forecasting
machine-learning python r time-series-forecasting weather-forecasting
Last synced: 8 months ago
JSON representation
Weather forecasting using time series data in R.
- Host: GitHub
- URL: https://github.com/laura-projects-work/weather-forecasting
- Owner: laura-projects-work
- Created: 2025-02-10T14:30:55.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-03-01T17:38:36.000Z (8 months ago)
- Last Synced: 2025-03-01T18:32:55.654Z (8 months ago)
- Topics: machine-learning, python, r, time-series-forecasting, weather-forecasting
- Language: R
- Homepage:
- Size: 3.34 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weather Forecasting (Time Series)
This repository contains a framework for weather forecasting using time series data. The project integrates data preprocessing, modeling techniques, performance evaluation, and result visualization.
---
## Project Structure
```bash
project/
├── data/
│ ├── hourly_data.csv # Dataset
│ └── get_data.ipynb # Notebook for data retrieval
├── src/
│ ├── utilities.R # General helper functions
│ ├── data_preprocessing.R # Functions for loading and preprocessing data
│ ├── metrics.R # Function to compute performance metrics
│ ├── modeling.R # All modeling functions (XGBoost, GLMNET, Cubist, ARIMA, Prophet)
│ └── results_visualization.R # Functions for visualizing forecasts and evaluation results
├── main.R # Main workflow script that ties everything together
└── README.md # Project documentation
```---
## Features
- **Data Preprocessing**
- Load data.
- Remove predictors highly correlated with the target.
- Add Fourier-based time features to capture periodic patterns.- **Modeling Functions**
- **XGBoost:** Regression using gradient boosting.
- **GLMNET:** Penalized regression.
- **Cubist:** Rule-based regression.
- **ARIMA:** Univariate time series forecasting.
- **Prophet:** Forecasting using Facebook's Prophet.- **Performance Evaluation**
- Compute RMSE, R-squared, and adjusted R-squared.- **Utility Functions**
- `time_it()`: Measure the execution time of any function.
- `format_forecast()`: Standardize the output of model forecasts.---
## Requirements
- **R** (version ≥ 3.5 recommended)
- Required R packages:
- `data.table`
- `ggplot2`
- `lubridate`
- `caret`
- `xgboost`
- `Metrics`
- `forecast`
- `prophet`
- *(Optional for parallel processing)* `doParallel`, `foreach`
---## Installation and Setup
1. Clone the project repository to your local machine:
```bash
git clone https://github.com/laura-projects-work/weather-forecasting.git
cd weather-forecasting
```2. Install Required R Packages
```bash
install.packages(c("data.table", "ggplot2", "lubridate", "caret", "xgboost", "Metrics", "forecast", "prophet"))
# For optional parallel processing support:
install.packages(c("doParallel", "foreach"))
```3. Ensure that the dataset (hourly_data.csv) is in the data/directory. Alternatively, run the get_data.ipynb notebook to retrieve and prepare the data.