A PYthon Group Recommender EXplainable Library
Project description
PY-GREX: An Explainable Group Recommender Systems Toolkit
A software toolkit for explainable group recommender systems, including several state-of-the-art explainability methods and evaluation metrics.
About
PY-GREX addresses this critical need, offering a modular Python toolkit equipped with multiple state-of-the-art explainability algorithms to facilitate research and development in eXplainable AI (XAI) for Recommender Systems.
🚀 Features
PY-GREX provides a modular, end-to-end pipeline for explainable group recommendations.
-
Recommendation Models:
- Matrix Factorization:
- Alternating Least Squares (ALS)
- Singular Value Decomposition (SVD)
- Bayesian Personalized Ranking (BPR)
- Explainable Matrix Factorization (EMF)
- Neural Networks:
- Generalized Matrix Factorization (GMF)
- Multi-Layer Perceptron (MLP)
- Neural Collaborative Filtering (NCF)
- Deep Autoencoder
- Memory-Based:
- Item-Based K-Nearest Neighbors
- Matrix Factorization:
-
Group Aggregation Strategies:
- Consensus-Based:
- Additive Utilitarian
- Multiplicative Utilitarian
- Average Satisfaction
- Majority-Based:
- Borda Count
- Plurality Voting
- Fairness-Oriented:
- Least Misery
- Most Pleasure
- Most Respected Person
- Consensus-Based:
-
Explanation Methods:
- Counterfactual:
- Sliding Window Explainer (Counterfactual Explanations)
- Rule-Based:
- EXPGRS (Association Rules Explainer)
- Local Explainers:
- LORE4Groups (Local Rule-Based Explanations)
- Counterfactual:
-
Evaluation Metrics:
- Accuracy:
- Hit Ratio (HR)
- Normalized Discounted Cumulative Gain (nDCG)
- Explainability:
- Model Fidelity
- Gaussian Intra-List Diversity (GILD)
- Rule Support and Confidence
- Accuracy:
🏁 Getting Started
Installation
You can install PY-GREX directly using pip:
pip install pygrex
This will install all the required dependencies automatically. PY-GREX requires Python 3.11 or higher.
Local Development
If you want to run the project locally for development:
-
Prerequisites:
- Python 3.11 or higher
- Git
- Conda (recommended)
-
Clone the repository:
git clone https://github.com/toledomateus/pygrex.git cd pygrex
-
Create and activate a Conda environment:
conda create -n pygrex python=3.11 conda activate pygrex
-
Install in development mode:
pip install -e .
This will install the package in development mode, allowing you to modify the source code and see the changes immediately without reinstalling.
🎈 Usage
Running Locally
To run the Streamlit app locally:
-
Install Streamlit:
pip install streamlit
-
Run the app:
streamlit run Home.py
The app will be available at http://localhost:8501
Interactive Web App
The easiest way to use PY-GREX is through the web application. It allows you to:
- Upload or use default data for users, items, and groups
- Select and train a variety of recommendation models
- Generate group recommendations using different aggregation strategies
- Produce and evaluate explanations for the recommendations
Jupyter Notebooks
For detailed examples, check out the notebooks in the notebooks/ directory:
expgrs_toy_example.ipynb: Demonstrates the EXPGRS rule-based explainer with association rulessliding_window_toy_example.ipynb: Shows how to use counterfactual explanations with the Sliding Window methodlore4groups_toy_example.ipynb: Illustrates local rule-based explanations using LORE4Groups
🤝 Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📚 Citation
If you use PY-GREX in your research, please cite our paper:
@inproceedings{Toledo2026GREX,
author = {Toledo, Mateus and Yera, Raciel and Barranco, Manuel J. and Dutta, Bapi},
title = {{GREX}: A Platform for Supporting Explanations in Group Recommender Systems},
booktitle = {Intelligent Data Engineering and Automated Learning -- {IDEAL} 2025},
year = {2026},
publisher = {Springer Nature Switzerland AG},
address = {Cham},
series = {Lecture Notes in Computer Science},
volume = {16239},
pages = {1--13},
doi = {10.1007/978-3-032-10489-2_9}
}
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygrex-1.0.2.tar.gz.
File metadata
- Download URL: pygrex-1.0.2.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f096662067a6cb838b08912abc1d9c4647ece73bd51ec2f89159bbbab98119b
|
|
| MD5 |
af9bb84372cb22f86941dea8564bb1fa
|
|
| BLAKE2b-256 |
c6a92e3abaa5ec40b844903b533beb94fa9d1c4a38632a4b5e3a4e0b7ae29632
|
Provenance
The following attestation bundles were made for pygrex-1.0.2.tar.gz:
Publisher:
release.yml on toledomateus/pygrex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygrex-1.0.2.tar.gz -
Subject digest:
3f096662067a6cb838b08912abc1d9c4647ece73bd51ec2f89159bbbab98119b - Sigstore transparency entry: 662992789
- Sigstore integration time:
-
Permalink:
toledomateus/pygrex@fcc7563534b9b9dc13cd2bff242da92d5749019a -
Branch / Tag:
refs/tags/v.1.0.2 - Owner: https://github.com/toledomateus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fcc7563534b9b9dc13cd2bff242da92d5749019a -
Trigger Event:
release
-
Statement type:
File details
Details for the file pygrex-1.0.2-py3-none-any.whl.
File metadata
- Download URL: pygrex-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
889667e9950ec5e1339a3533ee54a527cb15e7912a1f4ac096412264b5644b62
|
|
| MD5 |
31215da7102edc72ae8a5dd192725e8e
|
|
| BLAKE2b-256 |
8ef060368a856ff75bd1a18ffb9e0312e46b35f32431898a495362f5f19fa21a
|
Provenance
The following attestation bundles were made for pygrex-1.0.2-py3-none-any.whl:
Publisher:
release.yml on toledomateus/pygrex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygrex-1.0.2-py3-none-any.whl -
Subject digest:
889667e9950ec5e1339a3533ee54a527cb15e7912a1f4ac096412264b5644b62 - Sigstore transparency entry: 662992792
- Sigstore integration time:
-
Permalink:
toledomateus/pygrex@fcc7563534b9b9dc13cd2bff242da92d5749019a -
Branch / Tag:
refs/tags/v.1.0.2 - Owner: https://github.com/toledomateus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fcc7563534b9b9dc13cd2bff242da92d5749019a -
Trigger Event:
release
-
Statement type: