17.2.10 Supervised GraphWiseモデルの頂点ラベルの推測
次のコードに示すように、任意のグラフ(トレーニング中に表示されなかった頂点またはグラフを含む)の頂点のラベルを推測できます。
opg4j> var labels = model.inferLabels(fullGraph, testVertices)
opg4j> labels.head().print()PgxFrame labels = model.inferLabels(fullGraph,testVertices);
labels.head().print();labels = model.infer_labels(full_graph, test_vertices)
labels.print()出力は、次の出力例のようになります。
                  
                  
+----------------------------------+
| vertexId | label                 |
+----------------------------------+
| 2        | Neural Networks       |
| 6        | Theory                |
| 7        | Case Based            |
| 22       | Rule Learning         |
| 30       | Theory                |
| 34       | Neural Networks       |
| 47       | Case Based            |
| 48       | Probabalistic Methods |
| 50       | Theory                |
| 52       | Theory                |
+----------------------------------+同様に、次のコードに示すように、予測ロジットを推測することで、各クラスのモデルの信頼度を取得することもできます。
opg4j> var logits = model.inferLogits(fullGraph, testVertices)
opg4j> labels.head().print()PgxFrame logits = model.inferLogits(fullGraph,testVertices);
logits.head().print();logits = model.infer_logits(full_graph, test_vertices)
logits.print()