Select the most profitable of three candidate regions for drilling 200 new oil wells under a $100M budget, keeping the probability of loss below 2.5% — quantified with bootstrap resampling instead of a point estimate.
TripleTen Data Science bootcamp project. Python · pandas · scikit-learn · NumPy · matplotlib/seaborn.
A petroleum operator surveyed three regions (~100,000 wells each, three geological features + known reserve volume) and must choose one region to develop:
| Constraint | Value |
|---|---|
| Development budget | $100,000,000 |
| Wells to drill | 200 (selected from 500 explored) |
| Revenue | $4,500 per unit (1 unit = 1,000 barrels) |
| Risk tolerance | < 2.5% probability of loss |
Break-even works out to 111.1 kbbl per well — and every region's average well sits below that. Profitability depends entirely on picking above-average wells, which makes prediction noise a first-class business risk.
- Train a linear regression per region (75/25 split, fixed seed) to predict reserves.
- Compute the break-even threshold from the economics.
- Bootstrap the actual decision process, 1,000 iterations: sample 500 wells → rank by predicted reserve → take the top 200 → realize profit against their true reserves.
- Recommend the region with the highest expected profit among those under the 2.5% risk threshold.
Model quality per region (validation set):
| Region | Mean predicted (kbbl) | RMSE | R² |
|---|---|---|---|
| Region 1 | 92.79 | 37.85 | 0.272 |
| Region 2 | 69.18 | 0.89 | 1.000* |
| Region 3 | 94.87 | 40.08 | 0.196 |
* Region 2's near-perfect R² comes from one synthetic feature being almost perfectly correlated with the target — a property of this dataset that would not generalize to real geological surveys. Flagged in the notebook rather than presented as modeling skill.
Bootstrap risk analysis (1,000 simulations):
| Region | Expected profit | 95% CI | Risk of loss | Meets <2.5%? |
|---|---|---|---|---|
| Region 1 | $3.81M | −$1.43M … $8.91M | 7.70% | No |
| Region 2 | $4.78M | $0.90M … $8.67M | 1.20% | Yes |
| Region 3 | $3.31M | −$1.90M … $8.40M | 11.30% | No |
Recommendation: Region 2. Its model predicts reserves almost exactly, so the top-200 selection actually lands on profitable wells — high-variance Regions 1 and 3 have higher naive profit estimates but fail the risk constraint.
A naive top-200 estimate says Region 1 wins ($33.7M vs Region 2's $24.2M). An earlier version of this analysis also bootstrapped over the already-selected top-200 wells, which implicitly assumes you know in advance which wells are best — and reported an artificially low ~0% risk everywhere.
The corrected bootstrap simulates what an operator can actually do (explore 500, pick 200 by prediction, live with the prediction error), and it reverses the recommendation: the region with the lowest average reserves wins on a risk-adjusted basis, because its predictions are reliable. For a $100M capital decision, modeling the decision process honestly matters more than the model's headline metric.
notebooks/main.ipynb # full analysis: EDA → modeling → break-even → bootstrap → recommendation
geo_data_0/1/2.csv # the three regional survey datasets (~100k wells each)
environment.yml # conda environment
requirements.txt # pip alternative
Run it:
conda env create -f environment.yml && conda activate projects_env
jupyter notebook notebooks/main.ipynbThe notebook also runs on Databricks (data path resolves automatically).
Built by Julio Alexis González Villa — AI Engineer · Machine Learning Engineer.