View a markdown version of this page

dataprocessing コマンドを使用したデータ処理 - Amazon Neptune

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

dataprocessing コマンドを使用したデータ処理

Neptune ML dataprocessing コマンドを実行して、データ処理ジョブの作成、ステータスの確認、停止、またはアクティブなデータ処理ジョブの一覧を表示します。

Neptune ML dataprocessing コマンドを使用したデータ処理ジョブの作成

新しいジョブを作成するための典型的なNeptune ML dataprocessing コマンドは次のようになります。

AWS CLI
aws neptunedata start-ml-data-processing-job \ --endpoint-url https://your-neptune-endpoint:port \ --input-data-s3-location "s3://(S3 bucket name)/(path to your input folder)" \ --id "(a job ID for the new job)" \ --processed-data-s3-location "s3://(S3 bucket name)/(path to your output folder)"

詳細については、 AWS CLI 「 コマンドリファレンス」のstart-ml-data-processing-job」を参照してください。

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.start_ml_data_processing_job( inputDataS3Location='s3://(S3 bucket name)/(path to your input folder)', id='(a job ID for the new job)', processedDataS3Location='s3://(S3 bucket name)/(path to your output folder)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/dataprocessing \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "inputDataS3Location" : "s3://(S3 bucket name)/(path to your input folder)", "id" : "(a job ID for the new job)", "processedDataS3Location" : "s3://(S3 bucket name)/(path to your output folder)" }'
注記

この例では、 AWS 認証情報が 環境で設定されていることを前提としています。us-east-1 を Neptune クラスターのリージョンに置き換えます。

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/dataprocessing \ -H 'Content-Type: application/json' \ -d '{ "inputDataS3Location" : "s3://(S3 bucket name)/(path to your input folder)", "id" : "(a job ID for the new job)", "processedDataS3Location" : "s3://(S3 bucket name)/(path to your output folder)" }'

インクリメンタル再処理を開始するコマンドは次のようになります。

AWS CLI
aws neptunedata start-ml-data-processing-job \ --endpoint-url https://your-neptune-endpoint:port \ --input-data-s3-location "s3://(S3 bucket name)/(path to your input folder)" \ --id "(a job ID for this job)" \ --processed-data-s3-location "s3://(S3 bucket name)/(path to your output folder)" \ --previous-data-processing-job-id "(the job ID of a previously completed job to update)"

詳細については、 AWS CLI 「 コマンドリファレンス」のstart-ml-data-processing-job」を参照してください。

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.start_ml_data_processing_job( inputDataS3Location='s3://(S3 bucket name)/(path to your input folder)', id='(a job ID for this job)', processedDataS3Location='s3://(S3 bucket name)/(path to your output folder)', previousDataProcessingJobId='(the job ID of a previously completed job to update)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/dataprocessing \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "inputDataS3Location" : "s3://(S3 bucket name)/(path to your input folder)", "id" : "(a job ID for this job)", "processedDataS3Location" : "s3://(S3 bucket name)/(path to your output folder)", "previousDataProcessingJobId" : "(the job ID of a previously completed job to update)" }'
注記

この例では、 AWS 認証情報が 環境で設定されていることを前提としています。us-east-1 を Neptune クラスターのリージョンに置き換えます。

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/dataprocessing \ -H 'Content-Type: application/json' \ -d '{ "inputDataS3Location" : "s3://(S3 bucket name)/(path to your input folder)", "id" : "(a job ID for this job)", "processedDataS3Location" : "s3://(S3 bucket name)/(path to your output folder)", "previousDataProcessingJobId" : "(the job ID of a previously completed job to update)" }'
dataprocessing ジョブ作成のパラメータ
  • id — (オプション) 新しいジョブの一意の識別子。

    タイプ: 文字列。デフォルト値: 自動生成された UUID。

  • previousDataProcessingJobId — (オプション) 以前のバージョンのデータで実行された完了したデータ処理ジョブのジョブ ID。

    タイプ: 文字列。デフォルト: なし

    注意: グラフデータが変更されたときにモデルを更新するために、増分データ処理にこれを使用します (ただし、データが削除された場合を除く)。

  • inputDataS3Location — (必須) データ処理ジョブの実行に必要なデータを SageMaker AI にダウンロードする Amazon S3 ロケーションの URI。

    タイプ: 文字列。

  • processedDataS3Location — (必須) SageMaker AI にデータ処理ジョブの結果を保存する Amazon S3 ロケーションの URI。

    タイプ: 文字列。

  • sagemakerIamRoleArn — (オプション) SageMaker AI 実行のための IAM ロールの ARN。

    タイプ: 文字列。注意: これは DB クラスターパラメータグループに一覧表示されている必要があります。そうしないと、エラーが発生します。

  • neptuneIamRoleArn — (オプション) SageMaker AI がユーザーに代わってタスクを実行するために引き受けることができる IAM ロールの Amazon リソースネーム (ARN)。

    タイプ: 文字列。注意: これは DB クラスターパラメータグループに一覧表示されている必要があります。そうしないと、エラーが発生します。

  • processingInstanceType — (オプション) データ処理中に使用される ML インスタンスのタイプ。処理されたデータセットを保持できる十分なメモリ容量が必要です。

    タイプ: 文字列。デフォルト値: ディスク上にエクスポートされたグラフデータのサイズの 10 倍のメモリを持つ最も小さい ml.r5 タイプ。

    注意: Neptune ML はインスタンスタイプを自動的に選択できます。「データ処理用のインスタンスの選択」を参照してください。

  • processingInstanceVolumeSizeInGB — (オプション) 処理インスタンスのディスクボリュームサイズ。入力データと処理されたデータの両方がディスクに保存されるため、ボリュームサイズは両方のデータセットを保持するのに十分な大きさでなければなりません。

    タイプ: 整数。デフォルト: 0

    注意: 指定しない場合、または 0 の場合、Neptune ML はデータサイズに基づいてボリュームサイズを自動的に選択します。

  • processingTimeOutInSeconds — (オプション) データ処理ジョブの秒単位で指定されたタイムアウト。

    タイプ: 整数。デフォルト: 86,400 (日単位)

  • modelType — (オプション) Neptune ML が現在サポートしている 2 つのモデルタイプ、異種グラフモデル (heterogeneous)、ナレッジグラフ (kge) のうちの 1 つ。

    タイプ: 文字列。デフォルト: なし

    注意: 指定しない場合、Neptune ML はデータに基づいてモデルタイプを自動的に選択します。

  • configFileName — (オプション) トレーニング用にエクスポートされたグラフデータをロードする方法を説明するデータ仕様ファイル。ファイルは Neptune エクスポートツールキットによって自動的に生成されます。

    タイプ: 文字列。デフォルト: training-data-configuration.json

  • subnets — (オプション) Neptune VPC 内のサブネットの ID。

    タイプ: 文字列のリスト。デフォルト: なし

  • securityGroupIds — (オプション) VPC セキュリティグループ ID。

    タイプ: 文字列のリスト。デフォルト: なし

  • volumeEncryptionKMSKey   –   (オプション) 処理ジョブを実行する ML コンピューティングインスタンスにアタッチされたストレージボリュームのデータを暗号化するために SageMaker AI が使用する AWS Key Management Service (AWS KMS) キー。

    タイプ: 文字列。デフォルト: なし

  • enableInterContainerTrafficEncryption — (オプション) トレーニングジョブまたはハイパーパラメータチューニングジョブでのコンテナ間トラフィック暗号化を有効または無効にします。

    タイプ:ブール値 デフォルト: true

    注記

    enableInterContainerTrafficEncryption パラメータは、エンジンリリース 1.2.0.2.R3 でのみ使用できます。

  • s3OutputEncryptionKMSKey   –   (オプション) SageMaker AI がトレーニングジョブの出力を暗号化するために使用する AWS Key Management Service (AWS KMS) キー。

    タイプ: 文字列。デフォルト: なし

Neptune ML dataprocessing コマンドを使用したデータ処理ジョブのステータスの取得

ジョブのステータスのサンプル Neptune ML dataprocessing コマンドは、次のようになります。

AWS CLI
aws neptunedata get-ml-data-processing-job \ --endpoint-url https://your-neptune-endpoint:port \ --id "(the job ID)"

詳細については、 AWS CLI 「 コマンドリファレンス」のget-ml-data-processing-job」を参照してください。

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.get_ml_data_processing_job( id='(the job ID)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/dataprocessing/(the job ID) \ --region us-east-1 \ --service neptune-db \ -X GET
注記

この例では、 AWS 認証情報が 環境で設定されていることを前提としています。us-east-1 を Neptune クラスターのリージョンに置き換えます。

curl
curl -s \ "https://your-neptune-endpoint:port/ml/dataprocessing/(the job ID)" \ | python -m json.tool
dataprocessing ジョブステータスのパラメータ
  • id — (必須) データ処理ジョブの一意の識別子。

    タイプ: 文字列。

  • neptuneIamRoleArn — (オプション) SageMaker AI および Amazon S3 リソースへの Neptune アクセスを提供する IAM ロールの ARN。

    タイプ: 文字列。注意: これは DB クラスターパラメータグループに一覧表示されている必要があります。そうしないと、エラーが発生します。

Neptune ML dataprocessing コマンドを使用したデータ処理ジョブの停止

ジョブのを停止するサンプル Neptune ML dataprocessing コマンドは、次のようになります。

AWS CLI
aws neptunedata cancel-ml-data-processing-job \ --endpoint-url https://your-neptune-endpoint:port \ --id "(the job ID)"

Amazon S3 アーティファクトもクリーンアップするには:

aws neptunedata cancel-ml-data-processing-job \ --endpoint-url https://your-neptune-endpoint:port \ --id "(the job ID)" \ --clean

詳細については、 AWS CLI 「 コマンドリファレンス」のcancel-ml-data-processing-job」を参照してください。

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.cancel_ml_data_processing_job( id='(the job ID)', clean=True ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/dataprocessing/(the job ID) \ --region us-east-1 \ --service neptune-db \ -X DELETE

Amazon S3 アーティファクトもクリーンアップするには:

awscurl "https://your-neptune-endpoint:port/ml/dataprocessing/(the job ID)?clean=true" \ --region us-east-1 \ --service neptune-db \ -X DELETE
注記

この例では、 AWS 認証情報が 環境で設定されていることを前提としています。us-east-1 を Neptune クラスターのリージョンに置き換えます。

curl
curl -s \ -X DELETE "https://your-neptune-endpoint:port/ml/dataprocessing/(the job ID)"

または、このようになります。

curl -s \ -X DELETE "https://your-neptune-endpoint:port/ml/dataprocessing/(the job ID)?clean=true"
dataprocessing 停止ジョブのパラメータ
  • id — (必須) データ処理ジョブの一意の識別子。

    タイプ: 文字列。

  • neptuneIamRoleArn — (オプション) SageMaker AI および Amazon S3 リソースへの Neptune アクセスを提供する IAM ロールの ARN。

    タイプ: 文字列。注意: これは DB クラスターパラメータグループに一覧表示されている必要があります。そうしないと、エラーが発生します。

  • clean — (オプション) このフラグは、ジョブが停止したときにすべての Amazon S3 アーティファクトを削除する必要があることを指定します。

    タイプ: ブール値。デフォルト: FALSE

Neptune ML dataprocessing コマンドを使用したアクティブなデータ処理ジョブの一覧表示

アクティブジョブの一覧表示のサンプル Neptune ML dataprocessing コマンドは、次のようになります。

AWS CLI
aws neptunedata list-ml-data-processing-jobs \ --endpoint-url https://your-neptune-endpoint:port

結果の数を制限するには:

aws neptunedata list-ml-data-processing-jobs \ --endpoint-url https://your-neptune-endpoint:port \ --max-items 3

詳細については、 AWS CLI 「 コマンドリファレンス」のlist-ml-data-processing-jobs」を参照してください。

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.list_ml_data_processing_jobs( maxItems=3 ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/dataprocessing \ --region us-east-1 \ --service neptune-db \ -X GET

結果の数を制限するには:

awscurl "https://your-neptune-endpoint:port/ml/dataprocessing?maxItems=3" \ --region us-east-1 \ --service neptune-db \ -X GET
注記

この例では、 AWS 認証情報が 環境で設定されていることを前提としています。us-east-1 を Neptune クラスターのリージョンに置き換えます。

curl
curl -s "https://your-neptune-endpoint:port/ml/dataprocessing"

または、このようになります。

curl -s "https://your-neptune-endpoint:port/ml/dataprocessing?maxItems=3"
dataprocessing ジョブの一覧表示のパラメータ
  • maxItems — (オプション) 返される項目の最大数。

    タイプ: 整数。デフォルト: 10最大許容値: 1024

  • neptuneIamRoleArn — (オプション) SageMaker AI および Amazon S3 リソースへの Neptune アクセスを提供する IAM ロールの ARN。

    タイプ: 文字列。注意: これは DB クラスターパラメータグループに一覧表示されている必要があります。そうしないと、エラーが発生します。