Machine Learning & Business Intelligence Case Study
NYC taxi passengers lack fare transparency before starting a ride. Fare variability driven by distance, duration, traffic, and data anomalies creates uncertainty for riders and operational challenges for pricing systems.
This project builds an end-to-end analytics pipeline — from anomaly detection and feature engineering to a production-grade Random Forest model and dual BI dashboards — to predict fares accurately and support data-driven operational decisions.
NYC TLC historical trip records — distance, tolls, duration, passenger count, payment type
Python · Random Forest · Feature Engineering · Power BI · Tableau
Random Forest R²: 0.974,
MAE: $0.43, and RMSE: $1.71
on held-out test data
Upfront pricing for long trips, anomaly detection QC rules, peak-hour operational insights
NYC Taxi & Limousine Commission historical trip records capturing ride-level fare, distance, duration, and payment behaviour — with significant data quality challenges requiring anomaly detection before modelling.
Key Features
Data Challenges
Anomaly detection using fare-per-mile and duration logic was applied before modeling. OLS regression was used as a diagnostic validation step to assess feature significance.
Random Forest Regression was selected after linear models failed variance and residual diagnostics — non-linear patterns in fare behaviour required a tree-based approach. OLS was used only as a diagnostic validation step.
Conducted Exploratory Data Analysis to validate pricing behavior and understand fare distribution patterns.
Applied anomaly detection using fare-per-mile and duration logic to remove unrealistic records before training.
Engineered features including fare-per-mile ratio and peak-hour indicators to improve model stability.
Used OLS regression as a diagnostic validation step to confirm feature significance before tree-based modelling.
Trained and evaluated Random Forest Regression — achieving R² 0.974, MAE $0.43, and RMSE $1.71 on test data.
Winner row highlighted — XGBoost selected as final production model.
| Model | Role | R² | RMSE | Notes |
|---|---|---|---|---|
| Linear Regression | Baseline | — | — | Failed variance & residual diagnostics |
| Random Forest Regression Best | Final production model | 0.974 | $1.71 | Captures non-linear fare patterns; production-ready |
Final model evaluation on held-out test data.
Power BI dashboards surface fare behaviour patterns, error diagnostics, decomposition trees, and executive insights — enabling operational teams to understand pricing drivers and anomalies interactively.
Tableau was used to validate the Random Forest model on unseen test data — comparing actual vs predicted fare trends, checking distribution alignment, and verifying error variance across trip segments.
Findings from EDA, model outputs, and dashboard exploration that inform investment decision-making.
Data quality directly determines model reliability — anomaly removal was the single most impactful preprocessing step.
Non-linear models significantly outperform linear regression for real-world fare prediction.
Long-distance trips (20+ miles) contribute the highest prediction errors and fare variance.
High-fare rides show more prediction variance — upfront pricing would reduce uncertainty for riders.
Duration & distance are the dominant fare uncertainty drivers across all trip segments.
Credit card payments dominate and include almost all tipping behaviour — cash trips underreport true revenue.
Actionable strategies for investors and decision-makers based on model outputs and dashboard analysis.
Apply these to acquisition screening and portfolio decisions.
Promote credit card payments to capture tipping behaviour and improve driver earnings reporting.
Implement QC anomaly detection rules (fare, distance, duration thresholds) to clean future data automatically.
Introduce upfront pricing for 20+ mile trips to reduce fare uncertainty for both riders and drivers.
Strengthen peak-hour operations (morning & evening rush) — highest demand and revenue concentration.
Target medium-fare riders ($20–$60) for loyalty and repeat ride campaigns — most predictable segment.
Deploy dashboards as a weekly operational review tool for fleet management and pricing decisions.
Expected outcome: Improved fare transparency, reduced anomalies, higher driver earnings, and better peak-hour operational efficiency.