Ejemplo n.º 1
0
    "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)
Ejemplo n.º 2
0
log.write("model restored\n")

restored_model.summary(print_fn=lambda x: log.write(x + '\n'))

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))