metriks is a Python package of commonly used metrics for evaluating information retrieval models.
Project description
metriks is a Python package of commonly used metrics for evaluating information retrieval models.
Available Metrics
Python API |
Description |
---|---|
metriks.recall_at_k(y_true, y_prob, k) |
Calculates recall at k for binary classification ranking problems. |
metriks.precision_at_k(y_true, y_prob, k) |
Calculates precision at k for binary classification ranking problems. |
metriks.mean_reciprocal_rank(y_true, y_prob) |
Gets a positional score on how well you did at rank 1, rank 2, etc. |
metriks.ndcg(y_true, y_prob, k) |
A score for measuring the quality of a set of ranked results. |
label_mean_reciprocal_rank(y_true, y_prob) |
Determines the average rank each label was placed across samples. Only labels that are relevant in the true data set are considered in the calculation. |
metriks.confusion_matrix_at_k(y_true, y_prob, k) |
Generates binary predictions from probabilities by evaluating the top k items (in ranked order by y_prob) as true. |
Installation
Install using pip
pip install metriks
Alternatively, specific distributions can be downloaded from the github release page. Once downloaded, install the .tar.gz file directly:
pip install metriks-\*.tar.gz
Development
1. (Optional) If you have virtualenv and virtualenvwrapper create a new virtual environment:
mkvirtualenv metriks
This isolates your specific project dependencies to avoid conflicts with other projects.
2. Clone and install the repository:
git clone git@github.com:intuit/metriks.git cd metriks pip install -e .
This will install a version to an isolated environment in editable mode. As you update the code in the repository, the new code will immediately be available to run within the environment (without the need to pip install it again)
3. Run the tests using tox:
pip install tox tox
Tox will run all of the tests in isolated environments
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file metriks-0.0.2.tar.gz
.
File metadata
- Download URL: metriks-0.0.2.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5700d9f194a8cd30e3c501ea3f77bf1ef6ffd3f9a78c340f8fb9435478ef32cd |
|
MD5 | 9b3fe9ea75b65754e94d99d5b82033e1 |
|
BLAKE2b-256 | ccceae08e964da504bc2be5902d8f27c40bc798a5207f6f72385984b50dfb186 |
File details
Details for the file metriks-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: metriks-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a2974047b3fb68c913211ffd03132ddeeddb7abc06cd5c2ce777affcc68e661 |
|
MD5 | e0cab548c6c45d4092d80fbd61629cdd |
|
BLAKE2b-256 | d89cf8781cfce2b3bee725b4262efbb40597450a444647df706328290eb9e29c |