RecTools icon indicating copy to clipboard operation
RecTools copied to clipboard

Metrics. Added Pfound

Open In48semenov opened this issue 2 years ago • 0 comments
trafficstars

Implemented a ranking metric PFound@k:

$$pFound@K = \sum_{i=1}^{k} pLook[i]\ pRel[i]$$

$$pLook[1] = 1$$

$$pLook[i] = pLook[i-1]\ (1 - pRel[i-1])\ (1 - pBreak)$$

$$pBreak = 0.15$$

  1. Implemented the calculation of the metric, both in the context of each user, and in the context of the overall metric.
  2. To calculate this metric, the Score column is needed, so I added a condition for the presence of this column to the merge_reco function.
  3. The calculation of this metric depends on the values of the previous step, so I added a static method that fills in the missed ranks with zero scores. For example, the user has only ranks 1 and 5, to calculate PFound@6, you need scores at positions 2, 3, and 4 in order to correctly calculate pLook[5].
  4. Wrote tests for metric PFound.

In48semenov avatar May 08 '23 19:05 In48semenov