I'm creating my own Docker container for use with SageMaker and I'm wondering why the serve command creates a Flask app to serve predictions on data when I want to do a batch transform job. Wouldn't it be simpler to just unpickle the model and run the model's predict method on the dataset I want predictions for? I don't need a web api/endpoint. I just need to automatically generate predictions once a day.
Good question :) using the exact same code for batch inference and online inference reduces development overhead - the exact same stack can be used for both use-cases - and also reduces risks of having different results between something done in Batch and something done online. That being said, SageMaker is very flexible and what you describe can easily be done using the Training API. There is nothing in the Training API forcing you to use it for ML training, it is actually a very versatile docker orchestrator with advanced logging, metadata persistance, and built for fast and distributed data ingestion.