17.6.4 Building an Unsupervised Anomaly Detection GraphWise Model Using Partitioned Graphs

You can build an Unsupervised Anomaly Detection GraphWise model using partitioned graphs which have different providers and features.
opg4j> var model = analyst.unsupervisedAnomalyDetectionGraphWiseModelBuilder().
         setVertexInputPropertyNames("vertex_provider1_features", "vertex_provider2_features").
         build()
UnsupervisedAnomalyDetectionGraphWiseModel model = analyst.unsupervisedAnomalyDetectionGraphWiseModelBuilder()
    .setVertexInputPropertyNames("vertex_provider1_features", "vertex_provider2_features")
    .build();
params = dict(vertex_input_property_names=["vertex_provider1_features", "vertex_provider2_features"])
model = analyst.unsupervised_anomaly_detection_graphwise_builder(**params)

It is possible to select which providers you want to train or infer on:

opg4j> var model = analyst.unsupervisedAnomalyDetectionGraphWiseModelBuilder().
         setVertexInputPropertyNames("vertex_provider1_features", "vertex_provider2_features").
         build()
UnsupervisedAnomalyDetectionGraphWiseModel model = analyst.unsupervisedAnomalyDetectionGraphWiseModelBuilder()
    .setVertexInputPropertyNames("vertex_provider1_features", "vertex_provider2_features")
    .build();
params = dict(vertex_input_property_names=["vertex_provider1_features", "vertex_provider2_features"])
model = analyst.unsupervised_anomaly_detection_graphwise_builder(**params)

If you wish to control the flow of the embeddings at each layer, you can enable or disable the connections of interest. By default all the connections are enabled.

opg4j> var convLayerConfig = analyst.graphWiseConvLayerConfigBuilder().
         setNumSampledNeighbors(25).
         useVertexToVertexConnection(true).
         useEdgeToVertexConnection(true).
         useEdgeToEdgeConnection(false).
         useVertexToEdgeConnection(false).
         build()
opg4j> var model = analyst.unsupervisedAnomalyDetectionGraphWiseModelBuilder().
         setVertexInputPropertyNames("vertex_provider1_features", "vertex_provider2_features").
         build()
GraphWiseConvLayerConfig convLayerConfig = analyst.graphWiseConvLayerConfigBuilder()
    .setNumSampledNeighbors(10)
    .useVertexToVertexConnection(true)
    .useEdgeToVertexConnection(true)
    .useEdgeToEdgeConnection(false)
    .useVertexToEdgeConnection(false)
    .build();

UnsupervisedAnomalyDetectionGraphWiseModel model = analyst.unsupervisedAnomalyDetectionGraphWiseModelBuilder()
    .setVertexInputPropertyNames("vertex_provider1_features", "vertex_provider2_features")
    .setConvLayerConfigs(convLayerConfig)
    .build();
conv_layer_config = dict(num_sampled_neighbors=25,
                         activation_fn='tanh',
                         weight_init_scheme='xavier',
                         neighbor_weight_property_name=weightProperty,
                         vertex_to_vertex_connection=True,
                         edge_to_vertex_connection=True,
                         vertex_to_edge_connection=False,
                         edge_to_edge_connection=False)

conv_layer = analyst.graphwise_conv_layer_config(**conv_layer_config)

params = dict(vertex_input_property_names=["vertex_provider1_features", "vertex_provider2_features"],
              conv_layer_config=[conv_layer])

model = analyst.unsupervised_anomaly_detection_graphwise_builder(**params)