This project implements a dynamic pricing model for a ride-sharing service. It adjusts ride costs based on current demand (number of riders) and supply (number of drivers) to optimize pricing and improve profitability.
- Dynamic price calculation based on supply and demand
- Data preprocessing pipeline
- Machine learning model for price prediction
- Profitability analysis
- Visualization of results
The data_preprocessing_pipeline
function handles:
- Identification of numeric and categorical features
- Handling of missing values
- Outlier detection and treatment using IQR method
Calculates demand_multiplier
and supply_multiplier
based on current market conditions to adjust ride prices.
Compares the adjusted ride cost with historical costs to determine the profitability of each ride under the new pricing model.
A machine learning model that predicts ride prices based on:
- Number of riders
- Number of drivers
- Vehicle type (Economy/Premium)
- Expected ride duration
Includes several visualizations:
- Donut chart showing the distribution of profitable vs. loss-making rides
- Scatter plot comparing actual vs. predicted prices
-
Preprocess your data:
preprocessed_data = data_preprocessing_pipeline(raw_data)
-
Apply the dynamic pricing model:
data['adjusted_ride_cost'] = calculate_dynamic_price(data)
-
Analyze profitability:
data['profit_percentage'] = calculate_profit_percentage(data)
-
Predict prices for new rides:
predicted_price = predict_price(number_of_riders, number_of_drivers, vehicle_type, Expected_Ride_Duration)
-
Visualize results:
plot_profitability_distribution(data) plot_actual_vs_predicted(y_test, y_pred)
- Python 3.7+
- pandas
- numpy
- scikit-learn
- plotly
- Clone this repository
- Install required packages:
pip install pandas numpy scikit-learn plotly
- Incorporate more features into the pricing model (e.g., time of day, weather conditions)
- Implement A/B testing to compare different pricing strategies
- Develop a real-time pricing update system
Vishal Bokhare