

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 建議用於新產品需求預測的 AWS 架構
<a name="architecture"></a>

當您將 AI/ML 管道擴展到多個產品和區域時，建議您遵循機器學習操作 (MLOps) 的重現性、可靠性和可擴展性最佳實務。如需詳細資訊，請參閱 Amazon SageMaker AI 文件中的[實作 MLOps](https://docs.aws.amazon.com/sagemaker/latest/dg/mlops.html)。下圖顯示實作 ML 模型的範例 AWS 架構，可預測新產品簡介的需求。



![由資料工程、DevOps 和資料科學層組成的 AWS 架構。](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/forecast-demand-new-product/images/architecture-diagram.png)


範例 AWS 架構包含三層：資料工程、DevOps 和資料科學。

資料工程層著重於使用 [AWS Glue](https://docs.aws.amazon.com/glue/latest/dg/what-is-glue.html)，然後在 [Amazon Simple Storage Service (Amazon S3)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) 中以經濟實惠的方式儲存資料，從公司資料來源擷取資料。 AWS Glue 是一種全受管無伺服器 ETL 服務，可協助您分類、清理、轉換和可靠地在不同資料存放區之間傳輸資料。Amazon S3 是一種物件儲存服務，可提供可擴展性、資料可用性、安全性和效能。資料工程層也會在 Amazon SageMaker AI 中使用批次[轉換，顯示離線批次](https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html)推論部署。批次轉換會從 Amazon S3 取得輸入資料，並透過 [Amazon API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html) 在一或多個 HTTP 請求中將其傳送至推論管道模型。Amazon API Gateway 是一項全受管服務，可協助您建立、發佈、維護、監控和保護任何規模APIs。最後，資料工程層會顯示 [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html) 的使用方式，這項服務可讓您了解整個系統的效能，並協助您設定警示、自動對變更做出反應，以及取得營運運作狀態的統一檢視。CloudWatch 會將日誌檔案儲存到您指定的 Amazon S3 儲存貯體。

DevOps 層使用 API Gateway、CloudWatch 和 [Amazon SageMaker AI Model Monitor](https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor.html) 進行即時推論部署。Model Monitor 可協助您針對模型品質的偏差設定自動警示觸發系統，例如資料偏離和異常。[Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) 會從模型監控收集日誌檔案，並在模型品質達到您預設的特定閾值時通知您。DevOps layer 也顯示使用 [AWS CodePipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html)來自動化程式碼交付管道。

資料科學層顯示使用 [Amazon SageMaker AI 管道](https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines.html)和 [Amazon SageMaker AI Feature Store](https://docs.aws.amazon.com/sagemaker/latest/dg/feature-store.html) 來管理機器學習生命週期。SageMaker AI Pipelines 是一種專用工作流程協同運作服務，可協助您自動化從資料預先處理到模型監控的所有 ML 階段。使用直覺式 UI 和 Python SDK，您可以大規模管理可重複end-to-end ML 管道。與多個 的原生整合 AWS 服務 可協助您根據您的 MLOps 需求自訂 ML 生命週期。Feature Store 是全受管的專用儲存庫，可存放、共用和管理 ML 模型的功能。*功能*是 ML 模型的輸入，並在訓練和推論期間使用。