I am working on a AWS SageMaker (SKlearn) batch transform job, in which the prediction data is big and therefore I'm required to use mini-batches (where the input .csv is split up into smaller .csv files).
I have this working and outputting a .csv file with the ids and the predictions. However I am attempting to implement a way in which I can have a total of three output files from the batch transform job - which are different .csv files each aggregated in a slightly different way.
My issue is I am not sure how to instruct SageMaker to output multiple files. I have tried the following code as the prediction method submitted in the entry_point file:
def output_fn(prediction, accept):
output_one = prepare_one(prediction)
output_two, output_three = prepare_others(output_one)
return output_one, output_two, output_three
Couple ideas/issues I am currently working with:
- I think the batching strategy will cause issue. As the additional outputs are aggregations on the total predictions but SageMaker will treat each mini-batch separately (I assume?)
- Can I simply use
boto3and save extra files using that and treat the SageMaker output as onlyoutput_one
Any help would be much appreciated