Example #1
0
def main(processes = 8):
  lda_loaded_model = lda.load_lda('model/100_topics_lda.txt')
  user_list = db_info.user_list
  user_list_list = db.split_item(user_list)
  results = multiprocess(processes,lda_loaded_model,user_list_list)
  json.dump(results,open("matrix/100_topics_sim_matrix.txt",'w'))
  # topic_sim_matrix(lda_loaded_model)
  # item_lda_model(num_topics=50,path='model/50_topics_lda.txt')
Example #2
0
def main(processes=8):
    lda_loaded_model = lda.load_lda('model/100_topics_lda.txt')
    user_list = db_info.user_list
    user_list_list = db.split_item(user_list)
    results = multiprocess(processes, lda_loaded_model, user_list_list)
    json.dump(results, open("matrix/100_topics_sim_matrix.txt", 'w'))
    # topic_sim_matrix(lda_loaded_model)
    # item_lda_model(num_topics=50,path='model/50_topics_lda.txt')
Example #3
0
def calulate_user_similarity(processes,topics):
  user_list = db_info.user_list
  user_list_list = db.split_item(user_list)
  user_topic_map = get_user_topic_map(topics)
  node = len(user_list_list)/60
  for i in range(60):
    exe_list = user_list_list[i*node:(i+1)*node]
    results = multiprocess(processes,exe_list,user_topic_map)
    path = 'user_similarity/user_topic_sim/'+str(topics)+'_topics/' + str(i) + '.pickle'
    util.write_file(results,path)
Example #4
0
def main(processes=8):
    user_list = db_info.user_list
    user_list_list = db.split_item(user_list)
    results = multiprocess(processes, user_list_list)
    json.dump(results, open("matrix/tags_sim_matrix.txt", 'w'))
Example #5
0
def main(processes = 8):
  user_list = db_info.user_list
  user_list_list = db.split_item(user_list)
  results = multiprocess(processes,user_list_list)
  json.dump(results,open("matrix/user_items_sim_matrix.txt",'w'))