Home

Awesome

RecRank

Author: Georgios Damaskinos (georgios.damaskinos@gmail.com)

RecRank is a tool for exploiting black-box recommenders for algorithm selection, presented in The Imitation Game: Algorithm Selection by Exploiting Black-Box Recommenders.

Main Components

recom.py

Executes recommendation algorithms from and outputs the recommendations list

rec2graph.py

Parses the output of a recommendation algorithm to a graph

distCalc.py

Calculates and visualizes the distance of recom algorithms

Usage

  1. Create the dataset files by using the splitter.
  2. Create the commands file by using the commandsCreator.
  3. Execute the commands in parallel by using the runner.
  4. Parse the results by using something similar to:
export suf=kv.out && for file in *$suf; do echo -ne $(basename ${file%$suf}); awk -F: 'BEGIN {ORS=""}; /F1/ {print "\t",$2} END {print "\n"}' $file; done
  1. Get the ideal ranking (known_train + unknown_test) by sorting the parsed output and put the ranked algorithm in a testRank.txt file.
  2. Extract the graph for each output .pickle file (known_train + known_query, unknown_train + known query for the black-box) by using the rec2graph method. Example:
for file in *kq.pickle; do name=${file%kq.pickle}; echo $name; python /path/to/rec2graph.py --pickleLoadPath $file --output ~/temp/$name.xml --topN 20 & done
  1. Use the distCalc to calculate the ranking correlation. Example:
python distCalc.py --folder_paths ~/temp/ --manual --blackbox_path bb.xml --cmpRank_path testRank.txt

License

This project is licensed under the terms of BSD 3-clause Clear license. by downloading this program, you commit to comply with the license as stated in the LICENSE.md file.