SAVRN
Search Contact SAVRN

Open-weight model · Tabular classification

mbta-track-predictor

by Ryan Wallace cubis/mbta-track-predictor

Predicts which MBTA commuter rail track/platform a train will use, using a small tabular neural-network ensemble trained on historical assignments. This card documents the artifacts in output/ensemble20250906124755.

Parameters
Context
Weights594.0 KB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads71

Model Card

By Ryan Wallace, published under apache-2.0, revision 3fef4cfa8d03.

Predicts which MBTA commuter rail track/platform a train will use, using a small tabular neural-network ensemble trained on historical assignments. This card documents the artifacts in output/ensemble20250906124755. - trackpredictionensemblemodel0final.keras … trackpredictionensemblemodel5final.keras — individual ensemble members - trackpredictionensemblemodelbest.keras — best checkpoints during training (may match final) - trainingreport.md — training configuration and metrics Note: Ensemble training currently does not emit a vocab.json. See “Preprocessing & Vocab” below. Models expect integer indices for stationid and routeid, and raw directionid 0/1. In training, indices are produced by…

Read Ryan Wallace's full model card

imt-ml Track Prediction — Ensemble (2025-09-06 12:47:55)

Predicts which MBTA commuter rail track/platform a train will use, using a small tabular neural-network ensemble trained on historical assignments. This card documents the artifacts in output/ensemble_20250906_124755.

Model Summary

  • Task: Tabular multi-class classification (13 track classes)
  • Library: Keras (TensorFlow backend)
  • Architecture: 6-model ensemble (diverse dense nets with embeddings + cyclical time features); softmax outputs averaged at inference
  • Inputs (preprocessed):
  • Categorical: station_id (int index), route_id (int index), direction_id (0/1)
  • Time (cyclical): hour_sin, hour_cos, minute_sin, minute_cos, day_sin, day_cos
  • Continuous: scheduled_timestamp (float seconds since epoch; normalized in-model)
  • Outputs: Probability over 13 track labels (softmax)
  • License: MIT

Files in This Repo

  • track_prediction_ensemble_model_0_final.kerastrack_prediction_ensemble_model_5_final.keras — individual ensemble members
  • track_prediction_ensemble_model_*_best.keras — best checkpoints during training (may match final)
  • training_report.md — training configuration and metrics

Note: Ensemble training currently does not emit a *_vocab.json. See “Preprocessing & Vocab” below.

Preprocessing & Vocab

Models expect integer indices for station_id and route_id, and raw direction_id 0/1. In training, indices are produced by lookup tables built from the dataset vocabularies. To reproduce inference exactly, you must use the same vocabularies (station/route/track) that were present at training time or ensure consistent mapping.

What to use: - The training pipeline’s dataset loader (imt_ml.dataset.create_feature_engineering_fn) defines the exact feature mapping. If you need the vocab files, re-run a training or export step to generate them for your data snapshot, or save the vocab mapping alongside the model.

Metrics (validation)

From training_report.md: - Average validation loss: 1.2251 - Average validation accuracy: 0.5957 - Best individual accuracy: 0.6049 - Worst individual accuracy: 0.5812 - Ensemble accuracy stdev: 0.0087 - Dataset size: 24,832 records (310 train steps/epoch, 77 val steps/epoch)

These metrics reflect individual model performance; at inference time, average the softmax probabilities across all 6 models to produce ensemble predictions.

Example Usage (local Python)

This snippet loads all six Keras models and averages their softmax outputs. Replace the feature values with your preprocessed tensors/arrays, ensuring they match the training feature schema and index mappings.

import numpy as np
import keras

# Load ensemble members
paths = [
    "track_prediction_ensemble_model_0_final.keras",
    "track_prediction_ensemble_model_1_final.keras",
    "track_prediction_ensemble_model_2_final.keras",
    "track_prediction_ensemble_model_3_final.keras",
    "track_prediction_ensemble_model_4_final.keras",
    "track_prediction_ensemble_model_5_final.keras",
]
models = [keras.models.load_model(p, compile=False) for p in paths]

# Prepare one example (batch size 1) — values shown are placeholders.
# You must convert raw strings to indices using the same vocab mapping used in training.
features = {
    "station_id": np.array([12], dtype=np.int64),     # int index
    "route_id": np.array([3], dtype=np.int64),        # int index
    "direction_id": np.array([1], dtype=np.int64),    # 0 or 1
    "hour_sin": np.array([0.707], dtype=np.float32),
    "hour_cos": np.array([0.707], dtype=np.float32),
    "minute_sin": np.array([0.0], dtype=np.float32),
    "minute_cos": np.array([1.0], dtype=np.float32),
    "day_sin": np.array([0.433], dtype=np.float32),
    "day_cos": np.array([0.901], dtype=np.float32),
    "scheduled_timestamp": np.array([1.7260e9], dtype=np.float32),
}

# Predict per model and average probabilities
probs = [m.predict(features, verbose=0) for m in models]
avg_prob = np.mean(probs, axis=0)   # shape: (batch, num_tracks)
pred_class = int(np.argmax(avg_prob, axis=-1)[0])
print({"predicted_track_index": pred_class, "probabilities": avg_prob[0].tolist()})

Tip: If you have the track vocabulary used at training time, you can map pred_class back to its track label string by indexing into that track_vocab list.

Training Data

  • Source: Historical MBTA track assignments exported from Redis to TFRecord
  • Features:
  • Categorical: station_id, route_id, direction_id
  • Temporal: hour, minute, day_of_week (encoded as sin/cos pairs)
  • Target: track_number (13 classes)

Training Procedure

  • Command: ensemble
  • Num models: 6 (architectural diversity: deep, wide, standard)
  • Epochs: 150
  • Batch size: 64
  • Base learning rate: 0.001 (varied 0.8x–1.2x per model)
  • Regularization: L1/L2, Dropout, BatchNorm; cosine LR scheduling and early stopping when enabled

Intended Use & Limitations

  • Intended for assisting real-time track/platform assignment predictions for MBTA commuter rail.
  • Not a safety system; always defer to official dispatch/operations.
  • Sensitive to concept drift (schedule/operational changes) and to unseen stations/routes.
  • Requires consistent categorical index mapping between training and inference.

Identity and Version

Repository
cubis/mbta-track-predictor
Publisher
Ryan Wallace
Task
Tabular classification
Modality
Tabular
Library
keras
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
3fef4cfa8d03bcb1ef2cfefa11c712f8b985c7ff
First published
2025-09-06
Last updated
2025-09-08

Files and Weights

22 files, 8.4 MB in total. The weights are 6 files totalling 594.0 KB in tflite.

Weights6 files · 594.0 KB
Configuration1 file · 33 B
Documentation2 files · 9.2 KB
Other12 files · 7.8 MB
Repository1 file · 2.5 KB
Every file
FileTypeSizeSHA-256
track_prediction_ensemble_model_0_best.tfliteWeights115.5 KB 1277960e2697
track_prediction_ensemble_model_1_best.tfliteWeights318.7 KB e9a96ff90bee
track_prediction_ensemble_model_2_best.tfliteWeights39.9 KB 25cbf6901693
track_prediction_ensemble_model_3_best.tfliteWeights39.9 KB 219457c3c67f
track_prediction_ensemble_model_4_best.tfliteWeights39.9 KB e171931c1cf0
track_prediction_ensemble_model_5_best.tfliteWeights39.9 KB 934748d58048
track_prediction_ensemble_temperature.jsonConfiguration33 B
README.mdDocumentation6.0 KB
training_report.mdDocumentation3.2 KB
track_prediction_ensemble_model_0_best.kerasOther761.8 KB f513d48d9f97
track_prediction_ensemble_model_0_final.kerasOther761.8 KB c0981f554432
track_prediction_ensemble_model_1_best.kerasOther2.0 MB a31cfe85ff27
track_prediction_ensemble_model_1_final.kerasOther2.0 MB 7214dc0342f3
track_prediction_ensemble_model_2_best.kerasOther290.1 KB b3db7061422a
track_prediction_ensemble_model_2_final.kerasOther290.1 KB f85605f63c2b
track_prediction_ensemble_model_3_best.kerasOther290.1 KB df66f825dd43
track_prediction_ensemble_model_3_final.kerasOther290.1 KB 6a2e26f7001b
track_prediction_ensemble_model_4_best.kerasOther290.2 KB 633e0b3bfeb1
track_prediction_ensemble_model_4_final.kerasOther290.2 KB 5eabcbd229e5
track_prediction_ensemble_model_5_best.kerasOther290.2 KB 680164834b01
track_prediction_ensemble_model_5_final.kerasOther290.2 KB 3f90321170ad
.gitattributesRepository2.5 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
594.0 KB
Download from Ryan Wallace

Released by Ryan Wallace through its official repository on Hugging Face. Read the license.

Evaluations

Each result is shown as reported, with the conditions its reporter stated. None is a SAVRN measurement. A comparison lines two results up only when their configuration, unit and setup are all stated and identical.

BenchmarkConditionsResultReported byRevisionDate
MBTA Track Assignment (custom) Task Track classificationMetric Average individual accuracyComparison conditions not established 0.5957 cubis
Publisher reported
Evaluated revision not stated
MBTA Track Assignment (custom) Task Track classificationMetric Average individual lossComparison conditions not established 1.2251 cubis
Publisher reported
Evaluated revision not stated
MBTA Track Assignment (custom) Task Track classificationMetric Best individual accuracyComparison conditions not established 0.6049 cubis
Publisher reported
Evaluated revision not stated

Memory Requirements

PrecisionWeights in memory
As published594.0 KB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About mbta-track-predictor

Can I use mbta-track-predictor commercially?

Yes. mbta-track-predictor is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Tabular classification

Nori-30M

Synthefy

Nori-30M is the ~29.2M-parameter variant of Nori, a tabular foundation model for regression via in-context learning (ICL). Given a few labeled rows as context, it predicts on new query rows in a single forward pass, with no task-specific training or fine-tuning. The model is trained entirely on synthetic data. Mean and median R² across 96 regression tasks from three public benchmark suites, on the same protocol as the base Nori: Stronger than the ~6M base on every suite. Evaluated with the bundled default inference config and the large-GPU protocol (up to 50k context rows per dataset). Paste this into Claude Code, Cursor, or any AI coding assistant and it will wire python from synthefynori…

Open weights apache-2.0 synthefy-nori

Model · Tabular classification

sap-rpt-1-oss

SAP

Go to SAP-RPT Playground ↗ Note: This model and repository were formerly known as ConTextTab. While the code and repository have now been updated in line with the new name sap-rpt-1-oss, the model checkpoint and functionality remain identical. Implementation of the deep learning model with the inference pipeline described in the paper "ConTextTab: A Semantics-Aware Tabular In-Context Learner". Tabular in-context learning (ICL) has recently achieved state-of-the-art (SOTA) performance on several tabular prediction tasks. Previously restricted to classification problems on small tables, recent advances such as TabPFN and TabICL have extended its use to larger datasets. While being…

Access requested at publisher apache-2.0 sap-rpt-1-oss

Model · Tabular classification

Nori

Synthefy

Nori is a tabular foundation model for regression via in-context learning (ICL). Given a few labeled rows as context, it predicts on new query rows in a single forward pass, with no task-specific training or fine-tuning. The model is trained entirely on synthetic data. Mean and median R² of the base model across 96 regression tasks from three public benchmark suites (single H200, up to 50K context rows per dataset): Large-N / long-context tables (common in TabArena) are the current focus of the large-table training stages. These numbers are reproducible end-to-end with one command — see Reproducing these numbers. Paste this into Claude Code, Cursor, or any AI coding assistant and it will…

Open weights apache-2.0 synthefy-nori

Model · Tabular classification

EXAONE-Tabular

LG AI Research

EXAONE Tabular is a transformer-based foundation model for tabular data that solves classification and regression through in-context learning: you pass the labeled rows to fit and the model predicts new rows in a single forward pass — no gradient updates and no per-dataset training. This repository is the exaonetabular inference runtime — a self-contained package that loads a released checkpoint and serves predictions through a small, scikit-learn-style API. The code here is permissively licensed; the released weights are non-commercial — see Both checkpoints are released: EXAONETabularClassifier and EXAONETabularRegressor each fetch their own weights with a single frompretrained() call.…

Open weights other

Model · Tabular classification

TabPFN-v2-clf

Prior Labs

TabPFN is a transformer-based foundation model for tabular data that leverages prior-data based learning to achieve strong performance on small tabular datasets without requiring task-specific training. For detailed usage examples and best practices, check out: - Python ≥ 3.9 - PyTorch ≥ 2.1 - scikit-learn ≥ 1.0 This repository hosts the production TabPFN-v2 base checkpoints. Files matching the pattern tabpfn-v2-classifier-finetuned-.ckpt are content-identical aliases of the corresponding base checkpoints (e.g. tabpfn-v2-classifier-finetuned-gn2p4bpt-xp6f0iqb.ckpt is identical to tabpfn-v2-classifier-gn2p4bpt.ckpt; tabpfn-v2-classifier-finetuned-zk73skhh.ckpt is identical to…

Open weights other tabpfn

Model · Tabular classification

tabfm-1.0.0-pytorch

Google

TabFM is a zero-shot tabular foundation model from Google Research. It supports classification and regression on structured/tabular data with mixed numerical and categorical columns, requiring no fine-tuning or hyperparameter search - training examples are passed as context and predictions are made in a single forward pass. This repository contains the PyTorch weights. For the JAX/Flax weights see You can also load directly using the HuggingFace Hub API: Developed by the Google Research team. - Tabular data with numerical and/or categorical columns - Binary and multiclass classification (up to 10 classes) TabFM uses alternating row and column attention to capture both feature interactions…

Open weights other tabfm