Pablo Reyes

Data Scientist · Universidad Mayor · Santiago, Chile

This profile collects work and personal projects organized by the kind of problem they solve: forecasting, catching anomalies, anticipating failures, measuring causes, optimizing, managing risk, getting data in order, and working with text and images. The point is to show the different ways a data scientist can help an organization, in mining, energy, finance, retail or pensions.

The same rules apply throughout: the code runs end to end, the numbers come from that run, nearly every repo has tests and CI, and negative results are published like positive ones.

Featured projects

Four projects on real data with a finding that was not the expected one.

Panic-switching pension funds

real data

24 years of daily unit values, in UF. Switching to Fund E at the bottom of a crash costs 1.9 points of real return a year; switching earlier gets the same Sharpe as a static mix: there is no timing, there is less equity.

duckdbcounterfactual-analysisbehavioral-finance

Causal impact in a mining fleet

real + simulated

Did the maintenance program work, and on which trucks? On real sensor data from 60,000 Scania trucks, the default DRLearner collapses (r = −0.01); the cause was isolated and it recovers to 0.61–0.79.

causal-inferenceeconmldifference-in-differences

Retail demand as an inventory decision

real data

3,000,888 sales rows. A quarter of the "zero demand" was stores that had not opened yet, and the model with the best metric leaves a stockout on 41% of store-days.

demand-forecastinglightgbmquantile-regression

A/B experimentation lab

Monte Carlo

Checking an A/B test every day inflates the false-positive rate from 5% to 24.2%, and the Bayesian rule usually assumed "safe" barely helps (20.5%).

ab-testingcupedsequential-testing

Open-source tool

datoschile: Chilean public data in one line

A Python library to download the UF, dollar, copper, pension fund unit values and CMF bank delinquency, clean and in a DataFrame. It fixes real source errors, like the dollar leaking into the UF in 2014 or the CMF Excel files' three layouts, and checks every week that the sources haven't changed.

import datoschile as dc

dc.indicadores.uf(desde=2020)
dc.pensiones.indice(fondos="A", desde=2008, real=True)
dc.cmf.morosidad(solo_sistema=True)
pythonpandasopen-datadata-cleaning

Experience

Fuel control for a bus fleet

real job, fictitious sample data

Each of the 17 depots tracked fuel in its own Excel file. First I wrote a Python script that merges the sheets, computes each bus's km per litre against its previous load and flags the ones outside their model's range. Then an AppSheet app that replaced the sheets: operators record loads, pump readings and tanks from their phone, and the app computes per-pump consumption, theoretical stock and AdBlue. Reviewing the code, I fixed three bugs: dates sorted wrongly across months, buses left without a range because of how the standard was written, and every bus's first load flagged by mistake.

pythonpandasappsheetexceldata-cleaning

Projects by kind of problem

34 projects. Each states whether it uses real or simulated data.

1.Forecasting what comes next

Chile's power grid, hourly

simulated

Solar, wind, demand and marginal cost at 5 nodes. Solar: 3.64% WAPE vs 26.95% naive; on wind, naive wins.

lightgbmoptunatime-series

Copper volatility

real data

14 years of real LME prices: GARCH(1,1) has the best QLIKE and only HAR-X, with the VIX and the dollar, ties it. CatBoost re-tuned in every fold does not beat it.

garchcatboostshap

2.Catching fraud and anomalies

Fraud and AML lab

real + simulated

ROC-AUC makes a model with 3.4× worse PR-AUC look almost equal (0.931 vs 0.965); label-free graph AML: ROC-AUC 0.893.

fraud-detectionamlxgboost

Public procurement anomalies

real data

13.7 M ChileCompra order lines: Compra Ágil orders pile up under the cap and the pile moved with the law, but there is little sign of split purchases. Isolation Forest finds 38.8% of planted anomalies reviewing 5%.

public-procurementbunchingisolation-forest

3.Anticipating equipment failure

Predictive maintenance (SCANIA)

real data

23,550 trucks: −31% official cost on test, but the saving runs out if a visit costs double, because the model overstates risk.

predictive-maintenancesurvival-analysisshap

Failure from continuous signal

real + simulated

Bearings (NASA IMS) and seismic signal (LANL): spectral features with boosting beat a CNN by 2.7×.

remaining-useful-lifesignal-processingfft

SAG mill digital twin

simulated

Kalman estimates ore hardness with 79% less error; 24 h energy forecast 27.6% better than Holt-Winters.

digital-twinkalman-filterlightgbm

4.Measuring causes and evaluating decisions

A/B experimentation

Monte Carlo

Sample size, SRM, CUPED and multiple testing, with a harness that checks each rule's error rate.

ab-testingcupedpower-analysis

Pension funds

real data

A regime signal that "earned" 1.4–2.3% a year ties a static mix on Sharpe out of sample. In real terms, 2021–23 fell 26%.

duckdbcounterfactual-analysispensions

5.Optimizing operations

Flotation plant

real data

Real iron-ore plant: R² 0.83 on a random split is -0.43 in time order; only recent lab results beat persistence, and four models prescribe opposite pH moves.

soft-sensorwalk-forwardoptimization

Last-mile logistics

real districts, simulated demand

Multi-depot routing with time windows over real polygons: 0 of 173 zones unserved.

or-toolsvrptwh3

6.Measuring and managing financial risk

Credit risk lab

real macro, simulated portfolio

26 techniques: R+Python+C scorecard at 270.6M rows/s, IFRS 9 PD, bias audit and a shadow/canary/retraining lifecycle.

scorecardifrs9mlops

Crypto quant lab

real data

Eight techniques. All five strategies lose after costs; spoofing detection works (0.92 precision).

quantitative-financecointegrationnlp

7.Getting the data in order

8.Classifying and estimating

9.Text, language and images

Tools

LanguagesPythonSQLRC++CC#JuliaGoRubyDatapandasPolarsNumPyDuckDBdbtParquetPydanticJupyterML & statisticsscikit-learnLightGBMXGBoostCatBoostPyTorchSciPyOptunaPlotlyLanguage, vision & edgeLangChainHugging FaceUltralytics YOLOONNXRaspberry PiProductionFastAPIStreamlitMLflowDockerGitHub ActionspytestPrometheusGrafanaGitLinux