Applied experimentation

Code ↔ Visualisation Synchronisation

See the complete reusable Python functions behind the experiment, change visual controls to regenerate the script, or edit the recognised configuration assignments and apply them back to the visual.

Lab concept guide

What to observe while you experiment

The visual controls and the Python code are two representations of the same experiment configuration. Synchronisation is trustworthy only when a change in one representation maps unambiguously to the other and produces the same experimental state.

MechanismChange one recognised visual control, inspect the generated Python assignment, then edit that assignment and apply it back to the visual state.
Failure modeAssuming arbitrary Python edits can be reverse-mapped to controls, or allowing the code and visual state to silently diverge.
VerificationRound-trip one parameter visual → code → visual and confirm the final value, then run both paths and compare the resulting configuration/output.
Experiment deliberately
Pick one model or dataset parameter. Change it visually, copy the generated code, edit the same assignment, apply it, and verify the visual returns the edited value.
Complete Python is shown; execution remains browser-side JavaScript. The generated script is valid scikit-learn-style Python designed to reproduce the same workflow locally. The visual engine mirrors the experiment without requiring a server-side Python runtime.
Ready.
Reusable function map

Trace the program from data to visual output

Each function has one responsibility. Step through them to see how the complete experiment is composed.

make_demo_dataset()Generate X and y.
prepare_data()Split and scale without leakage.
build_model()Construct the chosen estimator.
train_model()Fit on training evidence.
evaluate_model()Predict and calculate metrics.
plot_decision_boundary()Draw the learned separator.
run_experiment()Orchestrate the complete workflow.
1/7make_demo_dataset()
Generate X and y.

Complete reusable Python script

Edit dataset, model_name, noise, seed, k or max_depth; all reusable functions remain visible below.

Synchronised model geometry

The observations stay fixed; changing a model or hyperparameter changes the learned separator.

Controls → full codeEvery supported visual setting rewrites the complete reusable Python program.
Code → controlsApply code reads the configuration assignments from the full script and rebuilds the visual.
Functions → workflowStep mode shows why separate functions make the experiment easier to test, reuse and debug.