Add prediction from other student
This commit is contained in:
parent
89830e5d5e
commit
ff02751395
23
Jenkinsfile_predict
Normal file
23
Jenkinsfile_predict
Normal 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
15
lab_09_predict.py
Normal 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))
|
@ -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
|
Loading…
Reference in New Issue
Block a user