In this section, the trained model will be deployed, so that we can predict weekly sales for the next nine weeks for a given department.
Let's have a look at the following code :
deepAR_predictor = deepAR.deploy(initial_instance_count=1, instance_type='ml.m4.xlarge')
In the preceding code, the deploy function of the deepAR estimator is used to host the model as an endpoint. The number and type of hosting instances should be specified through the following parameters :
- initial_instance_count
- instance_type
To assess the model performance, we use department number 90, as shown in the following code:
#Predict last 9 weeks of a department and compare to ground truth
deepAR_predictor.content_type = 'application/json'
dept = 90
prediction_data = da.salesinference.buildInferenceData(dept, trainingSet, testSet)
#print(prediction_data...