added prediciton from another job

This commit is contained in:
Dawid 2021-05-23 15:19:02 +02:00
parent f7515627a5
commit 79a4989841
3 changed files with 22 additions and 4 deletions

View File

@ -16,8 +16,13 @@ pipeline {
stage('training') {
steps {
sh 'rm -rf country_vaccination'
sh 'chmod +x mlflow_model.py'
sh 'python3 mlflow_model.py'
sh 'chmod +x pred_from_model.py'
sh 'python3 pred_from_model.py'
}
}
stage('archiveArtifacts') {
steps{
archiveArtifacts 'movies_imdb/**'
}
}
stage('sendMail') {

View File

@ -15,8 +15,8 @@ pipeline {
}
stage('training') {
steps {
//sh 'chmod +x tensor.py'
//sh 'python3 tensor.py'
sh 'chmod +x tensor.py'
sh 'python3 tensor.py'
sh 'rm -rf country_vaccination'
sh 'chmod +x mlflow_model.py'
sh 'python3 mlflow_model.py'

13
pred_from_model.py Normal file
View File

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