Define the ML Problem

Keep future records out of the inspection decision

BOTIE

Use two threshold comparisons and combine their masks. Output 1 only when both event and availability timestamps are at or before the decision time.
Ready to test
0 passed · 0 failed · 2 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

Use two threshold comparisons and combine their masks. Output 1 only when both event and availability timestamps are at or before the decision time.

A pressure reading can occur before an inspection decision yet reach Botie's service too late to use. Both timestamps matter.

Compare decision time against event times and availability times separately, then multiply the aligned binary masks.

Examples and results
Event time per reading
  1. 08
  2. 18
  3. 211
Availability time per reading
  1. 09
  2. 112
  3. 211
Decision time
10
Required result
  1. 01
  2. 10
  3. 20
Event time per reading
  1. 02
  2. 13
Availability time per reading
  1. 04
  2. 15
Decision time
1
Required result
  1. 00
  2. 10
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 assumes a common clock and trustworthy timestamp history. Freshness, permissions, and measurement quality need additional checks. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

An on-time event arrives after the decision

This check uses the pieces from “Require the reading to exist and be available”.

BOTIE

Botie makes a decision at minute 10. A record can be used only if both its event time and its arrival time are at or before that cutoff. Return availability flags in record order, including records exactly on the boundary.
Event time per reading
  1. 07
  2. 110
  3. 29
  4. 311
Availability time per reading
  1. 011
  2. 110
  3. 29
  4. 312
Decision time
10

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 would an offline table sorted by event time still overstate what the service knew?

Preserve availability history as well as measurement time when replaying decisions.

This assumes a common clock and trustworthy timestamp history. Freshness, permissions, and measurement quality need additional checks.

Work through the Python challenges →
Continue the courseWhere Does the Prediction Pipeline Run Out of Room? →
← Do We Need a Learned Model Yet?