ium_444356/predict.py
Maciej Czajka 26b0736758
All checks were successful
s444356-evaluation/pipeline/head This commit looks good
s444356-training/pipeline/head This commit looks good
update predict.py, jenkinsfile_predict
2022-05-11 19:02:01 +02:00

16 lines
425 B
Python

import json
import mlflow
import pandas as pd
#logged_model = 'mlruns/1/d5b6f9c1784a4d2dbb8592cd4ad364d7/artifacts/model'
logged_model = 'mlruns/1/fa3e620f03e64d888c364827907fb6f5/artifacts/s444409/'
loaded_model = mlflow.pyfunc.load_model(logged_model)
with open(f'{logged_model}/input_example.json') as f:
data = json.load(f)
input_example = pd.DataFrame(data['inputs'][0])
loaded_model.predict(input_example)