Skip to main content

Toolkit for bias estimation in unbiased learning to rank

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ultr_bias_toolkit-0.0.5.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ultr_bias_toolkit-0.0.5-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file ultr_bias_toolkit-0.0.5.tar.gz.

File metadata

  • Download URL: ultr_bias_toolkit-0.0.5.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for ultr_bias_toolkit-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0761ff078f95f466bedf1ca4a5f3aecf639fd60987a5d0dadbc39a7394ccc8d4
MD5 d9f09a8eddb62d3a15940203accc718d
BLAKE2b-256 c8b6e7e3f7ef6b321165c60b6ec4a65938540acdde575f98297d1ae86015c596

See more details on using hashes here.

File details

Details for the file ultr_bias_toolkit-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: ultr_bias_toolkit-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for ultr_bias_toolkit-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4e37b8c6d8bf12571be7ab29148ce85974ce0511044289ec846092299cdd9f19
MD5 3829025eec475aa275dddcdb7014e76f
BLAKE2b-256 de894569529c050f693cafb27750e0d060d0ddd6b88e735af816342c94296ff1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page