This commit is contained in:
Mateusz 2024-05-04 16:23:32 +02:00
parent 0920a59d1f
commit 3f95fa102c
3 changed files with 12 additions and 5 deletions

View File

@ -2,4 +2,4 @@ FROM ubuntu:latest
RUN apt update && apt install -y python3-pip RUN apt update && apt install -y python3-pip
RUN pip install pandas numpy scikit-learn tensorflow RUN pip install pandas numpy scikit-learn tensorflow matplotlib

14
plot.py
View File

@ -1,15 +1,23 @@
import numpy as np import numpy as np
import matplotlib.pyplot as plt
def main(): def main():
accuracy = [] accuracy = []
build_numbers = []
with open("evaluation/metrics.txt") as f: with open("evaluation/metrics.txt") as f:
for line in f: for line in f:
if "Accuracy" in line: accuracy.append(float(line.split(",")[0]))
accuracy.append(float(line.split(":")[1].strip())) build_numbers.append(int(line.split(",")[1]))
build_numbers = np.arange(1, len(accuracy) + 1) plt.plot(build_numbers, accuracy)
plt.xlabel("Build Number")
plt.ylabel("Accuracy")
plt.title("Accuracy of the model over time")
plt.show()
plt.savefig("evaluation/accuracy.png")
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -16,7 +16,6 @@ def main():
y_pred = y_pred >= 0.5 y_pred = y_pred >= 0.5
os.makedirs("evaluation", exist_ok=True) os.makedirs("evaluation", exist_ok=True)
os.system("rm -rf evaluation/*")
np.savetxt("evaluation/y_pred.csv", y_pred, delimiter=",") np.savetxt("evaluation/y_pred.csv", y_pred, delimiter=",")