ium_430705/lab_09_predict.py

16 lines
391 B
Python
Raw Normal View History

2021-05-23 14:15:08 +02:00
import json
import mlflow
import pandas as pd
model = mlflow.keras.load_model("country_vaccination")
with open('country_vaccination/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))