Linear regression

Compile and sample a small linear regression with pystanwasm, via Quarto Live – interactive {pyodide} code blocks in an ordinary Quarto document. Same bridge as the other demos.

Everything runs in a single block: Quarto Live tries to share Python state between separate {pyodide} blocks on a page by serializing the global namespace between them, which breaks once that namespace holds a live JS object reference (pyodide.ffi.JsProxy, unhashable/unpicklable) – as pystanwasm’s bridge does internally to cache the loaded wasm module. A single block sidesteps that entirely.