predict firest sr test

This commit is contained in:
Filip Izydorczyk 2021-06-04 18:20:25 +02:00
parent c64c08e255
commit 58c2b11f4f
3 changed files with 16 additions and 2 deletions

View File

@ -21,10 +21,8 @@ pipeline {
stage('learning') { stage('learning') {
steps { steps {
sh 'python ./learning/ml.py' sh 'python ./learning/ml.py'
sh "python ./learning/ml-mlflow.py"
sh "export MLFLOW_TRACKING_URI=http://172.17.0.1:5000" sh "export MLFLOW_TRACKING_URI=http://172.17.0.1:5000"
sh "python ./learning/ml-mlflow.py" sh "python ./learning/ml-mlflow.py"
sh "ls -l"
} }
} }
stage('archiveArtifacts') { stage('archiveArtifacts') {

1
predict/Jenkinsfile vendored
View File

@ -17,6 +17,7 @@ pipeline {
sh 'ls -l' sh 'ls -l'
sh 'ls -l ./prediction_data' sh 'ls -l ./prediction_data'
sh 'ls -l ./prediction_data/movies_imdb' sh 'ls -l ./prediction_data/movies_imdb'
sh 'python ./predict.py'
} }
} }
} }

View File

@ -0,0 +1,15 @@
import json
import mlflow
import pandas as pd
model = mlflow.keras.load_model("./prediction_data/movies_imdb/MLmodel")
with open('./prediction_data/movies_imdb/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))