ium_478841/scripts/predict_s444356_registry.py
2022-05-15 12:54:51 +02:00

13 lines
451 B
Python

import mlflow
import numpy as np
import json
import os
print('################\n\n', os.listdir(), "\n\n###############")
model = mlflow.pyfunc.load_model(
'mlruns/1/4b83e774512444188fb587288818c298/artifacts/model')
with open('mlruns/1/4b83e774512444188fb587288818c298/artifacts/model/input_example.json') as f:
data = np.array([json.load(f)['inputs'][0]], dtype=np.float32)
print(f"Predicted values: {model.predict(data.reshape(-1, 2))}")