Add prediction from other student

This commit is contained in:
michalzareba 2021-05-23 14:15:08 +02:00
parent 89830e5d5e
commit ff02751395
3 changed files with 40 additions and 1 deletions

23
Jenkinsfile_predict Normal file
View File

@ -0,0 +1,23 @@
pipeline {
agent {dockerfile true}
parameters {
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR')
}
stages {
stage('copyArtifacts') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's434804-training', selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Predict example value'){
steps {
'sh 'python3 "./lab_09_predict.py"''
}
}
}
}

15
lab_09_predict.py Normal file
View File

@ -0,0 +1,15 @@
import json
import mlflow
import pandas as pd
model = mlflow.keras.load_model("country_vaccination")
with open('country_vaccination/input_example.json', 'r') as datafile:
data = json.load(datafile)
example_input = data["inputs"]
input_dictionary = {i : x for i, x in enumerate(example_input) }
input_ex = pd.DataFrame(input_dictionary, index=[0])
print(model.predict(input_ex))

View File

@ -10,4 +10,5 @@ wget==3.2
gast==0.3.3
sacred==0.8.2
GitPython==3.1.14
matplotlib==3.3.4
matplotlib==3.3.4
mlflow==1.17.0