All courses · Course overview · Lesson sequence
Skip to lesson textModule 4 practice · explain a ranking
Attempt using the lesson, then read the solutions.
A. A different query. Reuse A=red blue and B=red, but query red. Compute both cosine scores using the lesson's normalized vectors. Which passage ranks first? Why does the longer document not automatically win?
B. An absent concept. Compare the queries red and red laptop in that same tiny index. Predict whether their scores differ. Run the comparison using Index and Document. Explain why this behavior is dangerous if a user asks about a specific object unknown to the collection.
C. Cutoff and completeness. Run methods.py lexical. Find q-two-sources in each report. Compute its recall at cutoffs 1 and 2, then explain the overall means 0.8125 and 0.875. State why mean reciprocal rank does not change. Do not use no-evidence questions in the recall denominator.
D. A meaningful check. Describe a test for a future change that starts indexing passage titles. Which current code/test assumption would need updating? Design one tiny corpus/query where title indexing changes a result, without adding a live service or calling the change an improvement before evaluation.
Self-review: show calculations, identify dropped unknown terms, use the eight-case denominator and state precisely what the proposed test verifies.