Package: fape
Enumerating Fair Packages for Group Recommendations (WSDM 2022)We proposed an efficient method to enumerateallfair packages with respect to envy-freeness and proportionality.Paper:https://arxiv.org/abs/2105.14423💿 Installation$ pip install fape💡 How to UseThis package is compatible withgraphillionandSAPPOROBDD. Please install graphillion via$ pip install graphillionBasic Usagefape.construct_zddconstructs ZDD and outputs a ZDD string.importfapeimportnumpyasnpfromgraphillionimportsetsetm=3n=4R=np.array([[10.0,20.0,5.0,5.0],[10.0,5.0,5.0,30.0],[10.0,20.0,5.0,5.0],])# 3 members x 4 itmeszdd_string=fape.construct_zdd(R,package_size=2,tau=3,criterion='proportionality',delta=0.5)setset.set_universe([iforiinrange(n)])ss=setset(setset.loads(zdd_string))forrinss:print(r)# {0, 1}# {0, 2}# {0, 3}# {1, 3}weight={i:R[:,i].mean()foriinrange(n)}forrinss.max_iter(weight):print(r)break# {1, 3}In this example,delta = 0.5means that each member likes the items with top talf ratings. Namely,member 0 likes items 0 and 1,member 1 likes items 0 and 3, andmember 2 likes items 0 and 1 (zero-indexed).tau = 3means that three members (i.e., all members) should be satisfied.fape.construct_zddenumerates such packages. There are qualified four packages, {0, 1}, {0, 2}, {0, 3}, and {1, 3}.weightis a dictionary that stores the average preference of each item.max_iteriterates packages in the descreasing order of weights. In this example, package {1, 3} has the largest weight.Agraphillion.setset.setsetsupports various operations, including union (|) and intersection (&). Please refer to the document ofgraphillionfor more details.📝 ResultsDatasetMetricMovieLensProportionalityMovieLensEnvyfreenessMovieLensPreferenceMovieLensTotalScoreAmazonProportionalityAmazonEnvyfreenessAmazonPreferenceAmazonTotalScoreAveranking1.000 ± 0.0000.725 ± 0.1560.911 ± 0.0272.636 ± 0.1711.000 ± 0.0000.500 ± 0.1250.939 ± 0.0122.439 ± 0.126LMRanking0.988 ± 0.0370.588 ± 0.1680.876 ± 0.0362.451 ± 0.1880.912 ± 0.2630.425 ± 0.1390.924 ± 0.0312.261 ± 0.373GreedyVar0.912 ± 0.0800.750 ± 0.1120.812 ± 0.0352.474 ± 0.1570.787 ± 0.2020.637 ± 0.0880.859 ± 0.0312.284 ± 0.287GreedyLM0.950 ± 0.0610.775 ± 0.1090.813 ± 0.0362.538 ± 0.1550.662 ± 0.1590.600 ± 0.0940.853 ± 0.0312.115 ± 0.249GFAR0.950 ± 0.0610.762 ± 0.1040.812 ± 0.0382.525 ± 0.1540.762 ± 0.1420.650 ± 0.0750.871 ± 0.0252.284 ± 0.219SPGreedy1.000 ± 0.0000.525 ± 0.1560.851 ± 0.0412.376 ± 0.1671.000 ± 0.0000.375 ± 0.0790.867 ± 0.015,2.242 ± 0.085EFGreedy0.925 ± 0.1271.000 ± 0.0000.792 ± 0.0532.717 ± 0.1650.750 ± 0.2440.838 ± 0.0800.854 ± 0.0272.441 ± 0.302FAPE(ours, exact)1.000 ± 0.0001.000 ± 0.0000.888 ± 0.0372.888 ± 0.0371.000 ± 0.0000.912 ± 0.0570.913 ± 0.0202.825 ± 0.064FAPE(ours, 10th)1.000 ± 0.0001.000 ± 0.0000.887 ± 0.0372.887 ± 0.0371.000 ± 0.0000.912 ± 0.0570.911 ± 0.0202.824 ± 0.064FAPE(ours, 100th)1.000 ± 0.0001.000 ± 0.0000.881 ± 0.0402.881 ± 0.0401.000 ± 0.0000.900 ± 0.0500.905 ± 0.0252.805 ± 0.058FAPE(ours, random)1.000 ± 0.0001.000 ± 0.0000.720 ± 0.0442.720 ± 0.0441.000 ± 0.0000.912 ± 0.0570.878 ± 0.0232.790 ± 0.069Please refer to the paper for more details.🧪 How to ReproduceDependency of python scriptsPlease installgraphillionandsurpriseviapip install graphillion scikit-surpriseDataYou can download and preprocess data by the following command. It may take time. Please use only MovieLens 100k/1m if it takes too much time.$ bash download.sh100k.npy,1m.npy,10m.npy,20m.npy, and25m.npyare variants of the MovieLens dataset.home_and_kitchen.npyis the Amazon dataset.Evaluation Scriptsspeed.pymeasures the speed of FAPE (Section 4.2).evaluate_baselines.pyevaluates the baseline methods (Section 4.3).evaluate_ours.pyevaluates FAPE (Section 4.3).Citation@inproceedings{sato2022enumerating,
  author    = {Ryoma Sato},
  title     = {Enumerating Fair Packages for Group Recommendations},
  booktitle = {Proceedings of the Fifteenth {ACM} International Conference on Web Search and Data Mining, {WSDM}},
  year      = {2022},
}