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
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南