簡體   English   中英

在 sagemaker AWS 中導入 PKL 發布 API

[英]Import PKL in sagemaker AWS to publish API

我有一個 .pkl 文件,它是經過訓練的 model 的結果。我想從 sage maker 創建一個端點以便能夠使用預測,我已經設法從 s3 讀取文件但我找不到關於如何將“已編譯”公開為 API 的確切文檔

s3 = boto3.resource('s3')
bucket = s3.Bucket("sagemake-models-workshop").Object("pikle- 
file/contatos/xgb_contratos_mensual_RandomizedSearchLinux.pkl").get()['Body'].read()

bucket_pickle = pickle.loads(bucket)

output:

bucket_pickle

XGBRegressor(base_score=0.5, booster='gbtree', colsample_bylevel=1,
         colsample_bynode=1, colsample_bytree=0.1, gamma=0, gpu_id=-1,
         importance_type='gain', interaction_constraints='',
         learning_rate=0.33, max_delta_step=0, max_depth=3,
         min_child_weight=1, missing=nan, monotone_constraints='()',
         n_estimators=150, n_jobs=0, num_parallel_tree=1, random_state=0,
         reg_alpha=0, reg_lambda=1, scale_pos_weight=1, subsample=1,
         tree_method='exact', validate_parameters=1, verbosity=None)

如果您的 model 是 XGBoost model,您可以考慮使用 XGBoost Framework 容器部署它。 有關 XGBoost 自帶 Model的詳細信息,請參閱此鏈接。

我在 AWS 工作,我的意見是我自己的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM