finish lab8
This commit is contained in:
parent
3ff773a060
commit
0fa82781af
@ -2,16 +2,13 @@ import mlflow
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import json
|
import json
|
||||||
|
|
||||||
artifact_path = 'mlruns/1//artifacts/model' #
|
artifact_path = 'mlruns_s444417/1/169f2bf3d53f4de088c494e889c6e65a/artifacts/model'
|
||||||
model = mlflow.pyfunc.load_model(artifact_path) #
|
model = mlflow.pyfunc.load_model(artifact_path)
|
||||||
|
|
||||||
with open(f'{model}/input_example.json') as f:
|
with open(f'input_example.json') as f:
|
||||||
input_example_data = json.load(f)
|
input_example_data = json.load(f)
|
||||||
|
|
||||||
input_example = np.array() #
|
input_example = np.array(input_example_data['inputs']).reshape(-1, 8)
|
||||||
|
|
||||||
print(f'Input example: {input_example}')
|
print(f'Input example: {input_example}')
|
||||||
print(f'Model prediction: {model.predict(input_example)}')
|
print(f'Model prediction: {model.predict(input_example)}')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@ import mlflow
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import json
|
import json
|
||||||
|
|
||||||
regsistry_path = '/mlruns/17/ /artifacts/model' #
|
registry_path = '/mlruns/17/4a8894c60fe34adcb79108c66d7330fc/artifacts/linear-model'
|
||||||
model = mlflow.pyfunc.load_model(registry_path) #
|
model = mlflow.pyfunc.load_model(registry_path)
|
||||||
|
|
||||||
with open(f'{model}/input_example.json') as f:
|
with open(f'{registry_path}/input_example.json') as f:
|
||||||
input_example_data = json.load(f)
|
input_example_data = json.load(f)
|
||||||
|
|
||||||
input_example = np.array() #
|
input_example = np.array(input_example_data['inputs']).reshape(-1, 8)
|
||||||
|
|
||||||
print(f'Input example: {input_example}')
|
print(f'Input example: {input_example}')
|
||||||
print(f'Model prediction: {model.predict(input_example)}')
|
print(f'Model prediction: {model.predict(input_example)}')
|
||||||
|
Loading…
Reference in New Issue
Block a user