test parameters
This commit is contained in:
parent
5f926cc75c
commit
3f8b863554
3
.gitignore
vendored
3
.gitignore
vendored
@ -12,4 +12,5 @@ venv
|
||||
.idea
|
||||
model_resutls.txt
|
||||
model
|
||||
metrics.txt
|
||||
metrics.txt
|
||||
metrics.png
|
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@ -22,6 +22,7 @@ pipeline {
|
||||
copyArtifacts filter: '*', projectName: 's444463-create-dataset'
|
||||
sh 'python3 ./deepl.py $EPOCH'
|
||||
archiveArtifacts artifacts: "model"
|
||||
build job: "s444380-evaluation/master"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,12 @@ pipeline {
|
||||
dockerfile true
|
||||
}
|
||||
parameters {
|
||||
string (
|
||||
defaultValue: '10',
|
||||
description: 'Epochs number',
|
||||
name: 'EPOCH',
|
||||
trim: false
|
||||
)
|
||||
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH'
|
||||
buildSelector(
|
||||
defaultSelector: lastSuccessful(),
|
||||
description: 'From which build copy content',
|
||||
name: 'BUILD_SELECTOR'
|
||||
)
|
||||
}
|
||||
stages {
|
||||
stage('checkout: Check out from version control') {
|
||||
@ -18,11 +18,11 @@ pipeline {
|
||||
}
|
||||
stage('bash script') {
|
||||
steps {
|
||||
withEnv(["EPOCH=${params.EPOCH}"]) {
|
||||
copyArtifacts filter: '*', projectName: 's444463-training/master'
|
||||
withEnv(["BRANCH=${params.BRANCH}"]) {
|
||||
copyArtifacts filter: '*', projectName: 's444463-training/$BRANCH'
|
||||
copyArtifacts filter: '*', projectName: 's444463-create-dataset'
|
||||
sh 'python3 ./evaluation.py'
|
||||
archiveArtifacts artifacts: "metrics.txt"
|
||||
archiveArtifacts artifacts: "metrics.txt" "metrics.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ import pandas as pd
|
||||
import numpy as np
|
||||
from sklearn.feature_extraction.text import TfidfVectorizer
|
||||
import scipy
|
||||
import matplotlib.pyplot as plt
|
||||
import re
|
||||
|
||||
if __name__ == "__main__":
|
||||
data = pd.read_csv('fake_job_postings.csv', engine='python')
|
||||
@ -74,6 +76,18 @@ if __name__ == "__main__":
|
||||
f.write(f"Precision = {precision}\n")
|
||||
f.write(f"Recall = {recall}\n")
|
||||
|
||||
|
||||
f_read = open("metrics.txt", "r")
|
||||
content = re.findall('F-SCORE = [0-9.]+', f_read.read())
|
||||
fscores = []
|
||||
for c in content:
|
||||
r = re.findall("\d+\.\d+", c)
|
||||
fscores.append(r[0])
|
||||
|
||||
plt.plot(fscores)
|
||||
plt.ylabel('F score')
|
||||
plt.xticks(np.arange(0, len(fscores)+1, 5))
|
||||
plt.savefig('metrics.png')
|
||||
# f.write(f"TP descriptions:")
|
||||
# for i in TP:
|
||||
# f.write(i+'\n')
|
||||
|
Loading…
Reference in New Issue
Block a user