Outputs you create
answer- The requested result, with the values, labels and row order described by this task.
flag_a | flag_b | measurement | category |
|---|---|---|---|
| 0 | 1 | 1.4 | red |
| 1 | 0 | 2.8 | green |
| 1 | 1 | 3.1 | blue |
- Use the declared feature kinds to select only the binary flags in
answer. - Keep row order and named columns for a Bernoulli recipe.
answerHints
Think: Bernoulli models binary presence. Continuous measurements need a matching likelihood; named categories need the separately supported encoded categorical route.
Tools: Trees and distributions retrieval: use the supplied flag_a, flag_b, measurement, category columns and the pandas or model operations introduced in this lesson.
Approach: Compute answer from the supplied evidence. Preserve the requested labels and row order, then inspect the values before checking.
Explained solution
answer = df[['flag_a','flag_b']].copy()
print(answer)
Bernoulli models binary presence. Continuous measurements need a matching likelihood; named categories need the separately supported encoded categorical route.