Created
June 5, 2020 07:06
-
-
Save korkridake/90fc321f37c5f831456e1b2b753e01b0 to your computer and use it in GitHub Desktop.
MLOps Ep.4 Productionizing Scoring Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import libraries | |
import json | |
import numpy as np | |
from azureml.core.model import Model | |
import joblib | |
# Load model | |
model_path = Model.get_model_path(model_name="sklearn_regression_model.pkl") | |
model = joblib.load(model_path) | |
# Prepare data | |
data = np.random.rand(4, 13) | |
# Score data | |
request_headers = {} | |
result = model.predict(data) | |
print("Test result: ", {"result": result.tolist()}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment