evaluation appends to csv
Some checks failed
s444354-training/pipeline/head There was a failure building this commit
Some checks failed
s444354-training/pipeline/head There was a failure building this commit
This commit is contained in:
parent
6cfda35026
commit
97681d967d
@ -13,6 +13,7 @@ RUN pip3 install torch
|
||||
RUN pip3 install seaborn
|
||||
RUN pip3 install torchvision
|
||||
RUN pip3 install sklearn
|
||||
RUN pip3 install csv
|
||||
# RUN python3 -m pip install kaggle
|
||||
RUN python3 -m pip install pandas
|
||||
RUN pip3 install matplotlib
|
||||
|
@ -37,8 +37,8 @@ pipeline {
|
||||
copyArtifacts projectName: 's444354-create-dataset'
|
||||
copyArtifacts projectName: 's444354-training/$TRAINING_BRANCH'
|
||||
sh 'python3 ./evaluation.py'
|
||||
archiveArtifacts 'TRAIN_winequality-red.csv'
|
||||
sh "ls -la"
|
||||
archiveArtifacts 'eval.csv'
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import pandas as pd
|
||||
import re
|
||||
from sklearn import metrics
|
||||
import numpy as np
|
||||
import csv
|
||||
|
||||
f = open("result.txt", "r")
|
||||
|
||||
@ -16,6 +17,13 @@ for x in f:
|
||||
|
||||
list_result.append(result)
|
||||
list_predicted.append(predicted)
|
||||
print("MAE: ", metrics.mean_absolute_error(list_result, list_predicted))
|
||||
print("MSE: ",metrics.mean_squared_error(list_result, list_predicted))
|
||||
print("RMSE: ",np.sqrt(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("MAE: ", metrics[0])
|
||||
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]))
|
||||
|
Loading…
Reference in New Issue
Block a user