Batch Transform with output_filter with ranges failed
Please fill out the form below.
System Information
- Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Xgboost
- Framework Version:0.90-1-cpu-py3
- Python Version:3.6.5
- CPU or GPU:CPU
- Are you using a custom image:No (default latest xgboost image: 0.90-1-cpu-py3)
Describe the problem
Batch transform failed when output_filter is specified in ranges. In this transformed dataset, the first and second are IDs, and the last column (246) is supposed to be the scored result. I would like to have the output including 2 id columns and the result column only. Following examples here: https://aws.amazon.com/blogs/machine-learning/associating-prediction-results-with-input-data-using-amazon-sagemaker-batch-transform/
Minimal repro / logs
(...)transform/transform_ID.csv: Invalid JsonPath: $[0:2,246:]: only single range filters of format (eg: [1:5]) are supported. Format [0:2,246:] is not supported
- Exact command to reproduce:
transformer =sagemaker.transformer.Transformer( base_transform_job_name='Batch-Transform', model_name=model_name, instance_count=1, instance_type='ml.m4.xlarge', accept= 'text/csv', assemble_with = 'Line', output_path=output_data_path_id )
transformer.transform(input_data_path_id, content_type='text/csv', split_type='Line', input_filter="$[2:]", join_source= "Input", output_filter="$[0:2,246:]")
Hi tnaduc,
Thanks for bringing it to our attention. Unfortunately, we don't support multi-range JSON filter for now. We'll add this to our roadmap and let you know here when it's fixed.
Thanks for using SageMaker.
Hi @Aloha106 ,
Are there any further plans to add support for multi-range JSON filters? I am getting a similar exception to that of @tnaduc : "Invalid JsonPath: $[0,43:]: only single range filters of format (eg: [1:5]) are supported. Format [0,43:] is not supported".
This is despite the examples given on the web page (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DataProcessing.html#sagemaker-Type-DataProcessing-OutputFilter) indicating it is possible to use multi-ranges i.e. " Examples: "$", "$[0,5:]", "$['id','SageMakerOutput']" "
Thanks