Model description
This is a regression model trained on the Dynamic Pricing Dataset. It was optimized using grid search with multiple hyperparameters.
Intended uses & limitations
This regression model is designed to predict the cost of rides based on various features such as expected ride duration, number of drivers, and time of booking.
Intended Uses:
- Dynamic Pricing Analysis: Helps optimize pricing strategies for ride-hailing platforms.
- Demand Forecasting: Supports business decisions by estimating cost trends based on ride-specific parameters.
Limitations:
- Feature Dependence: The model's accuracy is highly dependent on the input features provided.
- Dataset Specificity: Performance may degrade if applied to datasets with significantly different distributions.
- Outlier Sensitivity: Predictions can be affected by extreme values in the dataset.
Training Procedure
The model was trained using grid search to optimize hyperparameters. Cross-validation (5-fold) was performed to ensure robust evaluation. The best model was selected based on the lowest Mean Absolute Error (MAE) on the validation set.
Hyperparameters
Click to expand
| Hyperparameter | Value |
|---|---|
| alpha | 1 |
| copy_X | True |
| fit_intercept | False |
| max_iter | 1000 |
| positive | False |
| precompute | False |
| random_state | |
| selection | cyclic |
| tol | 0.0001 |
| warm_start | False |
Model Plot
Lasso(alpha=1, fit_intercept=False)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
Lasso(alpha=1, fit_intercept=False)
Evaluation Results
The model achieved the following results on the test set:
- Mean Absolute Error (MAE): 50.31928636001356
- R² Score: 0.8854065597299239
Key Insights:
- Longer ride durations increase costs significantly, which may justify adding a surcharge for long-distance rides.
- Evening bookings reduce costs, potentially indicating lower demand during these hours.
- The model's accuracy is dependent on high-quality feature data.
Refer to the plots and tables for detailed performance insights.
Model Coefficients
| Feature | Coefficient |
|---|---|
| Number_of_Riders | -0.1398 |
| Number_of_Drivers | 0.4665 |
| Number_of_Past_Rides | -0.0033 |
| Average_Ratings | -0.0000 |
| Expected_Ride_Duration | 3.4973 |
| Location_Category_Suburban | 0.0000 |
| Location_Category_Urban | -0.0000 |
| Customer_Loyalty_Status_Regular | 0.0000 |
| Customer_Loyalty_Status_Silver | 0.0000 |
| Time_of_Booking_Evening | -2.4212 |
| Time_of_Booking_Morning | -0.0000 |
| Time_of_Booking_Night | 0.0000 |
| Vehicle_Type_Premium | 39.5754 |
Regression Equation
Cost of Ride = -0.1398 × Number_of_Riders + 0.4665 × Number_of_Drivers + -0.0033 × Number_of_Past_Rides + 3.4973 × Expected_Ride_Duration + -2.4212 × Time_of_Booking_Evening + 39.5754 × Vehicle_Type_Premium
Actual vs Predicted
The following plot shows the relationship between the actual and predicted values. The closer the points are to the diagonal line, the better the predictions. The dashed line represents the ideal case where predictions perfectly match the actual values.
The scatter plot above shows the predicted values against the actual values. The dashed line represents the ideal predictions where the predicted values are equal to the actual values.
How to Get Started with the Model
To use this model:
- Install Dependencies: Ensure
scikit-learnandpandasare installed in your environment. - Load the Model: Download the saved model file and load it using
joblib:from joblib import load model = load('best_model.joblib') - Prepare Input Features: Create a DataFrame with the required input features in the same format as the training dataset.
- Make Predictions: Use the
predictmethod to generate predictions:predictions = model.predict(input_features)
Model Card Authors
This model card was written by Pranav Sharma.
Model Card Contact
For inquiries or feedback, you can contact the author via GitHub.
Citation
If you use this model, please cite it as follows:
@model{pranav_sharma_dynamic_pricing_model_2025,
author = {Pranav Sharma},
title = {Dynamic Pricing Model},
year = {2025},
version = {1.0.0},
url = {https://huggingface.co/PranavSharma/dynamic-pricing-model}
}
- Downloads last month
- -
