Skip to main content

ir_metrics is a Python package designed to facilitate information retrieval (IR) metric calculations. It provides a simple and convenient way to compute various metrics commonly used in IR evaluation.

Project description

ir_metrics

Overview

ir_metrics is a Python package designed to facilitate information retrieval (IR) metric calculations. It provides a simple and convenient way to compute various metrics commonly used in IR evaluation.

Installation

Install the package using pip:

pip install ir_metric

Quick Start

To use ir_metrics, import the metric module and call the desired metric function. Here's a quick example of computing the average precision:

from ir_metric import metric

# Example data
actual_ranking = [1, 2, 3]
predicted_ranking = [5, 3, 1]

# Compute average precision at k=2
result = metric.average_precision_at_k(actual_ranking, predicted_ranking, k=2)

print(result)  # Output: 0.25

Available Metrics

Currently, ir_metrics supports the following metrics:

  • Average Precision (average_precision_at_k)
  • Precision at k (precision_at_k)
  • Recall at k (recall_at_k)

Contributions

Contributions and bug reports are welcome! Feel free to open issues or submit pull requests on the GitHub repository: [https://github.com/harshkumarchourasia/ir_metric]

License

This project is licensed under the MIT License.

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

ir_metric-0.1.4.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

ir_metric-0.1.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file ir_metric-0.1.4.tar.gz.

File metadata

  • Download URL: ir_metric-0.1.4.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.0.0

File hashes

Hashes for ir_metric-0.1.4.tar.gz
Algorithm Hash digest
SHA256 73f3971c0dbcbd8cd62c2a5b669c3d92c31b181b30977c3df40dc8d074d6ed8e
MD5 f57f2a102f873cd02623fcbd608aa4b0
BLAKE2b-256 d42d1927693c0324bf97100a78a6dec41924d39b750880fb52528a2729fbb55e

See more details on using hashes here.

File details

Details for the file ir_metric-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ir_metric-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.0.0

File hashes

Hashes for ir_metric-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a8e25ef8b69e000ebc36b009256f0eee5c6261e1bd3611a290a4d8e33e4f6585
MD5 89fb9e4d4c9cc87f0458185c9112bf6d
BLAKE2b-256 926c18ad797237398f8d990f865ac9424b49439af944ac4d291769524e2b8d8e

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