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
- Example execution:
python recom.py --topN_list 5 --dataset /fullPath/u.data --testSize 1000 --validSize 9000 --surprise_algo SVD --pickleSavePath /fullPath/list.pickle
rec2graph.py
Parses the output of a recommendation algorithm to a graph
- Example execution:
python rec2graph.py --pickleLoadPath ./list.pickle --output ./graphs/graph.xml
distCalc.py
Calculates and visualizes the distance of recom algorithms
- Example execution:
python distCalc.py --folder_paths ./graphs/ --manual
Usage
- Create the dataset files by using the splitter.
- Create the commands file by using the commandsCreator.
- Execute the commands in parallel by using the runner.
- 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
- Get the ideal ranking (known_train + unknown_test) by sorting the parsed output and put the ranked algorithm in a testRank.txt file.
- 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
- 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.