AWS neptune documentation change
Summary
Expanded documentation for starting Neptune ML model training jobs with detailed examples for AWS CLI, SDK, awscurl, and curl methods, including scenarios for using previous job IDs and custom models.
Security assessment
This change is purely a documentation enhancement that adds multiple code examples for different API invocation methods. There is no mention of security vulnerabilities, patches, or security incidents. The changes focus on improving developer experience by providing clearer examples, but do not address any security weaknesses or introduce security features.
Diff
diff --git a/neptune/latest/userguide/machine-learning-on-graphs-model-training.md b/neptune/latest/userguide/machine-learning-on-graphs-model-training.md index 008591bd6..f5939e10e 100644 --- a//neptune/latest/userguide/machine-learning-on-graphs-model-training.md +++ b//neptune/latest/userguide/machine-learning-on-graphs-model-training.md @@ -7 +7,56 @@ -After you have processed the data that you exported from Neptune for model training, you can start a model-training job using a `curl` (or `awscurl`) command like the following: +After you have processed the data that you exported from Neptune for model training, you can start a model-training job using a command like the following: + +AWS CLI + + + + aws neptunedata start-ml-model-training-job \ + --endpoint-url https://your-neptune-endpoint:port \ + --id "(a unique model-training job ID)" \ + --data-processing-job-id "(the data-processing job-id of a completed job)" \ + --train-model-s3-location "s3://(your S3 bucket)/neptune-model-graph-autotrainer" + +For more information, see [start-ml-model-training-job](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/start-ml-model-training-job.html) in the AWS CLI Command Reference. + +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_model_training_job( + id='(a unique model-training job ID)', + dataProcessingJobId='(the data-processing job-id of a completed job)', + trainModelS3Location='s3://(your S3 bucket)/neptune-model-graph-autotrainer' + ) + + print(response) + +awscurl + + + + awscurl https://your-neptune-endpoint:port/ml/modeltraining \ + --region us-east-1 \ + --service neptune-db \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{ + "id" : "(a unique model-training job ID)", + "dataProcessingJobId" : "(the data-processing job-id of a completed job)", + "trainModelS3Location" : "s3://(your S3 bucket)/neptune-model-graph-autotrainer" + }' + +###### Note + +This example assumes that your AWS credentials are configured in your environment. Replace `us-east-1` with the Region of your Neptune cluster. + +curl + @@ -11 +66 @@ After you have processed the data that you exported from Neptune for model train - -X POST https://(your Neptune endpoint)/ml/modeltraining + -X POST https://your-neptune-endpoint:port/ml/modeltraining \ @@ -16 +71 @@ After you have processed the data that you exported from Neptune for model train - "trainModelS3Location" : "s3://(your Amazon S3 bucket)/neptune-model-graph-autotrainer" + "trainModelS3Location" : "s3://(your S3 bucket)/neptune-model-graph-autotrainer" @@ -22,0 +78,58 @@ You can also supply a `previousModelTrainingJobId` to use information from a com +AWS CLI + + + + aws neptunedata start-ml-model-training-job \ + --endpoint-url https://your-neptune-endpoint:port \ + --id "(a unique model-training job ID)" \ + --data-processing-job-id "(the data-processing job-id of a completed job)" \ + --train-model-s3-location "s3://(your S3 bucket)/neptune-model-graph-autotrainer" \ + --previous-model-training-job-id "(the model-training job-id of a completed job)" + +For more information, see [start-ml-model-training-job](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/start-ml-model-training-job.html) in the AWS CLI Command Reference. + +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_model_training_job( + id='(a unique model-training job ID)', + dataProcessingJobId='(the data-processing job-id of a completed job)', + trainModelS3Location='s3://(your S3 bucket)/neptune-model-graph-autotrainer', + previousModelTrainingJobId='(the model-training job-id of a completed job)' + ) + + print(response) + +awscurl + + + + awscurl https://your-neptune-endpoint:port/ml/modeltraining \ + --region us-east-1 \ + --service neptune-db \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{ + "id" : "(a unique model-training job ID)", + "dataProcessingJobId" : "(the data-processing job-id of a completed job)", + "trainModelS3Location" : "s3://(your S3 bucket)/neptune-model-graph-autotrainer", + "previousModelTrainingJobId" : "(the model-training job-id of a completed job)" + }' + +###### Note + +This example assumes that your AWS credentials are configured in your environment. Replace `us-east-1` with the Region of your Neptune cluster. + +curl + + @@ -25 +138 @@ You can also supply a `previousModelTrainingJobId` to use information from a com - -X POST https://(your Neptune endpoint)/ml/modeltraining + -X POST https://your-neptune-endpoint:port/ml/modeltraining \ @@ -30 +143 @@ You can also supply a `previousModelTrainingJobId` to use information from a com - "trainModelS3Location" : "s3://(your Amazon S3 bucket)/neptune-model-graph-autotrainer" + "trainModelS3Location" : "s3://(your S3 bucket)/neptune-model-graph-autotrainer", @@ -35,0 +149,73 @@ You can train your own model implementation on the Neptune ML training infrastru +AWS CLI + + + + aws neptunedata start-ml-model-training-job \ + --endpoint-url https://your-neptune-endpoint:port \ + --id "(a unique model-training job ID)" \ + --data-processing-job-id "(the data-processing job-id of a completed job)" \ + --train-model-s3-location "s3://(your Amazon S3 bucket)/neptune-model-graph-autotrainer" \ + --model-name "custom" \ + --custom-model-training-parameters '{ + "sourceS3DirectoryPath": "s3://(your Amazon S3 bucket)/(path to your Python module)", + "trainingEntryPointScript": "(your training script entry-point name in the Python module)", + "transformEntryPointScript": "(your transform script entry-point name in the Python module)" + }' + +For more information, see [start-ml-model-training-job](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/start-ml-model-training-job.html) in the AWS CLI Command Reference. + +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_model_training_job( + id='(a unique model-training job ID)', + dataProcessingJobId='(the data-processing job-id of a completed job)', + trainModelS3Location='s3://(your Amazon S3 bucket)/neptune-model-graph-autotrainer', + modelName='custom', + customModelTrainingParameters={ + 'sourceS3DirectoryPath': 's3://(your Amazon S3 bucket)/(path to your Python module)', + 'trainingEntryPointScript': '(your training script entry-point name in the Python module)', + 'transformEntryPointScript': '(your transform script entry-point name in the Python module)' + } + ) + + print(response) + +awscurl + + + + awscurl https://your-neptune-endpoint:port/ml/modeltraining \ + --region us-east-1 \ + --service neptune-db \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{ + "id" : "(a unique model-training job ID)", + "dataProcessingJobId" : "(the data-processing job-id of a completed job)", + "trainModelS3Location" : "s3://(your Amazon S3 bucket)/neptune-model-graph-autotrainer", + "modelName": "custom", + "customModelTrainingParameters" : { + "sourceS3DirectoryPath": "s3://(your Amazon S3 bucket)/(path to your Python module)", + "trainingEntryPointScript": "(your training script entry-point name in the Python module)", + "transformEntryPointScript": "(your transform script entry-point name in the Python module)" + } + }' +