Anomaly Detection

Compare a point with its local surroundings

BOTIE

Average reachability, take its reciprocal, divide neighbour densities by that density, then average the ratios.
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

Average reachability, take its reciprocal, divide neighbour densities by that density, then average the ratios.

Botie wants to judge a reading against its neighbourhood, since a globally sparse region can still be locally ordinary.

Take the reciprocal of mean reachability distance, divide each neighbour density by that local density, and average the ratios.

Examples and results
Positive reachability distances
  1. 02
  2. 14
Neighbour local densities
  1. 00.5
  2. 11
Required result
2.25
Positive reachability distances
  1. 09
Neighbour local densities
  1. 01
Required result
9
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

Inputs must come from the same neighbourhood rule. This stage does not construct neighbour sets. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

The point is denser than its neighbours

This check uses the pieces from “Compare the reading's density with its neighbours”.

BOTIE

Botie has already measured this point's reachability distances and its neighbours' local reachability densities. Use those supplied quantities to calculate the local density ratio: mean neighbour density divided by the point's own density.
Positive reachability distances
  1. 01
  2. 11
  3. 22
Neighbour local densities
  1. 00.5
  2. 10.25
  3. 20.75

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 the supplied reachability distances and neighbour densities use a consistent neighbourhood?

A relative density score is only meaningful when its numerator and denominator describe compatible local comparisons.

Inputs must come from the same neighbourhood rule. This stage does not construct neighbour sets.

Work through the Python challenges →
Continue the courseFinding Readings That Are Easy to Separate →