<s> "<STR_LIT>" <EOL> import cPickle as pickle <EOL> from collections import OrderedDict <EOL> from matplotlib import pyplot as plt <EOL> from os import listdir <EOL> from os . path import isfile , join <EOL> min_users = <NUM_LIT:10> <EOL> input_dir = '<STR_LIT>' <EOL> input_files = [ join ( input_dir , f ) for f in listdir ( input_dir ) if isfile ( join ( input_dir , f ) ) and f . endswith ( '<STR_LIT>' ) ] <EOL> for i_f in input_files : <EOL> print i_f <EOL> ndcgs = [ pickle . load ( open ( i_f , '<STR_LIT:rb>' ) ) [ '<STR_LIT>' ] for i_f in input_files ] <EOL> for i in range ( len ( ndcgs ) ) : <EOL> assert ( sorted ( ndcgs [ i ] . keys ( ) ) == ndcgs [ i ] . keys ( ) ) <EOL> mean_ndcgs = [ <EOL> OrderedDict ( { k : sum ( v ) / len ( v ) for k , v in x . items ( ) if len ( v ) >= min_users } ) <EOL> for x in ndcgs ] <EOL> colors = [ '<STR_LIT:g>' , '<STR_LIT:b>' , '<STR_LIT:r>' , '<STR_LIT:k>' , '<STR_LIT:y>' ] <EOL> for i , n in enumerate ( mean_ndcgs ) : <EOL> plt . plot ( n . keys ( ) , n . values ( ) , colors [ i ] ) <EOL> plt . show ( ) </s>
