Supplied for this practice
These objects are prepared afresh before your editor runs.
query_id- Supplied
query_id; its definition below specifies the values and role.query_id = 117
Outputs you create
answer- The requested result, with the values, labels and row order described by this task.
case_id | x | label |
|---|---|---|
| 117 | 2 | A |
| 81 | 1 | A |
| 96 | 3 | B |
| 63 | 4 | B |
- Remove the query case from the supplied fitting table into
answerbefore fitting or learning a scale. - Keep its row ID as the table index.
answerHints
Think: Removing a self-match only from the displayed neighbour list would not repair the original fit. Fit preparation and the classifier on the separated fitting rows.
Tools: Neighbours, margins and rules retrieval: use the supplied case_id, x, label 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.loc[df['case_id'] != query_id].set_index('case_id')
print(answer)
Removing a self-match only from the displayed neighbour list would not repair the original fit. Fit preparation and the classifier on the separated fitting rows.