---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://catboost.ai/docs/en/concepts/python-reference_pool_set_pairs_weight.md
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# set_pairs_weight

<!-- source: en/_includes/work_src/reusage-python/set_pairs_weight__desc.md -->
Set weights for each pair of objects.
<!-- endsource: en/_includes/work_src/reusage-python/set_pairs_weight__desc.md -->


## Method call format {#call-format}

```
set_pairs_weight(pairs_weight)
```

## Parameters {#parameters}

### pairs_weight

#### Description

<!-- source: en/_includes/work_src/reusage/pairs_weight__short-desc.md -->
The weight of each input pair of objects in the form of one-dimensional array-like pairs. The number of given values must match the number of specified pairs.
<!-- endsource: en/_includes/work_src/reusage/pairs_weight__short-desc.md -->


<!-- source: en/_includes/work_src/reusage/pairs_weight__usage-intention.md -->
<!-- source: en/_includes/work_src/reusage/learn_pairs__where_is_used.md -->
This information is used for calculation and optimization of [Pairwise metrics](https://catboost.ai/docs/en/concepts/loss-functions-ranking.md).
<!-- endsource: en/_includes/work_src/reusage/learn_pairs__where_is_used.md -->
<!-- endsource: en/_includes/work_src/reusage/pairs_weight__usage-intention.md -->


<!-- source: en/_includes/work_src/reusage-python/only-non-negative-values-are-supported.md -->
Only non-negative values are supported.
<!-- endsource: en/_includes/work_src/reusage-python/only-non-negative-values-are-supported.md -->

**Possible types**

- list
- numpy.ndarray
- pandas.DataFrame
- pandas.Series
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)

**Default value**

Required parameter
