Python and NumPy
Recompute scores from a restored report
BOTIE
Examples, experiments and workspace controls
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.
Context for this challenge
Compute one weighted score per restored feature row, then collect the scores and the names together, scores first.
The feature table, weights and greenhouse names have already been restored. Botie must check whether they still describe one aligned report.
Multiply the restored feature table by its coefficient vector, then collect the score vector before the corresponding names.
Examples and results
- Restored feature table
10 40 20 60 - Restored coefficients
- 02
- 10.1
- Restored names in row order
- 0north
- 1south
- Required result
[ [ 24, 46 ], [ "north", "south" ] ]
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
The workshop starts after loading and checks how the restored data is used. The Python examples and challenges perform the actual file-format round trips in memory. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Restored rows with signed coefficients
This check uses the pieces from “Recompute named scores from restored pieces”.
BOTIE
- Restored feature table
0 2 3 1 2 2 - Restored coefficients
- 02
- 1-1
- Restored names in row order
- 0west
- 1east
- 2annex
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.
Which pieces would be missing if you saved only the score vector, and which part of an actual file round trip is outside this workshop?
Store the data, fitted quantities and identity information required to reproduce a calculation.
The workshop starts after loading and checks how the restored data is used. The Python examples and challenges perform the actual file-format round trips in memory.
Work through the Python challenges →