๐ How an Uber driver can earn an extra $2,000 per month without working more hours
Executive Summary
๐จ The Problem
NYC taxi and rideshare drivers work long, exhausting shifts, but most are leaving money on the table. Without a clear strategy, they accept nearly every trip that comes their wayโwasting precious time on low-value rides that drag down their hourly wage.
๐ฏ The Business Goal
Increase average taxi driver earnings by 20%โwithout working more hours.
๐ Project Scope
We focused on high-volume for-hire vehicles (Uber, Lyft, Juno, Via) operating within Manhattan, Brooklyn, and Queensโthe busiest boroughs in NYC.
๐ก The Solution
We built a dataโdriven decision system that answers two simple but powerful questions:
๐ค Which trips should I accept? โ A machine learning model (XGBoost) classifies each trip as highโvalue or lowโvalue in real time. The winning strategy? Our model recommends accepting only trips that have a 90%+ chance of being among the top 25% most profitable in the next few minutes. This alone adds +$8/hour.
โฐ When and with whom should I start my shift? โ Through simulation, we discovered that the starting zone barely matters, but choosing Uber over Lyft and working night shifts adds up another +$6 per hour.
Combine both strategies โ +$14/hour โ 25% more earnings โ $2,200 extra per month ๐ธ
No extra hours. No extra effort. Just smarter decisions. โจ
๐ Results Highlight
๐ 25.4% Earnings Increase
Drivers implementing our full strategy saw their average hourly wage rise from $55.09 to $69.07โsignificantly exceeding the 20% target.
๐ฐ Over $2,100 More Per Month
Working 8-hour days, 5 days a week, this improvement translates to roughly $2,200 in additional monthly earnings for a full-time driver.

๐ Proven for the Real World
The true test came when we validated our policy on 2024 dataโa year the models were not trained on. The performance held strong, with the policy achieving an average hourly wage of $67.87. More importantly, it consistently outperformed the baseline in every single month, maintaining a solid advantage of $7โ$17 per hour. This confirms the strategy is reliable and adaptable to changing conditions.

๐ Key Insights We Discovered
Our recommendations are practical and implementable:
- ๐ Drive for Uber if possible
- ๐ Work nights rather than mornings
- โ Reject trips that fall below our profitability threshold
- ๐ Avoid Mondays and Fridays if you have the flexibility
- ๐บ๏ธ Where you start doesnโt matter as much as when you start

๐ก Why This Work Is Impressive
- We Simulated Over 65,000 Workdays
Without actual driver IDs in the data (anonymized trip records), we built a simulation engine that modeled driver behavior across tens of thousands of scenariosโeffectively โplaying outโ entire days to test what strategies would work best in the real world.
We Combined Data Science with Decision Theory
- Machine learning (XGBoost) to classify trip quality
- Sequential decision modeling to simulate day-long driver behavior
- Spatial analysis of NYC neighborhoods
- Demographic data from the US Census to understand local patterns
We Processed Massive Datasets
Working with over 55 GB of NYC taxi trip data, we used modern data engineering techniques (DuckDB, parallel processing, caching) to make this analysis feasible.
- All Results Are Reproducible
The entire analysis is documented, unit-tested, and containerized. Every stepโfrom data collection to model evaluationโcan be reproduced by anyone with the right tools.
๐ ๏ธ Methodology
To find the optimal solution for those questions, we followed the methodology proposed by Warren B. Powell (2022) in Sequential Decision Analytics and Modeling: Modeling with Python and combined it with the CrossโIndustry Standard Process for Data Mining (CRISPโDM) to define a machine learning model that powers the sequential decision.


Following the steps of both methodologies, we organized the articles created in this portfolio website:
๐ฎ Whatโs Next
- Interactive Demo: A Shiny web app where drivers can simulate their own earnings under different strategies.
- Real-World Pilot: Testing the policy with a small group of NYC drivers.
- Expansion: Adapting the model for other cities with similar trip data.
๐ Data to Use
In this project, we used a subset of the data available in the TLC Trip Record Data from 2022-2023 for High Volume ForโHire Vehicle โ which covers the Juno, Uber, Via and Lyft trips within our project scope โ with the columns described in its data dictionary.
โ ๏ธ Disclaimer
This project was completed under strong assumptions given that the data used in the analysis does not provide any unique identifier for taxi drivers, which limits the realism of some results.
Additionally, this project aims to increase taxi driver earnings at the individual level. However, if applied extensively, it could also produce the following unintended consequences:
Reduced service quality: Drivers focusing solely on maximizing earnings may avoid less profitable areas or times, potentially leaving some passengers underserved.
Increased congestion: Drivers congregating in highโprofit areas could worsen traffic in already busy parts of the city.
This project is intended as a demonstration of data science methodology rather than a prescriptive business recommendation, and these considerations should be carefully weighed before any realโworld implementation.
๐งฐ Project Structure and Tooling
Reproducibility and longโterm maintainability were core priorities from the start, which shaped every tooling decision in this project. The following tools were used to achieve this:
- ๐ง We use
gitto manage changes in the code and provide an interface to share the project on GitHub. - ๐ณ
DockerandNixare used to build a reproducible devโcontainer based ondefault.nix. The container can be connected via SSH using a public and private key pair as defined insetup.sh, and the.envrcsets the Nix environment to use in the Positron console. - ๐ฆ For modeling, we used the
tidymodelsframework to ensure we are following good modeling practices. - ๐ Since the project follows the basic structure of an R package, we were able to document and create unit tests for custom functions using
testthat,roxygen2anddevtools. This was especially important to ensure that the simulation function and the custom step function (which extends therecipespackage) work correctly. - ๐ The project also follows the structure of a Quarto project and renders all articles into the
docsfolder, giving us full control over the format used to present each article. Results are hosted on GitHub Pages, so they can be shared at no cost. - ๐ The
.Rprofileoverridesinstall.packages,update.packagesandremove.packagesto make clear that R packages must be defined indefault.nixto ensure reproducibility. - ๐๏ธ To manage data larger than RAM, we use
duckdband keep large files in a separate folder namedNycTaxiBigFilesunder the same parent directory as this repo. - ๐พ To cache results generated during the investigation process, we use
.qs2files and track them withpins, stored under the folderNycTaxiPinsin the same parent directory as this repo. - ๐งน We use the air extension to ensure consistent code formatting across the project.
The result is a hybrid structure that combines an R package (with documented functions and unit tests) and a Quarto website (with rendered articles and hosted results), which was one of the most challenging aspects of the project to set up correctly:
tree -L 3
.
โโโ air.toml
โโโ default.nix
โโโ DESCRIPTION
โโโ docker-compose.yml
โโโ Dockerfile
โโโ docs
โ โโโ figures
โ โ โโโ CRISP-DM_Process_Diagram.png
โ โ โโโ Hour Tree Explanation-1.png
โ โ โโโ htop_parallel_process.png
โ โ โโโ logo-generated.jpeg
โ โ โโโ Mean Hourly Wage after policy-1.png
โ โ โโโ model_benefit_curve.png
โ โ โโโ model-benefit.jpg
โ โ โโโ nyc-taxi-navbar-logo.png
โ โ โโโ nyc-taxi-navbar-logo.xcf
โ โ โโโ screenshot-ui.png
โ โ โโโ Sequential-Decision-Modeling-Framework.png
โ โ โโโ simulated_wage_vs_threshold.png
โ โโโ index.html
โ โโโ investigation-phases
โ โ โโโ 01-business-understanding.html
โ โ โโโ 02-data-collection-process.html
โ โ โโโ 03-initial-exploration_files
โ โ โโโ 03-initial-exploration.html
โ โ โโโ 04-base-line_files
โ โ โโโ 04-base-line.html
โ โ โโโ 05-lookahead-labeling_files
โ โ โโโ 05-lookahead-labeling.html
โ โ โโโ 06-expanding-geospatial-data_files
โ โ โโโ 06-expanding-geospatial-data.html
โ โ โโโ 07-expanding-transportation-socioeconomic_files
โ โ โโโ 07-expanding-transportation-socioeconomic.html
โ โ โโโ 08-policy-function-approximation_files
โ โ โโโ 08-policy-function-approximation.html
โ โ โโโ 09-from-predictions-to-policies_files
โ โ โโโ 09-from-predictions-to-policies.html
โ โ โโโ 10-optimal-starting-states_files
โ โ โโโ 10-optimal-starting-states.html
โ โโโ man
โ โ โโโ figures
โ โโโ search.json
โ โโโ site_libs
โ โโโ bootstrap
โ โโโ clipboard
โ โโโ DiagrammeR-styles-0.2
โ โโโ ggiraphjs-0.9.2
โ โโโ girafe-binding-0.9.2
โ โโโ grViz-binding-1.0.11
โ โโโ htmltools-fill-0.5.8.1
โ โโโ htmlwidgets-1.6.4
โ โโโ jquery-3.6.0
โ โโโ leaflet-1.3.1
โ โโโ leaflet-binding-2.2.3
โ โโโ leafletfix-1.0.0
โ โโโ Leaflet.glify-3.2.0
โ โโโ leaflet-providers-2.0.0
โ โโโ leaflet-providers-plugin-2.2.3
โ โโโ proj4-2.6.2
โ โโโ Proj4Leaflet-1.0.1
โ โโโ quarto-html
โ โโโ quarto-nav
โ โโโ quarto-search
โ โโโ rstudio_leaflet-1.3.1
โ โโโ viz-1.8.2
โโโ figures
โ โโโ CRISP-DM_Process_Diagram.png
โ โโโ Hour Tree Explanation-1.png
โ โโโ htop_parallel_process.png
โ โโโ Mean Hourly Wage after policy-1.png
โ โโโ model_benefit_curve.png
โ โโโ nyc-taxi-navbar-logo.png
โ โโโ nyc-taxi-navbar-logo.xcf
โ โโโ Sequential-Decision-Modeling-Framework.png
โ โโโ simulated_wage_vs_threshold.png
โโโ index.qmd
โโโ investigation-phases
โ โโโ 01-business-understanding.qmd
โ โโโ 02-data-collection-process.qmd
โ โโโ 03-initial-exploration.qmd
โ โโโ 04-base-line.qmd
โ โโโ 05-lookahead-labeling.qmd
โ โโโ 06-expanding-geospatial-data.qmd
โ โโโ 07-expanding-transportation-socioeconomic.qmd
โ โโโ 08-policy-function-approximation.qmd
โ โโโ 09-from-predictions-to-policies.qmd
โ โโโ 10-optimal-starting-states.qmd
โโโ man
โ โโโ add_performance_variables.Rd
โ โโโ add_pred_class.Rd
โ โโโ add_take_current_trip.Rd
โ โโโ calculate_costs.Rd
โ โโโ collect_predictions_best_config.Rd
โ โโโ compare_model_predictions.Rd
โ โโโ compute_power.Rd
โ โโโ figures
โ โ โโโ logo.hex
โ โ โโโ logo-image.png
โ โ โโโ logo.png
โ โ โโโ Logo-source.txt
โ โโโ NycTaxi-package.Rd
โ โโโ optimize_trip_start_time.Rd
โ โโโ plot_bar.Rd
โ โโโ plot_box.Rd
โ โโโ plot_heap_map.Rd
โ โโโ plot_num_distribution.Rd
โ โโโ required_pkgs.step_join_geospatial_features.Rd
โ โโโ sim_start_trip_summary.Rd
โ โโโ simulate_trips.Rd
โ โโโ step_join_geospatial_features.Rd
โโโ multicore-scripts
โ โโโ 01-fine-tune-future-process.R
โ โโโ 02-add-target.R
โ โโโ 02-run_add_target.sh
โ โโโ 03a-tuning-simple-models.R
โ โโโ 03b-tuning-dimreduction-models.R
โ โโโ 03c-tuning-tree-models.R
โโโ NAMESPACE
โโโ nix
โ โโโ pkgs.nix
โ โโโ r-core.nix
โ โโโ r-custom.nix
โ โโโ r-data.nix
โ โโโ r-geo.nix
โ โโโ r-ml.nix
โ โโโ system.nix
โโโ params.yml
โโโ _quarto.yml
โโโ R
โ โโโ add_take_current_trip.R
โ โโโ calculate_costs.R
โ โโโ compare_model_predictions.R
โ โโโ compute_power.R
โ โโโ NycTaxi-package.R
โ โโโ optimize_trip_start_time.R
โ โโโ plot_bar.R
โ โโโ plot_box.R
โ โโโ plot_heap_map.R
โ โโโ plot_num_distribution.R
โ โโโ sim_start_trip_summary.R
โ โโโ simulate_trips.R
โ โโโ step_join_geospatial_features.R
โ โโโ utils.R
โโโ README.md
โโโ setup.sh
โโโ tests
โโโ testthat
โ โโโ fixtures
โ โโโ test-add_take_current_trip.R
โ โโโ test-calculate_costs.R
โ โโโ test-plot_box.R
โ โโโ test-sim_start_trip_summary.R
โ โโโ test-simulate_trips.R
โ โโโ test-step_join_geospatial_features.R
โโโ testthat.R
47 directories, 109 files๐ฅ๏ธ Defining Development Environment
To reproduce the results of this project, follow these steps to set up the same environment using Docker and Nix.
1. ๐ณ Install Docker and Docker Compose
You need Docker and Docker Compose. Choose the appropriate installation method for your operating system:
- Windows or macOS: Install Docker Desktop (includes Docker Compose).
- Linux: Install the Docker Engine and then Docker Compose.
For Debian 13 (as an example), run the following as root:
apt update
apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian trixie stable"
apt update
apt install -y docker-ce docker-compose-plugin
systemctl enable docker && systemctl start docker
usermod -aG docker <YOUR-USER>
su - <YOUR-USER>Note: Replace <YOUR-USER> with your actual username.
2. ๐ Clone the Repository and Prepare Directories
Navigate to the parent directory where you want to store the project and the data folders. Then run:
cd <parent-dir-path>
mkdir NycTaxiBigFiles
mkdir NycTaxiPins
git clone https://github.com/AngelFelizR/NycTaxiYour directory structure should look like:
<parent-dir-path>/
โโโ NycTaxi/ # cloned repository
โโโ NycTaxiBigFiles/ # large data files (mounted into container)
โโโ NycTaxiPins/ # pin board storage (mounted into container)3. โ๏ธ Run the Setup Script
The repository includes a setup.sh script that automates all remaining steps: pulling the image, starting the container, and configuring SSH keyโbased authentication using your existing ~/.ssh/id_rsa.pub.
From inside the NycTaxi folder, run:
cd NycTaxi
chmod +x setup.sh
./setup.shThe script will:
- Pull the preโbuilt image
angelfelizr/nyc-taxi:4.5.2from Docker Hub. - Start the container in detached mode, mapping port
2222for SSH and mounting the three directories under/root/. - Register your public key (
~/.ssh/id_rsa.pub) inside the container so you can connect without a password.
#!/bin/bash
docker compose pull
docker compose up -d
docker compose cp ~/.ssh/id_rsa.pub nyc-taxi:/root/.ssh/authorized_keys
docker compose exec nyc-taxi chown root:root /root/.ssh/authorized_keys
docker compose exec nyc-taxi chmod 600 /root/.ssh/authorized_keys
echo "Ready! Connect with: ssh NycTaxi"You can verify the container is running with docker compose ps.
4. ๐ Configure SSH
Add the following to your ~/.ssh/config so you can connect with a simple alias:
Host NycTaxi
HostName 127.0.0.1
User root
Port 2222
IdentityFile ~/.ssh/id_rsa
Then connect with:
ssh NycTaxi5. ๐งโ๐ป Using Positron (or VS Code) with direnv
Since direnv is configured via the .envrc file in the repository, you can use Positron with the SSH remote development feature to work directly inside the container.
- In Positron, select โConnect to Hostโฆโ (or use the Remote Explorer).
- Enter
root@localhost:2222and authenticate using your SSH key (configured in Step 3). - Once connected, open the folder
/root/NycTaxi. - Install the direnv extension by mkhl from the Open VSX Registry. This extension automatically activates direnv when you open a folder containing an
.envrcfile.
After the extension loads, you should see a notification confirming that direnv is active. At that point, any terminal you open inside Positron will have the Nix environment loaded automatically.
To make the R interactive console use the Nix environment instead of the system default, open the Positron command palette and switch the active R interpreter to the one provided by the Nix shell. Once selected, the console will have access to all the R packages defined in default.nix.
6. ๐ฆ Remote Pin Board (Optional)
If you need to use the shared pin board, create a cache directory on your host (outside the container) and then, inside R, set up the board as follows:
# On your host (in <parent-dir-path>)
mkdir NycTaxiBoardCacheIn your R session (inside the Nix shell), use:
BoardRemote <- board_url(
"https://raw.githubusercontent.com/AngelFelizR/NycTaxiPins/refs/heads/main/Board/",
cache = here::here("../NycTaxiBoardCache")
)The cache directory is mounted into the container at /root/NycTaxiBoardCache, so pins will be stored on your host and persist between container restarts.