Welcome to ShaRP’s documentation!

ShaRP (Shapley for Rankings and Preferences) is a game theoretic approach to explain the contributions of features to different aspects of a ranked outcome. ShaRP builds on the Quantitative Input Influence framework, and can compute the contributions of features for multiple Quantities of Interest, including score, rank, pair-wise preference, and top-k (see reference [1] for details).

Installation

The easiest way to install sharp is using pip:

# Install latest release
pip install -U xai-sharp

# Install additional dependencies (matplotlib) for plotting
pip install -U "xai-sharp[optional]"

# Install from source (may be unstable)
pip install -U git+https://github.com/DataResponsibly/ShaRP

Alternatively, you can also clone the repository and install it from source:

# Clone and switch to the project's directory
git clone https://github.com/DataResponsibly/ShaRP.git
cd ShaRP

# Basic install
pip install .

# Installs project requirements and the research package. Dependecy group
# "all" will also install the dependency groups shown below.
pip install ".[optional,tests,docs]"

This generally only recommended if you intend to contribute to sharp, or extend it somehow.

Reference