Data Preparation

Give the ruler a useful unit

BOTIE

Centre the training readings on their own mean, square their departures, average them and take the square root.
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

Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.

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

Centre the training readings on their own mean, square their departures, average them and take the square root.

We want to compare how unusual a height or weight is within its own group. First we need the group's average. Then we need a measure of its spread. Each example supplies one kind of measurement, so we can express a new person's difference in standard-deviation units rather than centimetres or kilograms.

Inspect the component calculation
Square root(
  Squared value: Divide(
    Amount: Add a list(
      Numbers: Square(
        Value or list: Subtract(
          Starting value: Group measurements
          Value to remove: Divide(
            Amount: Add a list(
              Numbers: Group measurements
            )
            Divisor: Count items(
              Items: Group measurements
            )
          )
        )
      )
    )
    Divisor: Count items(
      Items: Square(
        Value or list: Subtract(
          Starting value: Group measurements
          Value to remove: Divide(
            Amount: Add a list(
              Numbers: Group measurements
            )
            Divisor: Count items(
              Items: Group measurements
            )
          )
        )
      )
    )
  )
)
Examples and results
Group measurements
  1. 0160
  2. 1170
  3. 2180
Required result
8.165
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.

Two repeated measurement levels

This check uses the pieces from “Describe the new reading in spread units”.

BOTIE

The group has four measurements at two levels. Using the population standard deviation, predict the standard score of the new measurement.
Group measurements
  1. 01
  2. 11
  3. 25
  4. 35
New measurement
1

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.

Why must both the numerator's reference and denominator's spread come from training data, and what would fail if that spread were zero?

Standardisation compares departures relative to a fitted spread; it requires a valid, nonzero scale.

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 courseFeature Scaling →
← Centring on the Mean