本頁說明如何使用 AML AI 產生的平台記錄,這些記錄屬於 Cloud Logging 的一部分。AML AI 會使用 Logging API 服務名稱 financialservices.googleapis.com 記錄下列活動:
- 建立引擎設定 (調整)
- 建立模型 (訓練)
- 回測作業
- 預測作業
事前準備
如要查看及管理記錄,請確認您具備正確的 IAM 權限和角色。
平台記錄啟用狀態
AML AI 的平台記錄一律會啟用 (無法關閉)。
記錄嚴重性
AML AI 記錄項目使用三種嚴重性等級:
- 作業開始或成功時傳送的項目
NOTICE ERROR,瞭解作業失敗的相關項目INFO,瞭解作業進度
查看平台記錄
如要查看平台記錄,請按照下列步驟操作:
控制台
如要在 Google Cloud 控制台中查看平台記錄:
前往 Logs Explorer:
選取適當的 Google Cloud 專案。
在「Query」(查詢) 欄位中,輸入下列查詢指令:
logName=("projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fbacktest" OR "projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation" OR "projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fmodel_creation" OR "projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fprediction")其中:
PROJECT_ID是您要偵錯或監控的專案 ID。例如:my-project。點選「執行查詢」。
如要進一步瞭解 Logs Explorer,請參閱「Logs Explorer 總覽」和「使用 Logs Explorer」。
gcloud
gcloud 指令列工具提供 Cloud Logging 的指令列介面。
如要查看專案的記錄,請執行下列指令:
gcloud logging read 'logName=("projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fbacktest" OR
"projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation" OR
"projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fmodel_creation" OR
"projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fprediction")' --project=PROJECT_ID
其中 PROJECT_ID 是專案 ID。 Google Cloud
如要進一步瞭解如何搭配使用 gcloud 工具與 Cloud Logging,請參閱 gcloud logging。
瞭解平台記錄檔
本節說明如何解讀 AML AI 的特定平台記錄。
START 記錄
作業開始執行時,系統會產生含有 eventKind=START 的記錄。
以下是啟動預測執行的記錄範例。
jsonPayload:
'@type': type.googleapis.com/google.cloud.financialservices.logging.v1.PredictionLog
engineVersion: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineVersions/ENGINE_VERSION_ID
eventKind: START
predictionResult:
dataset: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/datasets/DATASET_ID
endTime: '2023-05-31T00:00:00Z'
model: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/models/MODEL_ID
outputs:
explainabilityDestination:
tableUri: bq://PROJECT_ID.DATASET_ID.EXPLAINABILITY_TABLE_ID
writeDisposition: WRITE_EMPTY
predictionDestination:
tableUri: bq://PROJECT_ID.DATASET_ID.PREDICTION_TABLE_ID
writeDisposition: WRITE_EMPTY
logName: projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fprediction
operation:
first: true
id: projects/PROJECT_NUMBER/locations/REGION_ID/operations/OPERATION_ID
producer: financialservices.googleapis.com
receiveTimestamp: '2023-06-07T12:30:48.417285528Z'
resource:
labels:
instance_id: INSTANCE_ID
location: REGION_ID
prediction_result_id: PREDICTION_ID
resource_container: projects/PROJECT_NUMBER
type: financialservices.googleapis.com/PredictionResult
您可以在 Logs Explorer 的「Query」(查詢) 欄位中新增其他指令,縮小顯示的記錄範圍。
新增下列指令,顯示所選資料集的所有已啟動預測執行作業:
logName="projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fprediction" AND jsonPayload.predictionResult.dataset="projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/datasets/DATASET_ID" AND jsonPayload.eventKind="START"
PROGRESS 記錄
含有 eventKind=PROGRESS 的記錄會提供作業進度資訊。
以下是建立模型的記錄範例。completedTaskCount 與 taskCount 可用於估算模型訓練的進度。
jsonPayload:
'@type': type.googleapis.com/google.cloud.financialservices.logging.v1.ModelCreationLog
completedTaskCount: 11
engineVersion: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineVersions/ENGINE_VERSION_ID
eventKind: PROGRESS
model:
endTime: '2023-05-31T00:00:00Z'
engineConfig: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineConfigs/ENGINE_CONFIG_ID
engineVersion: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineVersions/ENGINE_VERSION_ID
lineOfBusiness: RETAIL
primaryDataset: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/datasets/DATASET_ID
state: CREATING
partyCount: '9246'
taskCount: 16
logName: projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fmodel_creation
operation:
id: projects/PROJECT_NUMBER/locations/REGION_ID/operations/OPERATION_ID
producer: financialservices.googleapis.com
receiveTimestamp: '2023-06-07T13:57:00.454668648Z'
resource:
labels:
instance_id: INSTANCE_ID
location: REGION_ID
model_id: MODEL_ID
resource_container: projects/PROJECT_NUMBER
type: financialservices.googleapis.com/Model
severity: INFO
timestamp: '2023-06-07T13:56:59.772973055Z'
END 記錄
作業結束時,系統會產生含有 eventKind=END 的記錄。
以下是引擎設定建立失敗的記錄範例。其中包含所提供資料集中的錯誤資料。
jsonPayload:
'@type': type.googleapis.com/google.cloud.financialservices.logging.v1.EngineConfigCreationLog
completedTaskCount: 3
engineConfig:
engineVersion: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/engineVersions/ENGINE_VERSION_ID
lineOfBusiness: RETAIL
performanceTarget:
partyInvestigationsPerPeriodHint: '100'
state: CREATING
tuning:
endTime: '2019-04-30T00:00:00Z'
primaryDataset: projects/PROJECT_ID/locations/REGION_ID/instances/INSTANCE_ID/datasets/DATASET_ID
eventKind: END
operationStatus:
code: 9
details:
- '@type': type.googleapis.com/google.rpc.ErrorInfo
domain: financialservices.googleapis.com
metadata:
count: '15'
data_field: party_id, validity_start_time
data_table: party
description: There is a duplicate primary key value in the database resulting
in unique key violation. Note that for tables with validity_start_time,
the primary key includes validity_start_time
test: GROUP BY party_id, validity_start_time HAVING count(1) > 1
reason: DUPLICATE_PRIMARY_KEY
message: Dataset validation failed with 1 error. See error details for individual
violations.
partyCount: '9246'
taskCount: 16
logName: projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation
operation:
id: projects/PROJECT_NUMBER/locations/REGION_ID/operations/OPERATION_ID
last: true
producer: financialservices.googleapis.com
receiveTimestamp: '2023-06-07T14:26:30.214382295Z'
resource:
labels:
engine_config_id: ENGINE_CONFIG_ID
instance_id: INSTANCE_ID
location: REGION_ID
resource_container: projects/PROJECT_NUMBER
type: financialservices.googleapis.com/EngineConfig
severity: ERROR
timestamp: '2023-06-07T14:26:29.670913895Z'
如要查看所有建立引擎設定錯誤記錄,請使用下列篩選器:
logName="projects/PROJECT_ID/logs/financialservices.googleapis.com%2Fengine_config_creation" AND severity>=ERROR