Skip to content

azinmatin/prince

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRINCE: Provider-side Interpretability with Counterfactual Explanations in Recommender Systems

Overview

In this repository, we provide the code for generating counterfactual explanations in random walk-based recommender systems in polynomial time. The explanations are in form of a subset of the user's actions, whose removal displaces the top-most recommendation. User's actions are modeled as the outgoing edges of the user node in her interaction graph. Reference: https://dl.acm.org/doi/pdf/10.1145/3336191.3371824

Usage

The relevance of the items to a user is measured based on the their PageRank scores personalized for the user. In local_push.py, the PPR (personalized PageRank) scores are computed using reverse local push algorithm (with approximation guarantee of epsilon). For a given user and her interction graph, the function "cfe_item_centric_algo_poly" in cfe_generator.py returns the counterfactual explanation and the replacement item (the new top-most recommendation).

Example

In toy_example.py, the algorithm is tested on random graphs. For example, in the graph below, the user node is shown in red (node 12). The only item nodes in the graph are nodes 13 an 14. Node 14 has higher PageRank score, hence the top recommendation. Deleting the red edges swaps the rank of the nodes 13 and 14, and makes node 13 the new top recommendation.

toy_example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages