Milestone 3 of 8
Generate the repeatable observed data
Generate nine identified inputs with one local random generator, save exact variation and observations, and verify bounded same-seed replay.
The observed values should be reproducible without pretending that the added variation disappeared. Save the exact generated arrays and the rule that made them.
Goal
Generate the nine inputs, source-line values, bounded variation, and observed values with one local random generator. Save and replay the data from the configuration.
Inputs
Use the validated configuration, src/data.py, and one local generator
created from the configured seed. Construct nine evenly spaced inputs from
-2.0 through 2.0, calculate the source line, and draw variation from the
half-open interval [-noise_bound, noise_bound).
The generated record must retain input, source value, variation, and observed value. The source slope and intercept are generation settings, not values that the project asks you to recover from the observations.
Deliverables
Implement a data-generation function in src/data.py that returns the four
aligned arrays and the relevant generation evidence. Save
output/generated_data.csv with one row per input and columns for input,
source value, variation, and observed value.
Record the data identity, seed, input construction, and noise boundary in the report or the later manifest. The function must create its generator locally from the passed configuration; do not use a global random state.
Checks
Check that there are exactly nine inputs, that they are evenly spaced and include both endpoints, and that every observed value equals source value plus variation. Check finite values, the inclusive lower bound, and the exclusive upper bound of the supplied half-open interval.
Generate twice from the same configuration and compare all arrays. Generate with a changed seed and confirm that the recorded configuration explains the different variation without claiming that every value must differ. Check that the configuration and input arrays are not mutated.
Workspace
Keep data generation in src/data.py; use the accepted configuration from
src/config.py. Write the CSV under output/ and keep its row order aligned
with the input array. Do not place generated data beside the supplied plan.
Hints
HintSave the variation itself
HintOne generator, one clear boundary
Review
Open two rows in the CSV and calculate observed value from source value and variation. Explain what same-seed replay establishes and why a changed seed is only a controlled change in this supplied generator.
How to check your work
Checks compare the generated arrays and CSV columns with the supplied fixture. The supplied fixture preserves exact variation; it does not ask you to infer the hidden source line.