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(actual_ranking, predicted_ranking, k=2)

print(result)  # Output: 0.25

Available Metrics

Currently, ir_metrics supports the following metrics:

  • Average Precision (average_precision)
  • Precision at k (precision_at_k)
  • Recall at k (recall_at_k)
  • F1 Score at k (f1_score_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.3.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

ir_metric-0.1.3-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

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