Skip to content
Home
← All projects

FRA Highway–Rail Incident Mining

Graduate data mining project comparing Decision Trees and TabNet for injury prediction, then clustering mixed numeric and categorical features with K-medoids/PAM and HDBSCAN.

  • PyTorch
  • pandas
  • NumPy
  • scikit-learn

The problem

The Federal Railroad Administration publishes every reported highway–rail grade crossing incident in the United States. It is a large, genuinely messy public dataset: hundreds of thousands of records mixing numeric fields (train speed, vehicle speed, temperature) with categorical ones (weather, crossing warning device, driver action), across decades of reporting.

Two questions are worth asking of it. First, a supervised one: given the circumstances of an incident, can you predict whether someone was injured? Second, an unsupervised one: do incidents fall into recognizable kinds, or is every crossing accident its own story?

This was built for graduate coursework in data mining (CS 235) while an undergraduate.

Approach

Supervised — injury prediction. I compared a Decision Tree against TabNet, a neural architecture designed specifically for tabular data. The pairing is deliberate: the tree is the interpretable baseline that a safety analyst could actually read and act on, and TabNet is the modern attention-based challenger. The interesting question is not which is more sophisticated but whether the added complexity buys enough accuracy to justify losing the ability to explain a prediction.

Unsupervised — incident structure. I clustered with K-medoids/PAM and HDBSCAN. K-medoids was chosen over K-means on purpose: medoids are real observations rather than synthetic averages, which matters when your features are mixed numeric and categorical and the "average" of two weather conditions is meaningless. HDBSCAN adds what K-medoids cannot — it finds clusters of varying density and is willing to label a point as noise instead of forcing every incident into a group.