users_test = np.load(users_test_file) seqs = pussy.make_vectors(users_test, ratings) seqs = pussy.make_vectors(users_train, ratings) print(users_train.shape) d = {"left_out": [], "top_from": [], "measure": [], "mean": [], "sd": []} print(left_out) dd = pussy.predict_users_all(users_train[:1000], seqs, restored_model, 1, 10, n_movies) d = pussy.append_to_dict(d, dd, left_out, 10) df = pd.DataFrame(d) df.to_csv(path_or_buf="fdfsdfsdf18", sep=',', index=False) sys.exit(1) # # train model # start_time = datetime.datetime.now() log.write("start training at {}\n".format(start_time)) csv_logger = CSVLogger(train_file_log, append=True, separator=',')
"model_name": [], "left_out": [], "top_from": [], "measure": [], "mean": [], "sd": [] } left_out = [1] tops = [5] # print(left_out) for model in models_name: model = model.replace("\n", "") restored_model = keras.models.load_model(model) for lo in left_out: for top in tops: dd = pussy.predict_users_all(users_test, seqs, restored_model, lo, top, n_movies) d = pussy.append_to_dict(d, dd, lo, top, model) df = pd.DataFrame(d) df.to_csv(path_or_buf="predict_test_{}.csv".format(file_models), sep=',', index=False)
seqs = pussy.make_vectors(users_train, ratings) d = {"left_out": [], "top_from": [], "measure": [], "mean": [], "sd": []} left_out = [1, 3, 5] tops = [10] # print(left_out) for lo in left_out: for top in tops: dd = pussy.predict_users_all(users_train, seqs, restored_model, lo, top, n_movies) d = pussy.append_to_dict(d, dd, lo, top) df = pd.DataFrame(d) df.to_csv(path_or_buf="predict_train_{}".format(model_file), sep=',', index=False) # # test # seqs = pussy.make_vectors(users_test, ratings) d = {"left_out": [], "top_from": [], "measure": [], "mean": [], "sd": []}