Choosing and Checking a Model

Keep preparation tied to the training data

BOTIE

Compute the training mean, then subtract it from the held-out reading vector.
Ready to test
0 passed · 0 failed · 1 not run

An empty floor. Start with the information your machine needs.

Received result

Your answer will arrive here.

Examples, experiments and workspace controls
Live values

Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.

Try your own inputs

Change a held-out reading and inspect the centring reference. Should test data be able to change a reference fitted on training data? Follow the two sources separately to check your construction.

Start at an output arrow, then click or drag to an input. Drag empty space to pan. Delete removes a selection. Ctrl/Cmd+Z undoes a change.
Context for this challenge

Compute the training mean, then subtract it from the held-out reading vector.

A prediction for a new observation needs the same preparation used during training. We will learn a centring reference from the training rows, apply it to reserved observations, and then use the fitted model. The reserved values must not help set their own reference.

Inspect the component calculation
Subtract(
  Starting value: Held-out readings
  Value to remove: Divide(
    Amount: Add a list(
      Numbers: Training readings
    )
    Divisor: Count items(
      Items: Training readings
    )
  )
)
Examples and results
Held-out readings
  1. 07
  2. 19
Training readings
  1. 02
  2. 14
  3. 26
Required result
  1. 03
  2. 15
Try a fresh construction

This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.

Stuck? Inspect a worked construction

The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.

Assumptions and test precision

This is a small construction problem. The lesson explains the assumptions and the parts of the full method that this example leaves out. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.

A pipeline with a negative fitted weight

This check uses the pieces from “Feed prepared readings into the fitted rule”.

BOTIE

Predict the outputs for held-out readings below, at and above the training mean. Use the supplied negative weight after centring and then add the bias.
Training readings
  1. 010
  2. 114
  3. 218
Held-out readings
  1. 08
  2. 114
  3. 220
Fitted weight
-2
Fitted bias
5

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

If you repeated this evaluation across folds, which quantity must be refitted inside each fold and which rows must it exclude?

Treat data preparation as part of fitting, then repeat the full fit within each validation split.

This is a small construction problem. The lesson explains the assumptions and the parts of the full method that this example leaves out.

Work through the Python challenges →
Continue the courseSearching for a Setting →
← Have We Really Held Out a New Example?