我有一个经过预训练的XgBoost模型用于多标签分类,我可以使用sagemaker客户端的create_model
,create_endpoint_configuration
和create_endpoint
函数将其部署为端点。调用它时,将返回每个标签的概率列表。
现在,我想将端点输出从概率列表转换为表示这些概率的实际标签。
我知道我可以使用XGBoost估计器和entry_point
来编写自己的output_fn
。但是我仍然想使用sagemaker客户端功能,因为它们为我们的CI / CD管道提供了更多控制。
如何在已经使用的sagemaker客户端功能中使用entry_point
(或类似功能)?
答案 0 :(得分:1)
您可以构建自己的xgboost图像来运行模型。我的意思是您更新代码,构建映像并推送到ECR,然后将其用作Sagemaker映像
这是AWS构建xgboost图像的方式。 https://github.com/aws/sagemaker-xgboost-container
一些有用的链接: https://github.com/awslabs/amazon-sagemaker-examples/tree/master/advanced_functionality/scikit_bring_your_own/container https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo.html