Skip to main content

A web application for calculating dynamic price of Uber and Lyft cabs depending on various parameters

Project description

Build Status Coverage Status contributors codesize

logo file

Easy Cabs

Easy Cabs is a ML-assisted web-based application which helps you in getting the dynamic pricing of Uber and Lyft cabs. The user enters the source and destination. Easy Cabs converts that to latitude, longitude, gets the weather information and predicts the estimated price for your rides using machine learning. The user can then make a decision on taking a cost-optimized cab.

Background

Uber and Lyft account for the major market capitalization for offering cab services on an app. But these prices are not constant like public transportation. They are greatly affected by the demand and supply of rides at a given time. So what exactly drives this demand? Some of the factors include weather changes, rush hours and location. EasyCabs takes into account these factors and tries to replicate a prototypical version of the pricing and surging microservices for these apps. It also offers an opportunity to retrain models using a feedback loop as a separate microservice.

Authors

Project Distribution

cab-dynamic-pricing/
  |- README.md
  |- cab-dynamic-pricing/
    |- __init__.py
    |- configuration_files/
      |- software_configuration_format.py
    |- database/
      |- users.csv
    |- feedback_app/
      |- training_testing_data/
        |- lyft_test_mlr.csv
        |- lyft_train_mlr.csv
        |- testing_surge_price_classifier_df.csv
        |- training_surge_price_classifier_df.csv
        |- uber_test_mlr.csv
        |- uber_train_mlr.csv
      |- dynamic_price_model_training.py
      |- surge_model_training.py
      |- train_models.py
    |- model_scripts/
      |- dynamic_pricing_regression_inference.py
      |- surge_classification_inference.py
    |- model_weights/
      |- lyft_mlr_model.sav
      |- surge_classification_rf_model.sav
      |- uber_mlr_model.sav
    |- templates/
      |- login_background.jpg
      |- login_index.html
      |- template_page2.html
    |- tests/
      |- test_app.py
      |- test_dynamic_pricing_model_training.py
      |- test_dynamic_pricing_regression_inference.py
      |- test_geospatial_information.py
      |- test_lyft.py
      |- test_software_configuration_format.py
      |- test_surge_classification_inference.py
      |- test_surge_price_model.py
      |- test_train_models.py
      |- test_uber.py
      |- test_user.py
      |- test_weather_information.py
    |- utils/
      |- geospatial_information.py
      |- lyft.py
      |- uber.py
      |- user.py
      |- utils.py
      |- weather_information.py
    | - app.py
  |- data/
      |- cab_rides.csv.zipe
      |- weather.csv
  |- documentation/
      |- api_documentation.md
      |- component_specification.md
      |- functional_specification.md
      |- screenshots/
  |- example
      |- example.md
      |- screenshots/
  |- .coveragerc
  |- .gitignore
  |- LICENSE
  |- requirements.txt
  |- setup.py

Data

Link to the Data Set
Features extracted from the dataset: -

  • cab_type : Uber or Lyft.
  • clouds : presence or absence of clouds.
  • destination : name of the destination in words.
  • humidity : humidity in percentage.
  • location : location of the place where the weather is recorded.
  • pressure : atmospheric pressure in millibar.
  • price : price estimate for the ride in USD.
  • rain : rain in inches for the last hour.
  • name : type of the car specified, eg. X, XL.
  • source : name of the source in words.
  • surge_multiplier : 5 unique values mentioned.
  • temp : temperature in Fahrenheit.
  • time_stamp : start of the cab journey in epoch units.
  • wind : wind speed in miles per hour.

Note: The data currently covers locations in Boston. Hence, to get relatively accurate estimates, the default models are bound to work the best for Boston locations.

Installation

Method 1: Cloning the Github Repository:

  1. Clone the repo
git clone https://github.com/rohitl17/cab-dynamic-pricing.git
  1. Create a virtual environment in the root of the repo
python -m venv venv
source venv/bin/activate

If you're using Anaconda, create and activate a new conda environment. For conda run

conda create --name cabdynamicpricing
conda activate cabdynamicpricing
  1. Install the dependencies from the requirements.txt file using the below:
python -m pip install -r requirements.txt

Method 2: Installing the package using the pip command:

  1. Run the following command to install the application
pip install cab-dynamic-pricing
  1. Install the dependencies from the requirements.txt file using the below:
python -m pip install -r requirements.txt

Usage and Output

To see how to use the package to get the dynamic pricing of Uber and Lyft, refer to the example file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cab-dynamic-pricing-1.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

cab_dynamic_pricing-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file cab-dynamic-pricing-1.0.0.tar.gz.

File metadata

  • Download URL: cab-dynamic-pricing-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for cab-dynamic-pricing-1.0.0.tar.gz
Algorithm Hash digest
SHA256 146b5108ef783676159707760466ab6f481d651f3cdbeafe491e24a90d599cd3
MD5 3ceabb2d64087eacd40bd44ca2088e50
BLAKE2b-256 926c36df7db6d4ec190a6e92e637f98741a2b64c3c375d2b11364b47eae7de06

See more details on using hashes here.

File details

Details for the file cab_dynamic_pricing-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cab_dynamic_pricing-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for cab_dynamic_pricing-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ae821d5168f2987aa00f85363c288b379eec5800cdd08bdc9bd7cf1ffe6cab6
MD5 a35bcb15ced969b64fc5499473187661
BLAKE2b-256 24cf4244873bb7a659d9a1d37e5a9bff629f306143265165cc8cac8ef3b83f10

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page