Writing the Project Report

A project report connects the original question to the method, numerical and visual evidence, conclusion, and limitations. This lesson assembles the complete noisy-line project and produces a concise report whose claims can be traced back to the current run.

The project has produced code, a fitted slope, a loss, residuals, a figure, and a run record. A report connects those pieces to the original question:

Can a finite search recover a reasonable estimate of the slope behind noisy synthetic measurements?

A reader should not need to reconstruct the answer by reading every line of the program.

A run record and a report serve different readers

The structured run record preserves machine-readable fields:

configuration
computed results
software environment
project version

The report explains the investigation to a person:

question
method
evidence
result
limitations
reproduction information

They overlap, but they are not interchangeable. A JSON record may preserve every number while leaving the purpose unclear. A polished paragraph may be easy to read while omitting settings needed to reproduce the computation. A complete project keeps both.

Begin with one answerable question

A useful question identifies the data, method, and result being investigated:

How closely does the lowest-loss candidate slope match the known slope used to generate the noisy data?

Avoid questions that the project cannot answer:

Does this prove that every real dataset follows a straight line?

The project uses one synthetic process, fixes the intercept at zero, and inspects the same data used for fitting. It cannot establish a universal claim about real observations.

Describe the method at the level needed to understand the result

The method section should state consequential choices without narrating every line of Python:

  1. Generate six evenly spaced inputs from 0.0 through 5.0.
  2. Create measurements from a line with slope 2.0 and seeded normal noise with scale 0.25.
  3. Evaluate slopes from 1.5 through 2.5 in steps of 0.25.
  4. Compute mean squared error for each candidate.
  5. Select the first candidate with the smallest loss.
  6. Inspect the fitted line and pointwise residuals.

This description is shorter than the implementation but preserves the choices that determine the result.

Report measurements with enough context

Compare these statements:

The result was good.
The search selected slope 2.00. The generating slope was 2.00, the mean
squared error was 0.032, and the largest absolute residual was 0.33.

The second statement gives the fitted value, its known target, the loss, and a pointwise error scale. Another reader can inspect or challenge it.

Keep full numerical precision in the run record. Round values in prose and tables to a readable number of digits, but do not imply more precision than the candidate grid or data support. A grid spacing of 0.25 does not justify reporting the fitted slope as 2.00000000.

Connect the figure to a written observation

Do not insert a plot without explaining what the reader should notice. A useful figure caption or nearby sentence may say:

The fitted line follows the overall linear pattern. Residuals occur on both sides of zero, and no single residual is large relative to the plotted vertical range.

The sentence names visible evidence. It does not claim that the plot proves the model is correct.

If the figure shows a curve, one large outlier, or residuals that grow with x, say so. A report should preserve inconvenient evidence rather than describe only what supports the expected result.

State limitations beside the conclusion

The conclusion should be no broader than the investigation. For this project, important limitations include:

  • the data is synthetic;
  • the intercept is fixed at zero;
  • the noise follows one chosen distribution;
  • the search considers only a finite candidate grid;
  • the fitted result is inspected on the same data used for fitting;
  • the project does not measure performance on unseen data.

These statements do not weaken a sound result. They define what the result actually shows.

Use a compact report structure

A short technical report can use these sections:

# Noisy-Line Slope Fit

## Question

## Method

## Results

## Inspection

## Limitations

## Reproduction

The headings make missing evidence visible. For example, a report with results but no method gives no account of how those values were produced.

Generate prose from computed values carefully

Code can insert measured values into a report:

This is useful for numbers and stable configuration fields. Code should not invent an interpretation it did not test. A sentence such as "the residuals show no pattern" requires an actual inspection or a defined diagnostic, not merely a successful program run.

Separate computed statements from reviewed observations:

Assemble the complete project report

The following program performs the noisy-line project and builds a Markdown report from its configuration and computed results. The written observation is supplied explicitly after inspecting the residuals and figure.

Run the project and produce its report

The program keeps numerical calculations separate from the report template. Edit the configuration, rerun it, and compare the Method, Results, and Limitations sections.

Ready to run.

The fitting function receives only x, y, and the candidate slopes. The report compares its returned estimate with config.true_slope afterward. This keeps the known generating answer outside the selection procedure.

To preserve the report outside Browser Python, run the project locally and write the returned text:

Review the report against the code and record

Before treating the report as complete, verify:

  1. Every reported number comes from the current run.
  2. Configuration values agree with the machine-readable record.
  3. The method describes the actual candidate grid and loss.
  4. The figure uses the same measurements and fitted slope.
  5. The observation names evidence visible in the figure or diagnostics.
  6. The limitations match what the project did not test.
  7. Rounded display values have not replaced full-precision stored values.

This check prevents a common failure: rerunning the code while leaving an old number or sentence in the report.

Exercise: Choose an answerable project question

Which question can this project answer directly?

Choose the answerable question

Select one choice, then check.

HintMatch the question to the evidence

The program uses synthetic data from one known line and one candidate search.

SolutionAsk about the controlled run

The project can compare its fitted slope with the known slope for this synthetic run. It cannot establish universal shape or causal claims about real systems.

Exercise: Choose a precise result statement

Which sentence reports the result with useful numerical context?

Choose the result statement

Select one choice, then check.

HintInclude estimate, target, and evidence

A reader should be able to see what was fitted and how disagreement was summarized.

SolutionReport the numerical comparison

The first sentence identifies the fitted slope, known target, and MSE. The other statements cannot be checked against the run record.

Exercise: Distinguish a report from a run record

Which item belongs primarily in the human-readable report?

Choose the report content

Select one choice, then check.

HintThink about the human reader

The run record preserves structured values; the report explains what those values show.

SolutionThe report contains reviewed interpretation

A concise interpretation belongs in the report. Structured numerical fields belong in the run record, though selected values should also appear in the report with labels and context.

Exercise: State an important limitation

Which limitation applies to the result in this chapter?

Choose the real limitation

Select one choice, then check.

HintAsk whether new data was tested

The fitted line and residual figure use the measurements supplied to the candidate search.

SolutionThe inspection is in-sample

Fitting and inspection use the same measurements. The report should not claim that this result demonstrates generalization to unseen data.

Exercise: Complete a numerical result section

Complete build_result_section so it inserts the computed values into a short Markdown table. The supplied result must include:

| Fitted slope | 1.95 |
| Mean squared error | 0.0420 |

Build a report section from computed values

Ready to run.

HintFormat each value for its display role

Use {fitted_slope:.2f} and {loss:.4f} inside an f-string.

SolutionInsert measured values into labelled rows

The function builds the section from its arguments rather than hard-coding a previous run. Two decimal places match the slope grid's useful precision, while four make the small loss readable.

Make every conclusion traceable

A report should preserve this path:

question
→ method
→ computed and visual evidence
→ bounded conclusion
→ stated limitations
→ reproduction information

Every important claim should point backward to evidence, and every reported value should point backward to the current run. That traceability turns a working script into a technical result another reader can inspect.