Skip to content
Senghak Rou
All projects

Scientific Computing & Software · Nov 2026 – present

Data Science Lab

Follow a model from its equations to a working implementation. Four interactive labs connect mathematical lessons, browser experiments and real Python runs that expose intermediate values.

Status
In developmentFour topics on the feature branch. Python execution verified with a local FastAPI service.
Setting
Individual projectPersonal project
My role
I wrote the lessons, browser mathematics, visualizations and Python tracing engine.
Methods and tools
TypeScript · Next.js · Three.js · FastAPI · NumPy · PyTorch · scikit-learn

4 topics

Linear and logistic regression, K-Means and neural networks

Each topic has a lesson, playground and executable Python implementation.

From an equation to a running model

Why does a larger learning rate make a fitted line oscillate? How can a network learn XOR when a linear classifier cannot? Data Science Lab lets a learner change one quantity, see its effect and inspect the computation responsible.

Learn develops the mathematics with worked examples. Playground runs seeded TypeScript experiments in the browser. Code Lab sends an experiment identifier and bounded numerical parameters to a FastAPI service. The service runs the displayed Python template and records values after marked steps. A frontend alone supports reading and browser experiments. Python runs require a reachable backend.

Data Science Lab · three ways to inspect a model Each topic links a mathematical lesson, a seeded browser experiment and a Code Lab. Only Code Lab requests Python execution. FastAPI validates parameters, runs the marked template, then returns source and trace deltas to the browser inspector. In the browser Python service Learn equations and worked examples Playground seeded TypeScript steps and plots Code Lab choose template and parameters id + numbers FastAPI check types and bounds run marked Python record watched values source + trace deltas rebuild and check step inspector and plots
Figure 1 · SchematicLearn and Playground work in the browser. Code Lab adds a round trip to Python so a plotted state can be checked against the lines that produced it.

What a learner can inspect

ExperimentWhat changes on screen
Linear regressionMove the fitted line or change the learning rate. The residuals, contour plot and 3D quadratic loss surface show the same parameters.
Logistic regressionMove the probability threshold to change the decision boundary and confusion counts. Compare ranking, classification and calibration on a stratified split.
K-MeansFollow Lloyd’s assignment and centroid updates. A three-feature example shows clusters that overlap in a two-dimensional projection.
MLP and backpropagationInspect hidden activations on XOR, moons or circles. Step backwards through a computational graph to see how local derivatives determine a weight update.
MLP playground showing XOR samples, the fitted decision surface, training history and hidden-unit responses.
Full size screenshot 2 (opens in a new tab)
Figure 2 · ScreenshotEach hidden unit responds along a different direction. The output combines those responses into a nonlinear boundary.Source: Local browser playground, feature branch 478b398.
Logistic regression lesson with threshold controls, a confusion matrix and an ROC curve.
Full size screenshot 3 (opens in a new tab)
Figure 3 · ScreenshotThe learner can change the decision threshold on a fixed test split and see which predictions change class.Source: Learn environment at 478b398, two-feature classification example.

Checking the numbers

The trace carries the executed source and changes to watched variables. The browser rebuilds the states and checks derived values against them. In the MLP experiment it reconstructs hidden-layer matrices from traced parameters and compares per-unit summaries. PyTorch supplies gradients through autograd. A scikit-learn fit appears as a library call, with its fitted result available for comparison.

MLP Code Lab showing executed NumPy source, the current step and the trace inspector.
Full size screenshot 4 (opens in a new tab)
Figure 4 · ScreenshotA local FastAPI run supplies the values for this NumPy trace.Source: Python service and web interface at 478b398, synthetic data.

The tests compare analytic gradients with finite differences, browser trajectories with NumPy fixtures, and PyTorch backpropagation with explicit NumPy updates from the same weights. These checks cover the implemented examples. The catalogue also lists planned topics. This page describes the four working modules on the development branch.

Individual contribution

Apr – May 2026Completed

Likelihood-free inference for log-normal sums

Bayesian inference for a model whose likelihood has no closed form, by simulation: rejection and MCMC versions of approximate Bayesian computation, compared on accuracy and cost.

Statistics & Econometrics · Team of 3 · Python, JAX, NumPy

Oct 2026Completed

Predicting turbofan engine life

Predicts how many cycles a simulated jet engine has left from its recent sensor history, and tests when those predictions are reliable enough to raise a maintenance warning.

Machine Learning & Forecasting · Individual · Python, PyTorch, scikit-learn