https://github.com/velocitatem/recmetrics_lite
https://github.com/velocitatem/recmetrics_lite
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/velocitatem/recmetrics_lite
- Owner: velocitatem
- Created: 2025-03-03T18:05:51.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-03T18:30:22.000Z (about 2 months ago)
- Last Synced: 2025-03-11T04:53:07.287Z (about 2 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RecMetrics Lite
A streamlined library for recommender system evaluation metrics with minimal dependencies. This is a lightweight version of the recmetrics library, with compatibility for modern Python package versions.
## Installation
```bash
# Basic installation
pip install recmetrics-lite# With plotting extras (for metrics_plot using plotly)
pip install recmetrics-lite[plots]
```## Features
RecMetrics Lite provides metrics and plotting functions for evaluating recommender systems:
### Metrics
- Coverage and catalog coverage
- Personalization
- Intra-list similarity
- Novelty
- MSE and RMSE
- Precision and recall
- Mean Average Recall at K (MAR@K)### Visualization
- Long tail plots
- Coverage plots
- Personalization plots
- Intra-list similarity plots
- MAR@K and MAP@K plots
- Class separation plots
- ROC plots
- Precision-recall curves
- Metrics radar plots (requires plotly)## Usage Example
```python
import numpy as np
import pandas as pd
from recmetricslite import coverage, personalization, recommender_precision# Sample data
catalog = ['item1', 'item2', 'item3', 'item4', 'item5']
predicted = [['item1', 'item2'], ['item3', 'item4']]
actual = [['item1', 'item3'], ['item2', 'item4']]# Calculate metrics
cov = coverage(predicted, catalog)
pers = personalization(predicted)
prec = recommender_precision(predicted, actual)print(f"Coverage: {cov:.2f}")
print(f"Personalization: {pers:.2f}")
print(f"Precision: {prec:.2f}")
```## License
MIT License
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.