Data Preparation

Represent the greenhouse roof materials

BOTIE

Retrieve vocabulary entry zero and compare each roof material with that entry.
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

Retrieve vocabulary entry zero and compare each roof material with that entry.

Botie needs a stable numerical description of roof material without treating an arbitrary ID as a quantity. We will build the three indicator columns separately, then arrange them into rows.

Inspect the component calculation
Match one category(
  Items: Roof materials
  One reference category: Choose an entry(
    Table or list: Three training categories in fixed order
    Index: 0
  )
)
Examples and results
Roof materials
  1. 0glass
  2. 1mesh
  3. 2foil
Three training categories in fixed order
  1. 0glass
  2. 1plastic
  3. 2mesh
Required result
  1. 01
  2. 10
  3. 20
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 construction uses exactly three vocabulary categories so the comparisons remain visible. It does not fit a model or remove redundant columns. 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.

Repeated roofs and a new material

This check uses the pieces from “Assemble one category row for each roof”.

BOTIE

Encode four roofs using the fixed three-category training vocabulary. Preserve repeated materials and use the workshop's all-zero policy for an unknown material.
Roof materials
  1. 0mesh
  2. 1mesh
  3. 2tile
  4. 3glass
Three training categories in fixed order
  1. 0glass
  2. 1plastic
  3. 2mesh

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 a saved model retain its category vocabulary and ordering, and what does an all-zero row mean under this policy?

A categorical representation needs stable column semantics and an explicit rule for unseen categories.

This construction uses exactly three vocabulary categories so the comparisons remain visible. It does not fit a model or remove redundant columns.

Work through the Python challenges →
Continue the courseWhen the End Is Beside the Beginning →
← Principal Component Analysis