IUM_s464980/predict.py

21 lines
555 B
Python
Raw Normal View History

import pandas as pd
from tensorflow import keras
import numpy as np
from sklearn.metrics import root_mean_squared_error
np.set_printoptions(threshold=np.inf)
data = pd.read_csv("df_test.csv")
X_test = data.drop("Performance Index", axis=1)
y_test = data["Performance Index"]
model = keras.models.load_model("model.keras")
predictions = model.predict(X_test)
with open("predictions.txt", "w") as f:
f.write(str(predictions))
2024-05-14 22:17:35 +02:00
accuracy = root_mean_squared_error(y_test, predictions)
2024-05-14 22:24:34 +02:00
with open("rmse.txt", 'a') as file:
2024-05-14 22:17:35 +02:00
file.write(str(accuracy))