Skip to content

gdamaskinos/RecRank

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

  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.

About

Exploit black-box recommenders for algorithm selection.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published