evaluation appends to csv
Some checks failed
s444354-training/pipeline/head There was a failure building this commit

This commit is contained in:
Adrian Charkiewicz 2022-05-07 04:46:30 +02:00
parent 6cfda35026
commit 97681d967d
3 changed files with 14 additions and 5 deletions

View File

@ -13,6 +13,7 @@ RUN pip3 install torch
RUN pip3 install seaborn RUN pip3 install seaborn
RUN pip3 install torchvision RUN pip3 install torchvision
RUN pip3 install sklearn RUN pip3 install sklearn
RUN pip3 install csv
# RUN python3 -m pip install kaggle # RUN python3 -m pip install kaggle
RUN python3 -m pip install pandas RUN python3 -m pip install pandas
RUN pip3 install matplotlib RUN pip3 install matplotlib

View File

@ -37,8 +37,8 @@ pipeline {
copyArtifacts projectName: 's444354-create-dataset' copyArtifacts projectName: 's444354-create-dataset'
copyArtifacts projectName: 's444354-training/$TRAINING_BRANCH' copyArtifacts projectName: 's444354-training/$TRAINING_BRANCH'
sh 'python3 ./evaluation.py' sh 'python3 ./evaluation.py'
archiveArtifacts 'TRAIN_winequality-red.csv' archiveArtifacts 'eval.csv'
sh "ls -la"
} }
} }
} }

View File

@ -2,6 +2,7 @@ import pandas as pd
import re import re
from sklearn import metrics from sklearn import metrics
import numpy as np import numpy as np
import csv
f = open("result.txt", "r") f = open("result.txt", "r")
@ -16,6 +17,13 @@ for x in f:
list_result.append(result) list_result.append(result)
list_predicted.append(predicted) list_predicted.append(predicted)
print("MAE: ", metrics.mean_absolute_error(list_result, list_predicted)) metrics = metrics.mean_absolute_error(list_result, list_predicted), metrics.mean_squared_error(list_result, list_predicted),np.sqrt(metrics.mean_absolute_error(list_result, list_predicted))
print("MSE: ",metrics.mean_squared_error(list_result, list_predicted)) print("MAE: ", metrics[0])
print("RMSE: ",np.sqrt(metrics.mean_absolute_error(list_result, list_predicted))) print("MSE: ",metrics[1])
print("RMSE: ",metrics[2])
with open('eval.csv', 'a', newline='') as f:
writer = csv.writer(f)
writer.writerow((metrics[0],metrics[1], metrics[2]))