Skip to main content

Personal toolkit for bias estimation in unbiased learning to rank

Installation

pip install ultr-bias-toolkit

Offline bias estimation methods

We implement multiple offline position bias estimation methods, including three intervention harvesting approaches:

from ultr_bias_toolkit.bias.naive import NaiveCtrEstimator
from ultr_bias_toolkit.bias.intervention_harvesting import PivotEstimator, AdjacentChainEstimator, AllPairsEstimator

estimators = {
    "CTR Rate": NaiveCtrEstimator(),
    "Pivot One": PivotEstimator(pivot_rank=1),
    "Adjacent Chain": AdjacentChainEstimator(),
    "Global All Pairs": AllPairsEstimator(),
}
examination_dfs = []

for name, estimator in estimators.items():
    examination_df = estimator(df)
    examination_df["estimator"] = name
    examination_dfs.append(examination_df)

examination_df = pd.concat(examination_dfs)
examination_df.head()

Metadata

Release files for ultr-bias-toolkit 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ultr-bias-toolkit 0.0.5
File Size Uploaded
ultr_bias_toolkit-0.0.5.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ultr-bias-toolkit 0.0.5
File Interpreter ABI Platform
ultr_bias_toolkit-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / ultr_bias_toolkit-0.0.5.tar.gz

Download URL ultr_bias_toolkit-0.0.5.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0761ff078f95f466bedf1ca4a5f3aecf639fd60987a5d0dadbc39a7394ccc8d4
BLAKE2b-256 checksum
How to use checksums
c8b6e7e3f7ef6b321165c60b6ec4a65938540acdde575f98297d1ae86015c596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Darwin/22.6.0

Release files / ultr_bias_toolkit-0.0.5-py3-none-any.whl

Download URL ultr_bias_toolkit-0.0.5-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e37b8c6d8bf12571be7ab29148ce85974ce0511044289ec846092299cdd9f19
BLAKE2b-256 checksum
How to use checksums
de894569529c050f693cafb27750e0d060d0ddd6b88e735af816342c94296ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Darwin/22.6.0

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page