Deploying batch transformers
Some use cases don't benefit from a real-time endpoint. For example, you may want to predict 10 GB of data once a week in one go, get the results, and feed them to a downstream application. Batch transformers are a very simple way to get this done.
In this example, we will use the Scikit-Learn script that we trained on the Boston Housing dataset in Chapter 7, Extending Machine Learning Services with Built-in Frameworks.Let's get started:
- Configure the estimator as usual:
from sagemaker.sklearn import SKLearn sk = SKLearn(entry_point='sklearn-boston-housing.py', role=sagemaker.get_execution_role(), instance_count=1, instance_type='ml.m5.large', output_path=output, hyperparameters={'normalize': True, 'test-size': 0.1}) sk.fit({'training':training})
- Let's predict the training set in batch mode....