First evaluation test
This commit is contained in:
parent
31d173ca47
commit
5e28406d7c
@ -1,7 +1,5 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {docker { image 'snowycocoon/ium_434788:3'}}
|
||||||
dockerfile true
|
|
||||||
}
|
|
||||||
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
|
//Definijuemy parametry, które będzie można podać podczas wywoływania zadania
|
||||||
parameters {
|
parameters {
|
||||||
string (
|
string (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
docker { image 'snowycocoon/ium_434788:2' }
|
docker { image 'snowycocoon/ium_434788:3' }
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
|
@ -1,10 +1,20 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {docker { image 'adnovac/ium_s434760:1.0' }}
|
agent {docker { image 'snowycocoon/ium_434788:3'}}
|
||||||
parameters{
|
parameters{
|
||||||
|
buildSelector(
|
||||||
|
defaultSelector: lastSuccessful(),
|
||||||
|
description: 'Which build to use for copying data artifacts',
|
||||||
|
name: 'WHICH_BUILD_DATA'
|
||||||
|
)
|
||||||
buildSelector(
|
buildSelector(
|
||||||
defaultSelector: lastSuccessful(),
|
defaultSelector: lastSuccessful(),
|
||||||
description: 'Which build to use for copying artifacts',
|
description: 'Which build to use for copying train artifacts',
|
||||||
name: 'WHICH_BUILD'
|
name: 'WHICH_BUILD_TRAIN'
|
||||||
|
)
|
||||||
|
buildSelector(
|
||||||
|
defaultSelector: lastSuccessful(),
|
||||||
|
description: 'Which build to use for copying current project artifacts',
|
||||||
|
name: 'WHICH_BUILD_THIS'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,6 +24,22 @@ pipeline {
|
|||||||
steps
|
steps
|
||||||
{
|
{
|
||||||
copyArtifacts(fingerprintArtifacts: true, projectName: 's434788-create-dataset', selector: buildParameter('WHICH_BUILD'))
|
copyArtifacts(fingerprintArtifacts: true, projectName: 's434788-create-dataset', selector: buildParameter('WHICH_BUILD'))
|
||||||
|
copyArtifacts(fingerprintArtifacts: true, projectName: 's434788-training/master', selector: buildParameter('WHICH_BUILD_TRAIN'))
|
||||||
|
copyArtifacts(fingerprintArtifacts: true, optional: true, projectName: 's434788-evaluation/master', selector: buildParameter('WHICH_BUILD_THIS'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('evaluate')
|
||||||
|
{
|
||||||
|
steps
|
||||||
|
{
|
||||||
|
catchError {
|
||||||
|
sh 'python3.8 Zadanie_06_evaluate.py'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('archive artifacts') {
|
||||||
|
steps {
|
||||||
|
archiveArtifacts 'results.txt,evaluation.png'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1,36 @@
|
|||||||
print('evaluating')
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
from os import path
|
||||||
|
from tensorflow import keras
|
||||||
|
import sys
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from sklearn.metrics import accuracy_score, classification_report
|
||||||
|
|
||||||
|
model = keras.models.load_model('saved_model.pb')
|
||||||
|
print('evaluating')
|
||||||
|
|
||||||
|
test_df =pd.read_csv('test.csv')
|
||||||
|
y_test = test_df.quality
|
||||||
|
x_test = test_df.drop(['quality'], axis= 1)
|
||||||
|
|
||||||
|
y_pred = model.predict(x_test)
|
||||||
|
|
||||||
|
y_pred = np.around(y_pred, decimals=0)
|
||||||
|
|
||||||
|
results = accuracy_score(y_test,y_pred)
|
||||||
|
with open('results.txt', 'a+', encoding="UTF-8") as f:
|
||||||
|
f.write(str(results) +"\n")
|
||||||
|
|
||||||
|
with open('results.txt', 'r', encoding="UTF-8") as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
|
||||||
|
fig = plt.figure(figsize=(10,10))
|
||||||
|
|
||||||
|
chart = fig.add_subplot()
|
||||||
|
chart.set_ylabel("Accuracy")
|
||||||
|
chart.set_xlabel("Number of build")
|
||||||
|
x = np.arange(0, len(lines), 1)
|
||||||
|
y = [float(x) for x in lines]
|
||||||
|
print(y)
|
||||||
|
plt.plot(x,y,"ro")
|
||||||
|
plt.savefig("evaluation.png")
|
Loading…
Reference in New Issue
Block a user