def calculate_similar_artists(output_filename, model_name="<STR_LIT>"):
artists, users, plays = get_lastfm()<EOL>model = get_model(model_name)<EOL>if issubclass(model.__class__, AlternatingLeastSquares):<EOL><INDENT>logging.debug("<STR_LIT>")<EOL>plays = bm25_weight(plays, K1=<NUM_LIT:100>, B=<NUM_LIT>)<EOL>model.approximate_recommend = False<EOL><DEDENT>plays = plays.tocsr()<EOL>logging.debug("<STR_LIT>", model_name)<EOL>start = time.time()<EOL>model.fit(plays)<EOL>logging.debug("<STR_LIT>", model_name, time.time() - start)<EOL>start = time.time()<EOL>logging.debug("<STR_LIT>")<EOL>user_count = np.ediff1d(plays.indptr)<EOL>to_generate = sorted(np.arange(len(artists)), key=lambda x: -user_count[x])<EOL>logging.debug("<STR_LIT>")<EOL>with tqdm.tqdm(total=len(to_generate)) as progress:<EOL><INDENT>with codecs.open(output_filename, "<STR_LIT:w>", "<STR_LIT:utf8>") as o:<EOL><INDENT>for artistid in to_generate:<EOL><INDENT>artist = artists[artistid]<EOL>for other, score in model.similar_items(artistid, <NUM_LIT:11>):<EOL><INDENT>o.write("<STR_LIT>" % (artist, artists[other], score))<EOL><DEDENT>progress.update(<NUM_LIT:1>)<EOL><DEDENT><DEDENT><DEDENT>logging.debug("<STR_LIT>",  time.time() - start)<EOL>
generates a list of similar artists in lastfm by utiliizing the 'similar_items'
    api of the models