ium_444409/predict_s444356.py
2022-05-11 21:14:48 +02:00

15 lines
384 B
Python

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