Skip to content

AngelFelizR/NycTaxi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

127 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš• 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:

  1. ๐Ÿค” 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.

  2. โฐ 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:

  1. ๐Ÿš— Drive for Uber if possible
  2. ๐ŸŒ™ Work nights rather than mornings
  3. โŒ Reject trips that fall below our profitability threshold
  4. ๐Ÿ“… Avoid Mondays and Fridays if you have the flexibility
  5. ๐Ÿ—บ๏ธ 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:

Sequential Decision Analytics CRISPโ€‘DM Article Name
Core Elements of the Problem Business Understanding 1. Business Understanding Overview
Data Understanding 2. Data Collection Process
Business Understanding 3. Initial Exploration
From Defining Mathematical Model to Evaluating Baseline Policy Data Understanding 4. Simulationโ€‘Based Estimation of the Baseline Hourly Wage for NYC Taxi Drivers
5. Lookaheadโ€‘Based Labeling for Learning an Improved ADP Policy
Data Preparation 6. Expanding Geospatial Information
7. Expanding Transportation and Socioeconomic Patterns
Modeling and Evaluation 8. Training and Selecting Model To Implement
Defining and Evaluating New Policies Modeling and Evaluation 9. From Predictions to Policies: Integrating ML into Stochastic Optimization
10.Maximizing Driver Earnings by Selecting the Best Configuration and Time to Start
MLOps: Model Validation & Monitoring 11. Validating Policy Performance on Out-of-Sample (2024) Data
Deployment 11. Serving Model by a Shiny Web App (Planned)

๐Ÿ”ฎ 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:

  1. Reduced service quality: Drivers focusing solely on maximizing earnings may avoid less profitable areas or times, potentially leaving some passengers underserved.

  2. 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:

  1. ๐Ÿ”ง We use git to manage changes in the code and provide an interface to share the project on GitHub.
  2. ๐Ÿณ Docker and Nix are used to build a reproducible devโ€‘container based on default.nix. The container can be connected via SSH using a public and private key pair as defined in setup.sh, and the .envrc sets the Nix environment to use in the Positron console.
  3. ๐Ÿ“ฆ For modeling, we used the tidymodels framework to ensure we are following good modeling practices.
  4. ๐Ÿ“ 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, roxygen2 and devtools. This was especially important to ensure that the simulation function and the custom step function (which extends the recipes package) work correctly.
  5. ๐Ÿ“„ The project also follows the structure of a Quarto project and renders all articles into the docs folder, 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.
  6. ๐Ÿ”’ The .Rprofile overrides install.packages, update.packages and remove.packages to make clear that R packages must be defined in default.nix to ensure reproducibility.
  7. ๐Ÿ—ƒ๏ธ To manage data larger than RAM, we use duckdb and keep large files in a separate folder named NycTaxiBigFiles under the same parent directory as this repo.
  8. ๐Ÿ’พ To cache results generated during the investigation process, we use .qs2 files and track them with pins, stored under the folder NycTaxiPins in the same parent directory as this repo.
  9. ๐Ÿงน 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:

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/NycTaxi

Your 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.sh

The script will:

  • Pull the preโ€‘built image angelfelizr/nyc-taxi:4.5.2 from Docker Hub.
  • Start the container in detached mode, mapping port 2222 for 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 NycTaxi

5. ๐Ÿง‘โ€๐Ÿ’ป 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.

  1. In Positron, select โ€œConnect to Hostโ€ฆโ€ (or use the Remote Explorer).
  2. Enter root@localhost:2222 and authenticate using your SSH key (configured in Step 3).
  3. Once connected, open the folder /root/NycTaxi.
  4. Install the direnv extension by mkhl from the Open VSX Registry. This extension automatically activates direnv when you open a folder containing an .envrc file.

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 NycTaxiBoardCache

In 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.

About

This project transforms raw taxi trip data into a prescriptive decision-support tool designed to help drivers maximize their net hourly earnings. Rather than a simple classification task, the problem is framed as a Sequential Decision Analytics problem, following the framework proposed by Warren B. Powell.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors