ium_444507/lab08_predict.py
Adam Wojdyla 458ef1af1f
Some checks failed
s444507-predict-s444356/pipeline/head There was a failure building this commit
s444507-evaluation/pipeline/head This commit looks good
444507-training/pipeline/head There was a failure building this commit
run prediction
2022-05-16 03:02:18 +02:00

16 lines
401 B
Python

import mlflow
import mlflow.sklearn
import pandas as pd
import numpy as np
import json
logged_model = 'mlruns/1/4b83e774512444188fb587288818c298/artifacts/model'
model = mlflow.pyfunc.load_model(logged_model)
with open('my_model/input_example.json') as f:
data = json.load(f)
input_example = np.array([data['inputs'][0]]).reshape(-1,4)
print(f'Prediction: {model.predict(input_example)}')