엔진 엔드포인트
엔진은 기계 학습의 기초입니다 데이터 과학 작업 영역 모델. 여기에는 특정 문제를 해결하는 기계 학습 알고리즘, 기능 엔지니어링을 수행하는 기능 파이프라인 또는 둘 다가 포함됩니다.
Docker 레지스트리 Look up
Docker 호스트 URL, 사용자 이름 및 암호를 포함하여 패키지된 레서피 파일을 업로드하려면 Docker 레지스트리 자격 증명이 필요합니다. 다음 GET 요청을 수행하여 이 정보를 조회할 수 있습니다.
API 형식
GET /engines/dockerRegistry
요청
curl -X GET https://platform.adobe.io/data/sensei/engines/dockerRegistry \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
응답
성공적인 응답은 Docker URL(host), 사용자 이름(username) 및 암호(password)를 포함하여 Docker 레지스트리의 세부 정보가 포함된 페이로드를 반환합니다.
{ACCESS_TOKEN}이(가) 업데이트될 때마다 도커 암호가 변경됩니다.{
"host": "docker_host.azurecr.io",
"username": "00000000-0000-0000-0000-000000000000",
"password": "password"
}
도커 URL을 사용하여 엔진 만들기 docker-image
여러 부분 양식의 도커 이미지를 참조하는 도커 URL과 메타데이터를 제공하는 동안 POST 요청을 수행하여 엔진을 만들 수 있습니다.
API 형식
POST /engines
Python/R 요청
curl -X POST \
https://platform.adobe.io/data/sensei/engines \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'content-type: multipart/form-data' \
-F 'engine={
"name": "A name for this Engine",
"description": "A description for this Engine",
"type": "Python",
"algorithm": "Classification",
"artifacts": {
"default": {
"image": {
"location": "v1rsvj32smc4wbs.azurecr.io/ml-featurepipeline-pyspark:1.0",
"name": "An additional name for the Docker image",
"executionType": "Python"
}
}
}
}'
namedescriptiontypealgorithmartifacts.default.image.locationartifacts.default.image.executionTypePySpark/Scala 요청
PySpark 레시피를 요청 할 때 and type 는 executionType "PySpark"입니다. Scala 레시피를 요청 할 때 and type 는 executionType "Spark"입니다. 다음 Scala 레서피 예제에서는 Spark를 사용합니다.
curl -X POST \
https://platform.adobe.io/data/sensei/engines \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'content-type: multipart/form-data' \
-F 'engine={
"name": "Spark retail sales recipe",
"description": "A description for this Engine",
"type": "Spark",
"mlLibrary":"databricks-spark",
"artifacts": {
"default": {
"image": {
"name": "modelspark",
"executionType": "Spark",
"packagingType": "docker",
"location": "v1d2cs4mimnlttw.azurecr.io/sarunbatchtest:0.0.1"
}
}
}
}'
namedescriptiontypemlLibrarydatabricks-spark합니다.artifacts.default.image.locationartifacts.default.image.executionType응답
성공적인 응답은 고유 식별자(id)를 포함하여 새로 만든 엔진의 세부 정보가 포함된 페이로드를 반환합니다. 다음 예제 응답은 Python 엔진에 대한 것입니다. 모든 엔진 응답은 다음 포맷 형식을 팔로우 합니다.
{
"id": "22f4166f-85ba-4130-a995-a2b8e1edde32",
"name": "A name for this Engine",
"description": "A description for this Engine",
"type": "Python",
"algorithm": "Classification",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-01T00:00:00.000Z",
"artifacts": {
"default": {
"image": {
"location": "v1rsvj32smc4wbs.azurecr.io/ml-featurepipeline-pyspark:1.0",
"name": "An additional name for the Docker image",
"executionType": "Python",
"packagingType": "docker"
}
}
}
}
Docker URL을 사용하여 기능 파이프라인 엔진 만들기 feature-pipeline-docker
Docker 이미지를 참조하는 메타데이터 및 Docker URL 제공하는 동안 POST 요청 수행하여 기능 파이프라인 엔진을 만들 수 있습니다.
API 포맷
POST /engines
요청
curl -X POST \
https://platform.adobe.io/data/sensei/engines \
-H 'Authorization: Bearer ' \
-H 'x-gw-ims-org-id: 20655D0F5B9875B20A495E23@AdobeOrg' \
-H 'Content-Type: application/vnd.adobe.platform.sensei+json;profile=engine.v1.json' \
-H 'x-api-key: acp_foundation_machineLearning' \
-H 'Content-Type: text/plain' \
-F '{
"type": "PySpark",
"algorithm":"fp",
"name": "Feature_Pipeline_Engine",
"description": "Feature_Pipeline_Engine",
"mlLibrary": "databricks-spark",
"artifacts": {
"default": {
"image": {
"location": "v7d1cs2mimnlttw.azurecr.io/ml-featurepipeline-pyspark:0.2.1",
"name": "datatransformation",
"executionType": "PySpark",
"packagingType": "docker"
},
"defaultMLInstanceConfigs": [ ...
]
}
}
}'
typealgorithmfp 설정합니다.namedescriptionmlLibrarydatabricks-spark(으)로 설정해야 합니다.artifacts.default.image.locationartifacts.default.image.executionTypeartifacts.default.image.packagingTypedocker합니다.artifacts.default.defaultMLInstanceConfigspipeline.json 구성 파일 매개 변수입니다.응답
성공적인 응답은 고유 식별자(id)를 포함하여 새로 만든 기능 파이프라인 엔진의 세부 정보가 포함된 페이로드를 반환합니다. 다음 예제 응답은 PySpark 기능 파이프라인 엔진에 대한 것입니다.
{
"id": "88236891-4309-4fd9-acd0-3de7827cecd1",
"name": "Feature_Pipeline_Engine",
"description": "Feature_Pipeline_Engine",
"type": "PySpark",
"algorithm": "fp",
"mlLibrary": "databricks-spark",
"created": "2020-04-24T20:46:58.382Z",
"updated": "2020-04-24T20:46:58.382Z",
"deprecated": false,
"artifacts": {
"default": {
"image": {
"location": "v7d1cs3mimnlttw.azurecr.io/ml-featurepipeline-pyspark:0.2.1",
"name": "datatransformation",
"executionType": "PySpark",
"packagingType": "docker"
},
"defaultMLInstanceConfigs": [ ... ]
}
}
}
엔진 목록 검색
단일 GET 요청 수행으로 엔진 목록을 검색할 수 있습니다. 결과를 필터링하는 데 도움이 되도록 요청 경로에서 쿼리 매개 변수를 지정할 수 있습니다. 사용 가능한 쿼리 목록은 자산 검색을 위한 쿼리 매개 변수의 부록 섹션을 참조하십시오.
API 형식
GET /engines
GET /engines?parameter_1=value_1
GET /engines?parameter_1=value_1¶meter_2=value_2
요청
curl -X GET \
https://platform.adobe.io/data/sensei/engines \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
응답
응답이 성공하면 엔진 목록과 세부 정보가 반환됩니다.
{
"children": [
{
"id": "22f4166f-85ba-4130-a995-a2b8e1edde31",
"name": "A name for this Engine",
"description": "A description for this Engine",
"type": "PySpark",
"algorithm": "Classification",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-01T00:00:00.000Z"
},
{
"id": "22f4166f-85ba-4130-a995-a2b8e1edde32",
"name": "A name for this Engine",
"description": "A description for this Engine",
"type": "Python",
"algorithm": "Classification",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-01T00:00:00.000Z"
},
{
"id": "22f4166f-85ba-4130-a995-a2b8e1edde33",
"name": "Feature Pipeline Engine",
"description": "A feature pipeline Engine",
"type": "PySpark",
"algorithm":"fp",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-01T00:00:00.000Z"
}
],
"_page": {
"property": "deleted==false",
"totalCount": 100,
"count": 3
}
}
특정 엔진 검색 retrieve-specific
요청 경로에 원하는 엔진의 ID를 포함하는 GET 요청을 수행하여 특정 엔진의 세부 정보를 검색할 수 있습니다.
API 형식
GET /engines/{ENGINE_ID}
{ENGINE_ID}요청
curl -X GET \
https://platform.adobe.io/data/sensei/engines/22f4166f-85ba-4130-a995-a2b8e1edde32 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
응답
성공적인 응답은 원하는 엔진의 세부 정보가 포함된 페이로드를 반환합니다.
{
"id": "22f4166f-85ba-4130-a995-a2b8e1edde32",
"name": "A name for this Engine",
"description": "A description for this Engine",
"type": "PySpark",
"algorithm": "Classification",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-01T00:00:00.000Z",
"artifacts": {
"default": {
"image": {
"location": "v7d1cs2mimnlttw.azurecr.io/ml-featurepipeline-pyspark:0.2.1",
"name": "file.egg",
"executionType": "PySpark",
"packagingType": "docker"
}
}
}
}
엔진 업데이트
요청 경로에 대상 엔진의 ID를 포함하는 PUT 요청을 통해 속성을 덮어쓰고 업데이트된 속성이 포함된 JSON 페이로드를 제공하여 기존 엔진을 수정하고 업데이트할 수 있습니다.
다음 샘플 API 호출은 엔진의 이름과 설명을 업데이트하지만 처음에는 이러한 속성을 가지고 있습니다.
{
"name": "A name for this Engine",
"description": "A description for this Engine",
"type": "Python",
"algorithm": "Classification",
"artifacts": {
"default": {
"image": {
"executionType": "Python",
"packagingType": "docker"
}
}
}
}
API 형식
PUT /engines/{ENGINE_ID}
{ENGINE_ID}요청
curl -X PUT \
https://platform.adobe.io/data/sensei/engines/22f4166f-85ba-4130-a995-a2b8e1edde32 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'content-type: application/vnd.adobe.platform.sensei+json;profile=engine.v1.json' \
-d '{
"name": "An updated name for this Engine",
"description": "An updated description",
"type": "Python",
"algorithm": "Classification",
"artifacts": {
"default": {
"image": {
"executionType": "Python",
"packagingType": "docker"
}
}
}
}'
응답
성공한 응답은 엔진의 업데이트된 세부 사항이 포함된 페이로드를 반환합니다.
{
"id": "22f4166f-85ba-4130-a995-a2b8e1edde32",
"name": "An updated name for this Engine",
"description": "An updated description",
"type": "Python",
"algorithm": "Classification",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"displayName": "Jane Doe",
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-02T00:00:00.000Z",
"artifacts": {
"default": {
"image": {
"executionType": "Python",
"packagingType": "docker"
}
}
}
}
엔진 삭제
요청 경로에서 대상 엔진의 ID를 지정하는 동안 DELETE 요청을 수행하여 엔진을 삭제할 수 있습니다. 엔진을 삭제하면 해당 MLInstance에 속하는 모든 실험 및 실험 실행을 포함하여 해당 엔진을 참조하는 모든 MLInstance가 계단식으로 삭제됩니다.
API 형식
DELETE /engines/{ENGINE_ID}
{ENGINE_ID}요청
curl -X DELETE \
https://platform.adobe.io/data/sensei/engines/22f4166f-85ba-4130-a995-a2b8e1edde32 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
응답
{
"title": "Success",
"status": 200,
"detail": "Engine deletion was successful"
}