xgboost sagemaker batch transform job output in multiple lines

0

Hello,

I've just trained a churn prediction model with XGBoost algorithm, based on the SageMaker example notebooks. I've created SageMaker batch transformation jobs using this model using input from CSV file with multiple records, however the output file is a single record CSV containing all the inferences in a single comma separated row. The result is that I'm not able to use the "Join source" feature with "Input - Merge input data with job output" since the input and output files must match the number of records. I've tried with different batch job configurations but I always get the same single line output file.

Do you know if is there any configuration that allows me to merge input and output in order to have a direct association between an input column with its inference result? Is this a restriction from the XGBoost algorithm built-in implementation?

AWS
질문됨 4년 전840회 조회
1개 답변
0
수락된 답변

Sounds like a configuration issue, this algorithm should be able to output proper output CSVs.

Are you using accept="text/csv" and assemble_with="Line" on your Transformer? Is your strategy set to SingleRecord or MultiRecord?

And split_type="Line", content_type="text/csv" on the .transform() call?

I have had custom algorithms accidentally output row vectors instead of column vectors for multi-record batches in the past (because they gave a 1D output which the default serializer interpreted as a row), but not built-in algorithms.

Dropping to SingleRecord could be a last resort (forcing Batch Transform itself to handle the serialization), but would decrease efficiency/speed.

AWS
전문가
Alex_T
답변함 4년 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인