机器学习

节点分类

节点分类的原始 alpha 版本已被完全移除,并合并到节点分类管道中。在训练节点分类模型之前,必须创建和配置训练管道。

训练

现在在训练管道的特定配置过程中配置了训练的某些部分。为了有效,这些必须在调用 `train` 过程之前进行。其余部分已移至管道训练过程。请参见下表。

表 1. 训练配置中的更改
1.x 2.x

modelName

此参数现在仅在 `gds.beta.pipeline.nodeClassification.train` 中配置。

featuresProperties

此参数由 `gds.beta.pipeline.nodeClassification.selectFeatures` 替换。现在还有一个过程 `gds.beta.pipeline.nodeClassification.addNodeProperty` 用于计算训练管道和生成的分类模型中输入图的节点属性。

targetProperty

此参数现在仅在 `gds.beta.pipeline.nodeClassification.train` 中配置。

holdoutFraction

此参数现在命名为 `testFraction` 并在 `gds.beta.pipeline.nodeClassification.configureSplit` 中配置。

validationFolds

此参数现在仅在 `gds.beta.pipeline.nodeClassification.configureSplit` 中配置。

metrics

此参数现在仅在 `gds.beta.pipeline.nodeClassification.train` 中配置。

params

此参数由 `gds.beta.pipeline.nodeClassification.addLogisticRegression` 替换,允许配置单个模型候选。可以多次调用此过程以添加多个模型候选。还有一个使用随机森林作为模型候选的新选项,使用 `gds.beta.pipeline.nodeClassification.addRandomForest`。

randomSeed

此参数现在仅在 `gds.beta.pipeline.nodeClassification.train` 中配置。

表 2. 管道配置中的更改
1.x 2.x

gds.beta.pipeline.nodeClassification.configureParams

此过程不再存在,它添加了逻辑回归模型候选。添加逻辑回归候选可以通过多次调用 `gds.beta.pipeline.nodeClassification.addLogisticRegression` 来完成。

预测

除了下面列出的参数外,节点分类预测的 API 与之前相同,但使用了不同的过程。这些过程是 `gds.beta.pipeline.nodeClassification.predict.[mutate,stream,write]`。

表 3. 预测配置中的更改
1.x 2.x

batchSize

批大小在内部优化,不再由用户配置。

表 4. 预测过程替换
1.x 2.x

gds.alpha.ml.nodeClassification.predict.stream

gds.beta.pipeline.nodeClassification.predict.stream

gds.alpha.ml.nodeClassification.predict.mutate

gds.beta.pipeline.nodeClassification.predict.mutate

gds.alpha.ml.nodeClassification.predict.write

gds.beta.pipeline.nodeClassification.predict.write

链接预测的原始 alpha 版本已被完全移除,并合并到链接预测管道中。在训练链接预测模型之前,必须创建和配置训练管道。

训练

现在在训练管道的特定配置过程中配置了训练的某些部分。为了有效,这些必须在调用 `train` 过程之前进行。其余部分已移至管道训练过程。请参见下表。

表 5. 训练配置中的更改
1.x 2.x

modelName

此参数现在仅在 `gds.beta.pipeline.linkPrediction.train` 中配置。

featuresProperties

由 `gds.beta.pipeline.linkPrediction.addFeature` 中的 `nodeProperties` 替换。现在还有一个过程 `gds.beta.pipeline.linkPrediction.addNodeProperty` 用于计算训练管道和生成的分类模型中输入图的节点属性。

linkFeatureCombiner

由传递给gds.beta.pipeline.linkPrediction.addFeature的第二个位置参数(称为featureType)替换。

trainRelationshipTypetestRelationshipType

这些参数已移除。使用gds.beta.pipeline.linkPrediction.configureSplit来设置数据集分割。

validationFolds

此参数现在仅在gds.beta.pipeline.linkPrediction.configureSplit中配置。

negativeClassWeight

此参数现在仅在 `gds.beta.pipeline.linkPrediction.train` 中配置。

params

此参数由gds.beta.pipeline.linkPrediction.addLogisticRegression替换,允许为单个模型候选配置。此过程可以调用多次以添加多个模型候选。还有一个使用随机森林作为模型候选的新选项,使用gds.beta.pipeline.linkPrediction.addRandomForest

randomSeed

此参数现在仅在 `gds.beta.pipeline.linkPrediction.train` 中配置。

表 6. 管道配置更改
1.x 2.x

gds.beta.pipeline.linkPrediction.configureParams

此过程不再存在,它添加了逻辑回归模型候选。添加逻辑回归候选可以通过调用gds.beta.pipeline.linkPrediction.addLogisticRegression一次或多次来完成。

预测

链接预测分类的 API 与之前相同,但使用了不同的过程。这些过程是gds.beta.pipeline.linkPrediction.predict.[mutate,stream]。但是,链接预测分类不再有write模式,但仍然可以使用mutate模式,然后使用gds.graph.relationship.write来模拟此行为。

表 7. 预测过程替换
1.x 2.x

gds.alpha.ml.linkPrediction.predict.stream

gds.beta.pipeline.linkPrediction.predict.stream

gds.alpha.ml.linkPrediction.predict.mutate

gds.beta.pipeline.linkPrediction.predict.mutate

gds.alpha.ml.linkPrediction.predict.write

-