Skip to content
All projects
ML & DataJunction 2025 hackathon2025Prototype

Migraine Risk Prediction

Junction 2025: explainable migraine-risk estimates from daily habits and wearable data.

research-backed triggers in the rule engine
10
research-backed triggers in the rule engine
model confidence needed before ML overrides the rules
≥ 80%
model confidence needed before ML overrides the rules

Overview

The prediction service built at Junction 2025 for a migraine challenge. A FastAPI backend combines a rule engine, built from ten research-backed triggers, with a random forest. A hybrid router uses the model only when it is confident and otherwise falls back to the rules. Every prediction comes with the reasons behind it and suggestions. A passive-monitoring mode turns wearable data into risk alerts without manual input.

How it works

  • Rule engine: weighted scoring of triggers such as stress, sleep, caffeine, skipped meals, weather changes and hormonal phase. It is fully explainable.
  • Random forest: trained on 18 features. The hybrid router uses it only above 80% confidence.
  • Passive monitoring: a Fitbit OAuth integration and a wearable simulator map HRV, sleep and activity to features. Hourly background checks raise an alert only when risk is high and rising.
  • A small React companion app (prototype) for logging days and showing the prediction.

Honest caveats

  • The random forest was trained on 500 synthetic samples. Its 96% test accuracy shows that it learned the data generator, not how it would perform on real patients.
  • On the same inputs, the rules and the model often disagreed sharply (for example 100% vs 46% risk). This is why the API always reports which source produced the prediction, together with its explanation.
Next projectEntity Extraction & Document Clustering