Review
Core workflow
configuration -> data -> computation -> plot -> summary
Experiment as a script
Use a main-like workflow so the experiment reads in order.
Keep configuration visible:
config = ExperimentConfig(seed=4, points=8, true_slope=2.0, noise=0.2)
Inputs, outputs, and checks
Name inputs and outputs before trusting a result.
Useful checks:
Noisy linear data
The experiment uses:
y = slope * x + noise
Synthetic data lets you know the hidden truth.
Fitting by search
For each candidate slope:
Choose the slope with the lowest loss.
This chooses only among the supplied candidates, with the intercept fixed at zero.
Plotting
Plot both:
- noisy data points;
- fitted line.
Then write what the plot shows.
Saving a summary
Save enough to understand or rerun the experiment:
- seed;
- points;
- true slope;
- fitted slope;
- loss;
- observation.
Reading code as a report
A reader should be able to answer:
- What was fixed?
- What was varied?
- What was measured?
- What did the plot show?
- What result was recorded?