あなたは銀行で働いています。銀行のベンダーから提供されたカスタムの表形式の ML モデルがあります。トレーニング データは機密性が高いため利用できません。モデルは、各予測インスタンスの入力として文字列を受け入れる Vertex AI モデル サービング コンテナーとしてパッケージ化されています。各文字列では、特徴の値がコンマで区切られています。このモデルをオンライン予測用に本番環境にデプロイし、最小限の労力で時間の経過とともに特徴の分布を監視したいと考えています。どうすればよいでしょうか。
正解: A
The best option for deploying a custom tabular ML model to production for online predictions, and monitoring the feature distribution over time with minimal effort, using a model that was provided by the bank's vendor, the training data is not available due to its sensitivity, and the model is packaged as a Vertex AI Model serving container which accepts a string as input for each prediction instance, is to upload the model to Vertex AI Model Registry and deploy the model to a Vertex AI endpoint, create a Vertex AI Model Monitoring job with feature drift detection as the monitoring objective, and provide an instance schema. This option allows you to leverage the power and simplicity of Vertex AI to serve and monitor your model with minimal code and configuration. Vertex AI is a unified platform for building and deploying machine learning solutions on Google Cloud. Vertex AI can deploy a trained model to an online prediction endpoint, which can provide low-latency predictions for individual instances. Vertex AI can also provide various tools and services for data analysis, model development, model deployment, model monitoring, and model governance.
A Vertex AI Model Registry is a resource that can store and manage your models on Vertex AI. A Vertex AI Model Registry can help you organize and track your models, and access various model information, such as model name, model description, and model labels. A Vertex AI Model serving container is a resource that can run your custom model code on Vertex AI. A Vertex AI Model serving container can help you package your model code and dependencies into a container image, and deploy the container image to an online prediction endpoint. A Vertex AI Model serving container can accept various input formats, such as JSON, CSV, or TFRecord. A string input format is a type of input format that accepts a string as input for each prediction instance. A string input format can help you encode your feature values into a single string, and separate them by commas. By uploading the model to Vertex AI Model Registry and deploying the model to a Vertex AI endpoint, you can serve your model for online predictions with minimal code and configuration. You can use the Vertex AI API or the gcloud command-line tool to upload the model to Vertex AI Model Registry, and provide the model name, model description, and model labels. You can also use the Vertex AI API or the gcloud command-line tool to deploy the model to a Vertex AI endpoint, and provide the endpoint name, endpoint description, endpoint labels, and endpoint resources. A Vertex AI Model Monitoring job is a resource that can monitor the performance and quality of your deployed models on Vertex AI. A Vertex AI Model Monitoring job can help you detect and diagnose issues with your models, such as data drift, prediction drift, training/serving skew, or model staleness. Feature drift is a type of model monitoring metric that measures the difference between the distributions of the features used to train the model and the features used to serve the model over time. Feature drift can indicate that the online data is changing over time, and the model performance is degrading. By creating a Vertex AI Model Monitoring job with feature drift detection as the monitoring objective, and providing an instance schema, you can monitor the feature distribution over time with minimal effort. You can use the Vertex AI API or the gcloud command-line tool to create a Vertex AI Model Monitoring job, and provide the monitoring objective, the monitoring frequency, the alerting threshold, and the notification channel. You can also provide an instance schema, which is a JSON file that describes the features and their types in the prediction input data. An instance schema can help Vertex AI Model Monitoring parse and analyze the string input format, and calculate the feature distributions and distance scores1.
The other options are not as good as option A, for the following reasons:
* オプション B: モデルを Vertex AI モデル レジストリにアップロードして Vertex AI エンドポイントにデプロイし、特徴スキュー検出をモニタリング目標として Vertex AI モデル モニタリング ジョブを作成し、インスタンス スキーマを提供すると、オンライン データの変化を経時的にモニタリングできず、エラーやパフォーマンスの低下を引き起こす可能性があります。特徴スキューは、モデルのトレーニングに使用される特徴の分布と、特定の時点でモデルを提供するために使用される特徴の分布の差を測定する、モデル モニタリング メトリックの一種です。特徴スキューは、モデルが代表的なデータでトレーニングされていないこと、またはデータが時間の経過とともに変化していることを示している可能性があります。特徴スキュー検出をモニタリング目標として Vertex AI モデル モニタリング ジョブを作成し、インスタンス スキーマを提供することで、最小限の労力で特定の時点での特徴分布をモニタリングできます。
ただし、モデルを Vertex AI モデル レジストリにアップロードして Vertex AI エンドポイントにデプロイし、特徴スキュー検出をモニタリング目標として Vertex AI モデル モニタリング ジョブを作成し、インスタンス スキーマを提供するだけでは、オンライン データの変化を経時的にモニタリングできず、エラーやパフォーマンスの低下を引き起こす可能性があります。Vertex AI API または gcloud コマンドライン ツールを使用して、モデルを Vertex AI モデル レジストリにアップロードし、モデルを Vertex AI エンドポイントにデプロイし、Vertex AI モデル モニタリング ジョブを作成し、インスタンス スキーマを提供する必要があります。さらに、このオプションでは、オンライン データの経時的な変化やモデルのパフォーマンスと品質を測定するためのより直接的で関連性の高い指標である特徴ドリフトをモニタリングできません1。
* オプション C: サービングコンテナをリファクタリングしてキーと値のペアを入力形式として受け入れ、モデルを Vertex AI モデルレジストリにアップロードして Vertex AI エンドポイントにデプロイし、モニタリング目標として特徴ドリフト検出を指定した Vertex AI モデルモニタリングジョブを作成すると、モデルを Vertex AI モデルレジストリにアップロードして Vertex AI エンドポイントにデプロイし、モニタリング目標として特徴ドリフト検出を指定した Vertex AI モデルモニタリングジョブを作成し、インスタンススキーマを提供するよりも多くのスキルと手順が必要になります。キーと値のペアの入力形式は、各予測インスタンスの入力としてキーと値のペアを受け入れるタイプの入力形式です。キーと値のペアの入力形式を使用すると、JSON オブジェクトで特徴名と値を指定し、それらをコロンで区切ることができます。サービングコンテナをリファクタリングしてキーと値のペアを入力形式として受け入れ、モデルを Vertex AI モデルレジストリにアップロードして Vertex AI エンドポイントにデプロイし、モニタリング目標として特徴ドリフト検出を指定した Vertex AI モデルモニタリングジョブを作成することで、最小限のコードと構成でモデルを提供およびモニタリングできます。コードを記述して、キーと値のペアを入力形式として受け入れるようにサービス コンテナをリファクタリングし、Vertex AI API または gcloud コマンドライン ツールを使用してモデルを Vertex AI モデル レジストリにアップロードし、モデルを Vertex AI エンドポイントにデプロイして、Vertex AI モデル モニタリング ジョブを作成できます。ただし、キーと値のペアを入力形式として受け入れるようにサービス コンテナをリファクタリングし、モデルを Vertex AI モデル レジストリにアップロードして Vertex AI エンドポイントにデプロイし、特徴ドリフト検出をモニタリング目標として Vertex AI モデル モニタリング ジョブを作成するには、モデルを Vertex AI モデル レジストリにアップロードして Vertex AI エンドポイントにデプロイし、特徴ドリフト検出をモニタリング目標として Vertex AI モデル モニタリング ジョブを作成し、インスタンス スキーマを提供するよりも多くのスキルと手順が必要です。コードを記述し、サービス コンテナをリファクタリングし、モデルを Vertex AI モデル レジストリにアップロードして Vertex AI エンドポイントにデプロイし、Vertex AI モデル モニタリング ジョブを作成する必要があります。さらに、このオプションではインスタンス スキーマは使用されません。インスタンス スキーマは、Vertex AI Model Monitoring が文字列入力形式を解析および分析し、特徴分布と距離スコアを計算するのに役立つ JSON ファイルです1。
* Option D: Refactoring the serving container to accept key-value pairs as input format, uploading the model to Vertex AI Model Registry and deploying the model to a Vertex AI endpoint, creating a Vertex AI Model Monitoring job with feature skew detection as the monitoring objective would require more skills and steps than uploading the model to Vertex AI Model Registry and deploying the model to a Vertex AI endpoint, creating a Vertex AI Model Monitoring job with feature drift detection as the monitoring objective, and providing an instance schema, and would not help you monitor the changes in the online data over time, and could cause errors or poor performance. Feature skew is a type of model monitoring metric that measures the difference between the distributions of the features used to train the model and the features used to serve the model at a given point in time. Feature skew can indicate that the model is not trained on the representative data, or that the data is changing over time.
By creating a Vertex AI Model Monitoring job with feature skew detection as the monitoring objective, you can monitor the feature distribution at a given point in time with minimal effort. However, refactoring the serving container to accept key-value pairs as input format, uploading the model to Vertex AI Model Registry and deploying the model to a Vertex AI endpoint, creating a Vertex AI Model Monitoring job with feature skew detection as the monitoring objective would require more skills and steps than uploading the model to Vertex AI Model Registry and deploying the model to a Vertex AI endpoint, creating a Vertex AI Model Monitoring job with feature drift detection as the monitoring objective, and providing an instance schema, and would not help you monitor the changes in the online data over time, and could cause errors or poor performance. You would need to write code, refactor the serving container, upload the model to Vertex AI Model Registry, deploy the model to a Vertex AI endpoint, and create a Vertex AI Model Monitoring job. Moreover, this option would not monitor the feature drift, which is a more direct and relevant metric for measuring the changes in the online data over time, and the model performance and quality1.
References:
* Using Model Monitoring | Vertex AI | Google Cloud