

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# `dataprocessing` 명령을 사용한 데이터 처리
<a name="machine-learning-api-dataprocessing"></a>

Neptune ML `dataprocessing` 명령을 사용하여 데이터 처리 작업을 만들거나, 작업 상태를 확인하거나, 중지하거나, 모든 활성 데이터 처리 작업을 나열할 수 있습니다.

## Neptune ML `dataprocessing` 명령을 사용하여 데이터 처리 작업 생성
<a name="machine-learning-api-dataprocessing-create-job"></a>

새 작업을 생성하기 위한 일반적인 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](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/start-ml-data-processing-job.html)을 참조하세요.

------
#### [ 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](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/start-ml-data-processing-job.html)을 참조하세요.

------
#### [ 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은 인스턴스 유형을 자동으로 선택할 수 있습니다. [데이터 처리를 위한 인스턴스 선택](machine-learning-on-graphs-instance-selection.md#machine-learning-on-graphs-processing-instance-size)을(를) 참조하세요.
+ **`processingInstanceVolumeSizeInGB`**   –   (*선택 사항*) 처리 인스턴스의 디스크 볼륨 크기입니다. 입력 데이터와 처리된 데이터 모두 디스크에 저장되므로, 볼륨 크기는 두 데이터 세트를 모두 담을 수 있을 만큼 커야 합니다.

  *유형*: 정수. *기본값*: `0`.

  *참고*: 지정하지 않거나 0으로 지정하면 Neptune ML은 데이터 크기를 기준으로 볼륨 크기를 자동으로 선택합니다.
+ **`processingTimeOutInSeconds`**   –   (*선택 사항*) 데이터 처리 작업의 제한 시간(초)입니다.

  *유형*: 정수. *기본값*: `86,400`(1일).
+ **`modelType`**   –   (*선택 사항*) Neptune ML이 현재 지원하는 두 모델 유형인 이기종 그래프 모델(`heterogeneous`)과 지식 그래프(`kge`) 중 하나입니다.

  *유형*: 문자열. *기본값*: *없음*.

  *참고*: 지정하지 않으면 Neptune ML은 데이터를 기반으로 모델 유형을 자동으로 선택합니다.
+ **`configFileName`**   –   (*선택 사항*) 훈련용으로 내보낸 그래프 데이터를 로드하는 방법을 설명하는 데이터 사양 파일입니다. 파일은 Neptune 내보내기 도구 키트에 의해 자동으로 생성됩니다.

  *유형*: 문자열. *기본값*: `training-data-configuration.json`.
+ **`subnets`**   –   (*선택 사항*) Neptune VPC의 서브넷 ID입니다.

  *유형*: 문자열 목록. *기본값*: *없음*.
+ **`securityGroupIds`**   –   (*선택 사항*) VPC 보안 그룹 ID입니다.

  *유형*: 문자열 목록. *기본값*: *없음*.
+ **`volumeEncryptionKMSKey`**   –   (*선택 사항*) SageMaker AI가 처리 작업을 실행하는 ML 컴퓨팅 인스턴스에 연결된 스토리지 볼륨의 데이터를 암호화하는 데 사용하는 AWS Key Management Service (AWS KMS) 키입니다.

  *유형*: 문자열. *기본값*: *없음*.
+ **`enableInterContainerTrafficEncryption`**   –   (*선택 사항*) 훈련 또는 하이퍼 파라미터 조정 작업에서 컨테이너 간 트래픽 암호화를 활성화하거나 비활성화합니다.

  *유형*: 부울. *기본값*: *True*.
**참고**  
이 `enableInterContainerTrafficEncryption` 파라미터는 [엔진 릴리스 1.2.0.2.R3](engine-releases-1.2.0.2.R3.md)에서만 사용할 수 있습니다.
+ **`s3OutputEncryptionKMSKey`**   –   (*선택 사항*) SageMaker AI가 훈련 작업의 출력을 암호화하는 데 사용하는 AWS Key Management Service (AWS KMS) 키입니다.

  *유형*: 문자열. *기본값*: *없음*.

## Neptune ML `dataprocessing` 명령을 사용하여 데이터 처리 작업의 상태 가져오기
<a name="machine-learning-api-dataprocessing-get-job-status"></a>

작업 상태를 나타내는 샘플 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](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/get-ml-data-processing-job.html)을 참조하세요.

------
#### [ 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` 명령을 사용하여 데이터 처리 작업 중지
<a name="machine-learning-api-dataprocessing-stop-job"></a>

작업 중지를 위한 샘플 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](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/cancel-ml-data-processing-job.html)을 참조하세요.

------
#### [ 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` 명령을 사용하여 활성 데이터 처리 작업 나열
<a name="machine-learning-api-dataprocessing-list-jobs"></a>

활성 작업을 나열하기 위한 샘플 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](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/list-ml-data-processing-jobs.html)를 참조하세요.

------
#### [ 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 클러스터 파라미터 그룹에 나열되어 있어야 합니다. 그렇지 않으면 오류가 발생합니다.