2021-05-13 10:48:52 +02:00
|
|
|
import sys
|
|
|
|
|
2021-05-10 19:42:26 +02:00
|
|
|
import pandas as pd
|
2021-05-13 10:48:52 +02:00
|
|
|
from sklearn.metrics import mean_squared_error
|
|
|
|
from tensorflow.keras.models import load_model
|
2021-05-10 19:42:26 +02:00
|
|
|
|
2021-05-13 10:48:52 +02:00
|
|
|
test_df = pd.read_csv("test.csv")
|
2021-05-10 19:42:26 +02:00
|
|
|
test_df.drop(test_df.columns[0], axis=1, inplace=True)
|
|
|
|
x_test = test_df.drop("rating", axis=1)
|
|
|
|
y_test = test_df["rating"]
|
|
|
|
|
2021-05-13 10:48:52 +02:00
|
|
|
model = load_model("model_movies")
|
2021-05-10 19:42:26 +02:00
|
|
|
y_pred = model.predict(x_test.values)
|
|
|
|
|
|
|
|
rmse = mean_squared_error(y_test, y_pred)
|
2021-05-13 10:48:52 +02:00
|
|
|
build_number = sys.argv[1] if len(sys.argv) > 1 else 0
|
|
|
|
|
|
|
|
d = {"rmse": [rmse], "build": [build_number]}
|
|
|
|
df = pd.DataFrame(data=d)
|
2021-05-10 19:42:26 +02:00
|
|
|
|
2021-05-13 10:48:52 +02:00
|
|
|
with open("evaluation.csv", "a") as f:
|
|
|
|
df.to_csv(f, header=f.tell() == 0, index=False)
|