SPARQL 对象回归示例 - Amazon Neptune
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

SPARQL 对象回归示例

对象回归与对象分类类似,不同之处在于从回归模型中推理的每个节点的数值谓词值。除了 the Neptune#ml.limitNeptune#ml.threshold 谓词不适用之外,您可以对于对象回归和对象分类使用相同的 SPARQL 查询。

下面的查询试图预测类型为 foaf:Person 的所有输入的 <http://www.example.org/accountbalance> 谓词值:

SELECT * WHERE { ?input a foaf:Person . SERVICE neptune-ml:inference { neptune-ml:config neptune-ml:modelType 'OBJECT_REGRESSION' ; neptune-ml:input ?input ; neptune-ml:predicate <http://www.example.org/accountbalance> ; neptune-ml:output ?output . } }

可以按如下方式自定义此查询:

SELECT * WHERE { ?input a foaf:Person . SERVICE neptune-ml:inference { neptune-ml:config neptune-ml:endpoint 'node-prediction-account-balance-endpoint' ; neptune-ml:iamRoleArn 'arn:aws:iam::0123456789:role/sagemaker-role' ; neptune-ml:batchSize "40"^^xsd:integer ; neptune-ml:timeout "1000"^^xsd:integer ; neptune-ml:modelType 'OBJECT_REGRESSION' ; neptune-ml:input ?input ; neptune-ml:predicate <http://www.example.org/accountbalance> ; neptune-ml:output ?output . } }