Knowledge Graph — Coursera Notes › Organizations › Microsoft › Azure › Azure Kubernetes Service (AKS)
Entry Script (score.py)
feature · part of Azure Kubernetes Service (AKS)
The entry script is a Python file (e.g., score.py) that defines how the model is loaded and how predictions are made. It contains:
init(): loads the registered model using joblib.run(): parses input JSON into a numpy array, calls model.predict(), returns the result as a list, and handles exceptions.
def init():
model = joblib.load('sklearn-regression-model.pkl')
def run(raw_data):
try:
data = json.loads(raw_data)['data']
data = np.array(data)
result = model.predict(data)
return result.tolist()
except Exception as e:
return str(e)
This is the text view of an interactive 3D knowledge graph — open this page with JavaScript enabled to explore it visually.