File size: 2,801 Bytes
7ea5672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---

title: RidePricingInsightEngine
emoji: πŸš—
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: "5.22.0"
app_file: app.py
pinned: false
license: mit
short_description: ML-powered ride fare prediction using regression
---


# Dynamic Ride Pricing Optimization

## πŸš€ Overview

This project presents a machine learning-based solution for **ride fare prediction and optimization**, using a rich synthetic dataset of historical ride data. By analyzing real-time supply-demand conditions and customer attributes, the system aims to help ride-sharing platforms implement **data-driven dynamic pricing strategies**.

## πŸ“Š Dataset

- **Source**: [Dynamic Pricing Dataset (Kaggle)](https://www.kaggle.com/datasets/arashnic/dynamic-pricing-dataset)
- **Description**: A **synthetic dataset** designed for ride-sharing fare prediction. Features include:
  - Number of Riders / Drivers
  - Location Category
  - Loyalty Status
  - Number of Past Rides
  - Ratings
  - Booking Time
  - Vehicle Type
  - Expected Ride Duration
  - Historical Cost of Ride

## πŸ” Problem Statement

The objective is to identify which features most influence ride fares and approximate pricing behavior through various **regression models**. This includes:
- Finding key predictors for optimal fare setting.
- Estimating price sensitivity across rider and supply characteristics.
- Offering recommendations for **dynamic fare adjustments** in real time.

## 🧠 Model & Features

- **Regression-based modeling** (e.g., Linear, Ridge, XGBoost)
- **Final model**: Huber Regressor with non-zero intercept β€” robust to outliers, encouraging sparse feature usage
- **Feature selection pipeline** to reduce unnecessary variables
- **Price approximation engine** that generalizes across different booking conditions
- **Gradio-powered UI** for hands-on exploration

## πŸ› οΈ Tools and Libraries

- **Python**
- **Scikit-learn**, **XGBoost**
- **Pandas**, **NumPy**
- **Gradio** for app deployment
- **Plotly** for interactive visualization

## πŸ§ͺ How to Run Locally

```bash

git clone https://github.com/Sharma-Pranav/Portfolio.git

cd Portfolio/projects/DynamicPricingOptimization

pip install -r requirements.txt

python app.py

```

## πŸ“ˆ Results

- Clear insights into **fare-driving features** like rider demand, loyalty, and time of day.
- **Huber Regressor** outperformed others due to robustness and minimal feature reliance.
- **Optimal pricing zones** visualized for strategic recommendations.
- Portable deployment for teams to simulate and iterate pricing strategies.

---

> ✨ Developed by **Pranav Sharma** | πŸš€ Hugging Face Space: [`RidePricingInsightEngine`](https://huggingface.co/spaces/PranavSharma/RidePricingInsightEngine)