Skip to content

PiyaphatC/Transformer_Ridership

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Transformer Ridership Prediction

Climate-induced Transformer model for Bangkok MRT station ridership prediction

A deep learning pipeline that forecasts daily passenger in/out counts at individual MRT stations using a Transformer architecture, incorporating climate variables (temperature, rainfall, humidity) alongside historical ridership data.

Overview

Model Transformer (encoder-only, per-station)
Target Ridership in & out per MRT station
Input features Historical ridership + climate variables
Sequence length 28 days → forecast 1 day ahead
Framework PyTorch (CUDA-ready)

Features

  • Per-station model training with checkpoint saving
  • NaN-safe preprocessing and robust normalization options (standard, minmax, robust)
  • Evaluation metrics: MAE, RMSE, R²
  • Auto-generated prediction plots per station

Data

File Description
Master.csv Daily ridership + climate data per station
static.csv Station metadata (line, location, etc.)

Usage

pip install torch pandas numpy matplotlib
python main.py

Set MODE = 0 for train + test, MODE = 1 for inference only (loads saved checkpoints).

Project Context

Part of the Bangkok Living Lab research under CUTI (Chulalongkorn University Transportation Institute), investigating climate resilience of urban transit systems.

About

Climate-induced Transformer model for Bangkok MRT ridership prediction

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors