S
All projects
Predictive Analytics2022·Risk Analyst & ML Developer

Driver Safety AI

Predictive Risk Management System

A predictive analytics system for driver safety using DriveCam/Lytx-style behavioral data — clustering and classification to profile risk, trigger alerts and drive preventive coaching.

K-Means clustering Random Forest classification Risk profiling Behavior triggers Confusion-matrix evaluation Risk alerts Driver comparison dashboard Preventive coaching Driver performance scoring

95%

Prediction accuracy

-25%

Repeat violations

500K+

Events analyzed

-20%

Reporting latency

Business challenge

Fleet safety programs react after incidents happen. The goal was to predict which drivers are trending toward high risk so coaching can happen before an incident, not after.

What I built

I built K-Means clustering to segment drivers and a Random Forest classifier to label high / moderate / low risk from in-cabin, controllable and external behavior triggers. The system produces risk alerts, a driver comparison dashboard, performance scores and preventive coaching recommendations. Achieved 95% prediction accuracy and contributed to a 25% reduction in repeat safety violations.

Why it matters

Safety incidents are costly — in dollars, in insurance premiums and in lives. A predictive approach turns a reactive safety program into a proactive one, targeting coaching where it will prevent the most harm.

How it's designed

01Data
Behavioral EventsSnowflakeSQL Server
02Features
Trigger EngineeringAggregation
03ML
K-MeansRandom ForestEvaluation
04Delivery
Risk AlertsTableau DashboardsCoaching

Interface

Screenshot placeholder — drop product UI here

How the intelligence flows

  1. 01Ingest — DriveCam/Lytx-style behavioral event data (500,000+ events).
  2. 02Feature engineering — in-cabin, controllable driving and external factor triggers.
  3. 03Segment — K-Means clustering into risk cohorts.
  4. 04Classify — Random Forest for high / moderate / low risk (70/30 train-test split).
  5. 05Evaluate — confusion-matrix analysis of model performance.
  6. 06Act — risk alerts, performance scoring and coaching recommendations.

How data is modeled

  • Snowflake and SQL Server as the analytics stores for event and driver data.
  • Feature tables aggregating triggers per driver and time window.
  • Model output tables: risk labels, scores and cluster assignments.
  • Optimized queries for a 20% latency reduction on reporting.

Key endpoints

GET/drivers/{id}/riskRisk label, score and cluster for a driver.
GET/drivers/compareDriver comparison dashboard data.
GET/alertsActive high-risk alerts for intervention.

Technologies

Pythonscikit-learnPandasSnowflakeSQL ServerTableau

Key features

  • High / moderate / low risk driver profiling.
  • In-cabin, controllable and external behavior triggers.
  • Risk alerts for proactive intervention.
  • Driver comparison dashboard.
  • Preventive coaching recommendations.
  • Driver performance scoring.
  • Route optimization and readiness assessment (roadmap).

Challenges & trade-offs

Signal in behavioral noise

Behavioral triggers are noisy; careful feature engineering across in-cabin, controllable and external factors was key to a usable model.

Actionable, not just accurate

A risk label is only useful if it drives coaching — so outputs were designed as alerts and recommendations, not just scores.

Code snippet

Risk classificationpython
X = engineer_triggers(events)            # in-cabin + controllable + external
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30)

clf = RandomForestClassifier(n_estimators=300, class_weight="balanced")
clf.fit(X_train, y_train)

preds = clf.predict(X_test)
print(confusion_matrix(y_test, preds))    # evaluate high / moderate / low
drivers["risk"] = clf.predict(X)          # -> alerts + coaching

How it ships

  • Batch scoring pipeline feeding Tableau dashboards.
  • Scheduled model runs over refreshed event data.

Security

  • Access-controlled driver data.
  • Aggregated reporting to protect individual privacy where appropriate.

Scalability

  • Set-based SQL and Snowflake for large event volumes.
  • Vectorized feature computation in Pandas.

Future roadmap

Route optimization based on risk profiles.
Psychometric readiness assessment.
Real-time trigger scoring.

Lessons learned

Predictive models earn trust when their output is coaching-ready, not just a number.
Feature engineering, not the algorithm, was the biggest driver of accuracy here.