From 3f95fa102c66e813d0400127137b01f9a4d91dce Mon Sep 17 00:00:00 2001 From: Mateusz Date: Sat, 4 May 2024 16:23:32 +0200 Subject: [PATCH] IUM_06 --- Dockerfile | 2 +- plot.py | 14 +++++++++++--- predict.py | 1 - 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef6e85d..c23b0c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,4 +2,4 @@ FROM ubuntu:latest RUN apt update && apt install -y python3-pip -RUN pip install pandas numpy scikit-learn tensorflow \ No newline at end of file +RUN pip install pandas numpy scikit-learn tensorflow matplotlib \ No newline at end of file diff --git a/plot.py b/plot.py index a03c018..8bd9274 100644 --- a/plot.py +++ b/plot.py @@ -1,15 +1,23 @@ import numpy as np +import matplotlib.pyplot as plt def main(): accuracy = [] + build_numbers = [] with open("evaluation/metrics.txt") as f: for line in f: - if "Accuracy" in line: - accuracy.append(float(line.split(":")[1].strip())) + accuracy.append(float(line.split(",")[0])) + 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__": diff --git a/predict.py b/predict.py index c1f476b..068d494 100644 --- a/predict.py +++ b/predict.py @@ -16,7 +16,6 @@ def main(): y_pred = y_pred >= 0.5 os.makedirs("evaluation", exist_ok=True) - os.system("rm -rf evaluation/*") np.savetxt("evaluation/y_pred.csv", y_pred, delimiter=",")