

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 创建要查询的推理端点
<a name="machine-learning-on-graphs-inference-endpoint"></a>

推理端点允许您查询模型训练过程构造的一个特定模型。端点附加到训练过程能够生成的给定类型中性能最佳的模型。然后，端点能够接受来自 Neptune 的 Gremlin 查询，并返回该模型对查询中输入的预测。创建推理端点后，它会一直处于活动状态，直到您将其删除。

## 管理 Neptune ML 的推理端点
<a name="machine-learning-on-graphs-endpoint-managing"></a>

对从 Neptune 导出的数据完成模型训练后，可以使用 `curl`（或 `awscurl`）命令创建推理端点，如下所示：

```
curl \
  -X POST https://(your Neptune endpoint)/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)"
      }'
```

您也可以通过已完成的模型转换任务创建的模型创建推理端点，方法大致相同：

```
curl \
  -X POST https://(your Neptune endpoint)/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)"
      }'
```

[endpoints 命令](machine-learning-api-endpoints.md)中解释了如何使用这些命令的详细信息，以及有关如何获取端点状态、如何删除端点以及如何列出所有推理端点的信息。