Dodanie 'lab_09_predict_coop.py'
Add test prediction from registry
This commit is contained in:
parent
6cf11e818a
commit
82d47c078f
21
lab_09_predict_coop.py
Normal file
21
lab_09_predict_coop.py
Normal file
@ -0,0 +1,21 @@
|
||||
import json
|
||||
import mlflow
|
||||
import pandas as pd
|
||||
|
||||
|
||||
model_name = "s430705"
|
||||
model_version = 8
|
||||
|
||||
mlflow.set_tracking_uri("http://172.17.0.1:5000")
|
||||
|
||||
model = mlflow.pyfunc.load_model(
|
||||
model_uri=f"models:/{model_name}/{model_version}"
|
||||
)
|
||||
|
||||
with open('movies_imdb2/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))
|
Loading…
Reference in New Issue
Block a user