17.5.6 Setting the Edge Combination Production Method
By default, the edge embedding is computed by combining the source vertex
embedding, the destination vertex embedding and the edge features. You can manually set
these by setting the
EdgeCombinationMethod
with booleans
parameters:
opg4j> import oracle.pgx.config.mllib.edgecombination.EdgeCombinationMethods
opg4j> var method = EdgeCombinationMethods.concatEdgeCombinationMethod(useSourceVertex, useDestinationVertex, useEdge)
opg4j> var model = analyst.unsupervisedEdgeWiseModelBuilder().
setVertexInputPropertyNames("vertex_features").
setEdgeInputPropertyNames("edge_features").
setEdgeCombinationMethod(method).
build()
import oracle.pgx.config.mllib.edgecombination.EdgeCombinationMethod;
import oracle.pgx.config.mllib.edgecombination.EdgeCombinationMethods;
EdgeCombinationMethod method = EdgeCombinationMethods.concatEdgeCombinationMethod(useSourceVertex, useDestinationVertex, useEdge);
UnsupervisedEdgeWiseModel model = analyst.unsupervisedEdgeWiseModelBuilder()
.setVertexInputPropertyNames("vertex_features")
.setEdgeInputPropertyNames("edge_features")
.setEdgeCombinationMethod(method)
.build();
from pypgx.api.mllib import ConcatEdgeCombinationMethod
method_config = dict(use_source_vertex=True,
use_destination_vertex=False,
use_edge=True)
method = ConcatEdgeCombinationMethod(**method_config)
params = dict(vertex_input_property_names=["vertex_features"],
edge_input_property_names=["edge_features"],
edge_combination_method=method,
seed=17)
model = analyst.unsupervised_edgewise_builder(**params)
Parent topic: Using the Unsupervised EdgeWise Algorithm