---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://catboost.ai/docs/en/references/pfound.md
  - href: en/references/pfound.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# PFound

<!-- source: en/_includes/work_src/reusage-common-phrases/ranking-quality-assessment.md -->
This function is usually used to assess the quality of ranking.
<!-- endsource: en/_includes/work_src/reusage-common-phrases/ranking-quality-assessment.md -->


- [Calculation principles](#calculation)
- [User-defined parameters](#user-defined-parameters)

## Calculation principles {#calculation}

<!-- source: en/_includes/work_src/reusage-common-phrases/possible-lable-values.md -->
The possible label values are limited: $t_{i} \in [0;1]$.
<!-- endsource: en/_includes/work_src/reusage-common-phrases/possible-lable-values.md -->


<!-- source: en/_includes/work_src/reusage-common-phrases/function-calculation.md -->
The calculation of this function consists of the following steps:
<!-- endsource: en/_includes/work_src/reusage-common-phrases/function-calculation.md -->


1. <!-- source: en/_includes/work_src/reusage-common-phrases/ascending_a_i.md -->
   The objects in each group are sorted in descending order of predicted relevancies ($a_{i}$).
   <!-- endsource: en/_includes/work_src/reusage-common-phrases/ascending_a_i.md -->

1. The PFound metric is calculated for each group ($group \in groups$). To do this, the label values ($t_{i}$) of the objects from the sorted list are multiplied by their weight ($P(i, group, decay)$) and summed up as follows:

    $PFound(group, top, decay) = \sum_{i = 0}^{top} P(i, group, decay) * t_{g(i, group)}{, where}$

    - $P(0, group, decay) = 1$
    - $P(i, group, decay) = P(i – 1, group, decay) * (1 - t_{g(i – 1, group)}) * decay$
    - $decay$ is a constant, $decay \in [0, 1]$
    - $g(i, group)$ is the global index of the $i$-th best object in the group . The $i$-th object is considered better than the $j$-th object if the following inequality is true: $a_{i} > a_{j}$

1. The aggregated value of the metric for all groups is calculated as follows:

    $PFound(top, decay) = \displaystyle\frac{1}{\sum\limits_{group\in groups} w_{group}}\sum_{group\in groups} w_{group} PFound(group, top, decay)$



## User-defined parameters {#user-defined-parameters}

### decay

#### Description

The probability of search continuation after reaching the current object.

#### top

The number of top samples in a group that are used to calculate the ranking metric. Top samples are either the samples with the largest approx values or the ones with the lowest target values if approx values are the same.

_Default:_ –1 (all label values are used)
