View a markdown version of this page

照会のための推論エンドポイントの作成 - Amazon Neptune

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

照会のための推論エンドポイントの作成

推論エンドポイントを使用すると、モデルトレーニングプロセスによって構築された 1 つの特定のモデルを照会できます。エンドポイントは、トレーニングプロセスで生成できた特定のタイプの最もパフォーマンスの高いモデルにアタッチします。エンドポイントは Neptune からの Gremlin クエリを受け入れ、クエリ内の入力に対するモデルの予測を返すことができます。推論エンドポイントを作成した後も、削除するまでアクティブなままになります。

Neptune ML の推論エンドポイントの管理

Neptune からエクスポートしたデータのモデルトレーニングが完了したら、次のようなコマンドを使用して推論エンドポイントを作成できます。

AWS CLI
aws neptunedata create-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(a unique ID for the new endpoint)" \ --ml-model-training-job-id "(the model-training job-id of a completed job)"

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

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.create_ml_endpoint( id='(a unique ID for the new endpoint)', mlModelTrainingJobId='(the model-training job-id of a completed job)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'
注記

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

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/endpoints \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'

また、ほぼ同じ方法で、完成したモデル変換ジョブによって作成されたモデルから推論エンドポイントを作成することもできます。

AWS CLI
aws neptunedata create-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(a unique ID for the new endpoint)" \ --ml-model-transform-job-id "(the model-transform job-id of a completed job)"

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

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.create_ml_endpoint( id='(a unique ID for the new endpoint)', mlModelTransformJobId='(the model-transform job-id of a completed job)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTransformJobId": "(the model-transform job-id of a completed job)" }'
注記

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

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/endpoints \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTransformJobId": "(the model-transform job-id of a completed job)" }'

これらのコマンドの使用方法の詳細については、エンドポイントコマンド を参照してください。また、エンドポイントのステータスの取得方法、エンドポイントの削除方法、およびすべての推論エンドポイントの一覧表示方法に関する情報も記載されています。