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
Built Distribution
Hashes for ir_metric-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8e25ef8b69e000ebc36b009256f0eee5c6261e1bd3611a290a4d8e33e4f6585 |
|
MD5 | 89fb9e4d4c9cc87f0458185c9112bf6d |
|
BLAKE2b-256 | 926c18ad797237398f8d990f865ac9424b49439af944ac4d291769524e2b8d8e |