L. Mansfield

Selected work · 2026

Projects.

Builds I’m proud of: a fraud-detection pipeline, a multiplayer park, a plain-English SQL tool, a local-first desktop app, forecasting models, and a few smaller tools. Each one runs end to end, from source data to something a person can use.

The three I’d show first
SQL source
SELECT title, badge, eyebrow, year, summary, tags
FROM projects
WHERE featured
ORDER BY sort_order;
  1. raw Page markup
  2. staging Parsed page rows
  3. mart projects

This query writes what’s shown above, from the site’s own tables; a check fails the build if it ever stops matching. See its checks.

More builds

Analytics, forecasting, and tools

Desktop app

2026

Lighthouse v0.15

A local-first desktop app that answers questions about a small group of files, with citations back to the passages it read. A Rust engine in a Tauri 2 shell handles extraction, on-device OCR and embeddings, and hybrid retrieval. A question over a spreadsheet becomes one read-only SQL query, run by DataFusion and shown verbatim. Use the bundled private model or bring your own key. Installers for Windows, macOS, and Linux.

  • Rust
  • Tauri 2
  • DataFusion
  • Next.js
Case file · problem, fix, result
Problem
Getting answers from a small set of private files without sending them to a server.
Fix
A Rust engine handles extraction, on-device OCR, embeddings and hybrid retrieval. A question about a spreadsheet becomes one read-only SQL query, run by DataFusion and shown verbatim.
Result
Version 0.15 ships installers for Windows, macOS and Linux, and every answer cites the passage it came from.

Forecasting · Machine learning

2026

Attendance Forecasting

Daily theme-park attendance forecast from weather, calendar, and flight-traffic features. A blend of gradient-boosted trees, ridge, and random forest selected by rolling-origin cross-validation beat a tuned XGBoost by about 6% MAE out of fold and cut mean bias from +90 to −7 guests a day. The last 30 operating days are held out as an unseen live forecast with an 80% planning band from pooled out-of-fold ratios.

  • Python
  • XGBoost
  • scikit-learn
Case file · problem, fix, result
Problem
A tuned XGBoost model was the daily attendance forecast to beat.
Fix
A blend of gradient-boosted trees, ridge and random forest, chosen by rolling-origin cross-validation.
Result
About 6% lower MAE out of fold than the tuned XGBoost. The last 30 operating days are held out as an unseen live forecast with an 80% planning band.
  • Mean bias, guests a day +90 → −7

Forecasting · Machine learning

2026

USL Attendance Forecasting

An XGBoost demand model on nine seasons of USL Championship matches, on a staged DuckDB warehouse (raw → staging → marts). Two models share every upstream table and differ only by league-position features, so the error gap measures what promotion and relegation will do to attendance from 2028.

  • Python
  • XGBoost
  • DuckDB
Case file · problem, fix, result
Problem
USL promotion and relegation start in 2028, and there is no data yet on what they do to attendance.
Fix
Two XGBoost models share every upstream table on a staged DuckDB warehouse and differ only by league-position features.
Result
The error gap between the two models is the measuring stick, set as a baseline before promotion and relegation begin.

Data quality · Pipeline

2026

Roll Call

A daily manatee-count pipeline for Blue Spring State Park, built around its data-quality layer: freshness, volume, distribution, and cross-source checks that quarantine suspect observations, open incidents, and email what newly broke. DuckDB on a systemd timer; an Evidence dashboard on Vercel.

  • Python
  • DuckDB
  • Evidence
  • Resend
Case file · problem, fix, result
Problem
A daily manatee count is only useful if one bad observation can’t quietly skew it.
Fix
Freshness, volume, distribution and cross-source checks quarantine suspect observations and open an incident.
Result
It runs daily on a systemd timer, emails what newly broke, and publishes the count to an Evidence dashboard.

Learning project · Data assimilation

2026

Attendance Nowcast

A Kalman-filter nowcast of daily theme-park attendance: predict from yesterday’s state, then correct with today’s partial signals, weighting each by its uncertainty. Written up as a five-notebook series from the scalar filter upward.

  • Python
  • Kalman filter
  • Notebooks
Case file · problem, fix, result
Problem
A forecast made yesterday ignores what today’s partial signals already say.
Fix
A Kalman filter predicts from yesterday’s state, then corrects with today’s signals, weighting each one by its uncertainty.
Result
A five-notebook write-up that builds the filter up from the scalar case.

Analytics · Power BI

2025

Member Segmentation (RFM)

Recency, frequency, and monetary segmentation of membership data, modeled in SQL and reported in Power BI, to turn one big member list into groups a marketing team can act on differently.

  • Power BI
  • SQL
  • Segmentation
Case file · problem, fix, result
Problem
One big member list treats every member the same.
Fix
Recency, frequency and monetary scores modeled in SQL.
Result
Member groups, reported in Power BI, that a marketing team can treat differently.

Machine learning · Audio

2026

eFrog Retired

An audio-classification model that identified 19 Floridian frog species from a recording. The web app is retired; the model and code are still on GitHub.

  • Python
  • Audio ML

End-to-end pipeline

2025

Owl Park Data Architecture Archived

The first Owl Park: a simulated ticket-sales ecosystem where n8n agents role-played customers and managed stock, Supabase stored the orders, Microsoft Fabric modeled them medallion-style, and Power BI turned them into decisions. Retired, but the architecture diagram is still worth a look.

  • n8n
  • Supabase
  • Microsoft Fabric
  • Power BI
SQL source
SELECT title, badge, eyebrow, year, summary, tags
FROM projects
WHERE NOT featured
ORDER BY sort_order;
  1. raw Page markup
  2. staging Parsed page rows
  3. mart projects

This query writes what’s shown above, from the site’s own tables; a check fails the build if it ever stops matching. See its checks.

More, including learning repos for dbt, Dagster, Docker, and assembly, on GitHub →

How the data flows

Tap a stage to see what happens there and what runs it

Fraud Detection Pipeline

One run of the generator, from seed tables to raw tables in Supabase, scored by the rules and, since Nov 14, by a new real-time model too.

1 · Source Seed tables

Products, a pool of real guest profiles and a separate pool of fraudster identities, each tagged with the fraud pattern it plays, sit in Databricks seed tables. A Python script makes the identity pools; each run reads them once.

  • Databricks
  • Python

2 · Ingest Simulated checkouts

A Databricks notebook job simulates a window of Owl Park webstore traffic, by default an hour: about 120 normal orders plus fraud episodes worth about 3% of orders. The five patterns are card testing, stolen-card resale, gift-card cash-out, account takeover and fraud rings.

  • Databricks Jobs
  • Python

3 · Transform Order features

Orders are scored in time order so velocity counts are honest. Each one gets features such as cards seen on its device in the last hour, a headless browser, the gift-card share of the cart, an IP and billing country mismatch, and the account's age.

  • Python

4 · Score Rules model and checkout

Weighted rules turn the features into a 0 to 1 score with reason codes: approve, send to an identity check, or decline. The checkout is simulated too, with issuer declines and latency. If scoring takes over 150 ms the order fails open and is approved, so real guests are never stuck waiting.

  • Python
  • Rules model v0

5 · Load Four raw tables

Transactions, fraud decisions, checkout responses and fraud truth land in Supabase in one transaction, so a run arrives whole or not at all. Every column except the id and timestamp is nullable, so a partial row is kept for inspection instead of lost, and row-level security keeps the tables private.

  • PostgreSQL (Supabase)
  • psycopg2

6 · Score again New real-time model

Since Nov 14 a new model scores each checkout as it lands, beside the rules. For every order it writes a fraud probability, a flag and how long the scoring took to its own Supabase table, realtime_fraud_audit, keyed by the same transaction id, so both scorers can be judged on the same orders.

  • PostgreSQL (Supabase)

7 · Label Late fraud labels

Each order's truth row carries its real fraud flag, but the label only becomes available 5 to 60 days later, and only for fraud that got through, the way chargebacks do. With decisions, checkout responses and labels side by side, a query can measure the trade-off for each scorer: how much fraud was flagged, how many good guests were turned away, and how many orders failed open. The live page compares the two.

  • Python
  • PostgreSQL (Supabase)

Read the generator and table definitions on GitHub ↗

Owl Park

From a ticket sale to the analytics views, as the park runs today.

1 · Source Shopify store

Day Tickets and Annual Passes sell through a Shopify store. The buyer checks out in the store's own window, and Shopify keeps the buyer's details.

  • Shopify

2 · Ingest Signed webhooks

Shopify posts each paid order to a Cloudflare Worker, which checks the webhook's signature before reading anything, so a forged order never reaches the tickets, and a repeated webhook changes nothing. It then issues one ticket per unit into a ticket book kept in a Durable Object.

PlannedScore every paid order with the fraud pipeline before its tickets release, waiting up to 2 seconds and failing open.

  • Cloudflare Workers
  • Durable Objects (SQLite)

3 · Capture The park itself

Visitors walk the rooms as owls. An authoritative room server keeps every owl in sync over hibernating WebSockets, and the turnstiles let an owl in once its ticket scans. Visits, room stays, collectibles and ticket events all become rows.

  • Phaser 3
  • WebSockets

4 · Load Outbox to Supabase

Each event is written to an outbox in the same step as the action it records, then sent in batches. A failed send retries later, and event ids make a row sent twice land once. Visitors leave as salted hashes, never names or emails.

  • Durable Objects
  • Supabase Edge Functions

5 · Model Analytics schema

Rows land in a game schema shaped for analysis: a type 2 player dimension, where each change to an owl's kind or color opens a new version, beside session, room-visit and purchase fact tables.

  • PostgreSQL (Supabase)
  • SQL

6 · Serve Views for product questions

SQL views answer the questions a park owner asks: minutes and bounce rate per room, free versus paid visitors and when a free visitor converts, each order's status, and lifetime value per owl.

  • SQL views