How the forecast
is built.
Daily forecast across 9 of every 10 California surf spots — 237 of 260 ocean-facing beach groups, plus 68 of 81 bay and lake monitoring sites. Beaches without a lab test in the past 30 days show their latest official sample instead of a rating.
Numerically grounded by default.
Label policy
The forecast label is marine enterococcus exceedance. Culture samples (MPN/CFU) use the 104 single-sample STV. ddPCR results (copies/100mL) use the 1413-copy molecular threshold. A prior bug compared ddPCR copies to the culture number and false-flagged most San Diego rapid-test samples; that bug is fixed. Freshwater E. coli and total/fecal coliform stay in the warehouse. They are outside the pooled label.
Daily forecast
The pipeline refreshes once each morning. It is a batch forecast that cannot react to an intra-day spill after publication.
What is served
Each beach’s rating starts from the share of its lab tests over the past 12 months that exceeded the safety limit. We shrink that share toward the statewide average (per-beach lookup, p = (pos + 5·g)/(n + 5)). Since 2026-10-02 the served estimate is logistic model v2 (logit-lookup-offset-v2). Formula: logit(p) = logit(lookup) + b0 + b1·R + b2·R·F + b3·W + b4·S + b5·ddpcr + b6·R·ddpcr. R is how far the last result was above or below its own limit on a log scale. F is how recent it is. W is rain in the 72 hours before 5 AM. S is the season. ddpcr is 1 when the beach’s last test was a ddPCR test. From 2026-09-28 through 2026-10-01 v1 had no ddPCR terms. The lookup from 2026-09-22 is the offset and the automatic fallback. We refit every morning on four years of lab results. A beach is never rated Low if its last test exceeded (never below 20%). An active county advisory raises the rating to at least High (30%). Band cutpoints are unchanged. If the model cannot fit on a given day, we serve the plain lookup and the pipeline raises an alert.
Calibration
Public-facing bands come from calibrated exceedance probabilities. Unsupported stations do not receive a colored risk claim or a fallback model badge on public surfaces.
Measured performance
We ran a year-long walk-forward test from 2025-09-01 through 2026-10-07. We refit monthly and scored the first lab result 1–3 days after each forecast (n = 78,591 forecasts, 609 beaches). Served v2 beat the plain lookup. Within-beach AUROC measures how well a model tells a beach’s dirty days from its clean days; 0.50 is a coin flip. Served v2 scored within-beach AUROC 0.647, AUROC 0.852, AUC-PR 0.590, and Brier 0.0725. The lookup alone scored within-beach 0.448, AUROC 0.827, AUC-PR 0.539, and Brier 0.0770. Last result alone (persistence) scored within-beach 0.522. On 27 beaches with a lab test every 1–2 days (17 Los Angeles, 10 San Diego), served v2 scored higher. Within-beach AUROC was 0.737 (Los Angeles) and 0.743 (San Diego) versus 0.647 statewide. On the Apr–Sep 2026 overlap window served v2 scored AUROC 0.864. The lookup scored 0.863 and the ML that served then scored 0.804. Realized exceedance per band in that window: Low 4%, Moderate 19%, High 37%, Very High 87%. At the Low cutoff served v2 misses about as many exceedances as the lookup. It gives roughly a quarter fewer false alarms.
Tested, shelved, and re-tested
We hold candidates to a verified-improvement bar. We report what did not clear it. A per-beach layer on top of the fresh-sample forecast did not help on sample-days. The same per-beach anchoring helped between samples. It served the stale majority in a two-tier system from July through September 2026. We tested cross-region (Texas) pooling and an LSTM and rejected both on held-out beaches. On 2026-09-22 we retired the two-tier ML from serving after it lost to the per-beach lookup on forward outcomes. On 2026-09-28 a logistic layer on top of that lookup replaced it after a year-long walk-forward test. On 2026-10-15 we ran a weather-only backtest with six days of coastal weather and no lab history. Weather alone reached within-beach AUROC 0.615 (neural network) but did not clear our bar to change serving. Weather plus served v2 scored within-beach AUROC 0.648 versus 0.647 (interval −0.001 to +0.004). We also tested a neural-network adjustment on top of the served model with lab history and weather. It scored within-beach AUROC about +0.013 better in the backtest. We do not serve it because the gain is small and it most likely fits noise in the lab results.
The weather-only experiment (2026-10-15) tests six days of coastal weather with no lab history. Weather carries signal but did not clear the bar to change what is served.
Beach track record and official postings, side by side.
Shorelife runs two parallel feeds. The rating starts from each beach's own exceedance rate over its past 12 months of lab tests. We adjust it for the latest result, recent rain, season, and ddPCR status when the last test used ddPCR. A second pipeline scrapes the live advisory page that each county health department publishes. That feed gives same-day visibility into Postings, Closures, and Rain Advisories. The statewide data.ca.gov export is frozen. Its newest sample is dated 2026-03-05, so it publishes no status changes at all. Live results now arrive from the BeachWatch database (beachwatch.waterboards.ca.gov, added July 2026) and CEDEN/SafeToSwim.
12 counties live-scraped
San Diego, Orange, San Mateo, LA, Marin, Long Beach, East Bay Parks, Ventura, San Francisco, Humboldt, Sonoma, and San Luis Obispo. Monterey and Santa Barbara still rely on the state feed. Monterey blocks datacenter traffic. Santa Barbara does not publish current postings on the public web.
Direct or AI extraction
San Francisco ingests directly from its Socrata API. Humboldt and Sonoma use structured-output LLM extraction. San Luis Obispo is rendered with a headless browser before extraction. All 12 counties fall back to the state feed if the county source fails.
County-direct sample feed
A second parallel feed, county_direct_samples.parquet, captures numeric enterococcus and coliform values each county publishes. It is independent of the BeachWatch sample archive. San Francisco’s results are merged into training labels from it. That cut that county’s serving anchor from ~30 days stale to ~2. Coverage is narrow. Sonoma and Humboldt in the file stopped publishing in May 2026.
AB411 single-sample triggers
Some counties publish raw values rather than a posted/not-posted flag (SF, Humboldt, Sonoma). Shorelife applies the same California AB411 thresholds those counties use: ENT ≥104, FECAL ≥400 MPN/100mL.
Advisory band, not model band
When the county marks a station Posted or Closed, the public surface shows a purple Advisory band with the cause. We link back to the county source. A model-derived risk band never overrides that posting.
Stale records auto-demote
When a first-class county scraper succeeds, we move any state-feed record for that county that the county no longer affirms to historical status. That closes a failure mode where year-old admin entries kept showing as active.
What this estimate can't do.
- 01It rates a beach's track record adjusted for its latest result and the 72 hours of rain before the morning update. It cannot see a spill, or rain that falls after the update; posted advisories can.
- 02Forecasts complement official monitoring; they do not replace county advisories.
- 03Only a subset of beaches currently has model coverage; the rest should be read as latest-official-sample views, not forecast gaps filled by guesswork.
- 04Heavy storm, sewage, or spill events can outrun any historical statistical model, especially after the morning publish cutoff.
- 05The numeric risk comes from each beach's lab history and measured rainfall, not from a forward weather forecast. A 2026-10-15 backtest showed that past weather alone carries signal, but we did not change the served model.
Sources and prior work.
- [1]Searcy, R. T. & Boehm, A. B. (2021). A day at the beach: enabling coastal water quality prediction with high-frequency sampling and machine learning. Water Research · DOI: 10.1016/j.watres.2021.117051 ↗
- [2]U.S. EPA. Virtual Beach 3 (VB3): User Guide. Enterococcus-based per-station MLR as production baseline. EPA VB3 Reference Manual ↗
- [3]California Department of Public Health. AB411 Annual Beach Report. County advisory thresholds and official culture-based sampling protocol. CDPH AB411 / Beach Monitoring Program ↗
- [4]NOAA National Data Buoy Center (NDBC). Real-time and historical wave, wind, and sea surface temperature observations used as model covariates. NDBC · noaa.gov/ndbc ↗
- [5]Scripps Institution of Oceanography. Coastal Data Information Program (CDIP). Nearshore wave model output and buoy telemetry. CDIP · cdip.ucsd.edu ↗
- [6]Open-Meteo. Open-source weather API — hourly UV index and solar radiation used for solar inactivation index feature. Open-Meteo API · open-meteo.com ↗