Package oracle.pgx.api.mllib
Class SupervisedEdgeWiseModelBuilder
- java.lang.Object
-
- oracle.pgx.api.mllib.WiseModelBuilder<Config,Self>
-
- oracle.pgx.api.mllib.EdgeWiseModelBuilder<SupervisedEdgeWiseModel,SupervisedEdgeWiseModelConfig,SupervisedEdgeWiseModelBuilder>
-
- oracle.pgx.api.mllib.SupervisedEdgeWiseModelBuilder
-
public class SupervisedEdgeWiseModelBuilder extends EdgeWiseModelBuilder<SupervisedEdgeWiseModel,SupervisedEdgeWiseModelConfig,SupervisedEdgeWiseModelBuilder>
Builder forSupervisedEdgeWiseModel
The builder can be used to set the configuration of the model and create the model object.- Since:
- 23.1
-
-
Constructor Summary
Constructors Constructor Description SupervisedEdgeWiseModelBuilder(PgxSession session, oracle.pgx.api.internal.Core core, java.util.function.Supplier<java.lang.String> keystorePathSupplier, java.util.function.Supplier<char[]> keystorePasswordSupplier, java.util.function.BiFunction<PgxSession,oracle.pgx.api.internal.Graph,PgxGraph> graphConstructor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SupervisedEdgeWiseModel
build()
Builds the SupervisedEdgeWise model with the specified parameters.SupervisedEdgeWiseModelBuilder
setBatchGenerator(BatchGenerator batchGenerator)
Sets the batch generator.SupervisedEdgeWiseModelBuilder
setClassWeights(java.util.Map<?,java.lang.Float> classWeights)
Set the class weights to be used in the loss function.SupervisedEdgeWiseModelBuilder
setEdgeTargetPropertyName(java.lang.String propertyName)
Set the target (labels) for the algorithm in the form of a property name of the graph.SupervisedEdgeWiseModelBuilder
setLossFunction(LossFunction lossFunction)
Sets the loss function for the algorithm.SupervisedEdgeWiseModelBuilder
setPredictionLayerConfigs(GraphWisePredictionLayerConfig... layerConfigs)
Set the prediction layer configurations (SeeGraphWisePredictionLayerConfig
.-
Methods inherited from class oracle.pgx.api.mllib.EdgeWiseModelBuilder
setEdgeCombinationMethod, setTargetEdgeLabels, setTargetEdgeLabels
-
Methods inherited from class oracle.pgx.api.mllib.WiseModelBuilder
setBatchSize, setConvLayerConfigs, setEdgeInputPropertyConfigs, setEdgeInputPropertyNames, setEdgeInputPropertyNames, setEmbeddingDim, setEnableAccelerator, setLearningRate, setNormalize, setNumEpochs, setSeed, setShuffle, setStandardize, setValidationConfig, setVertexInputPropertyConfigs, setVertexInputPropertyNames, setVertexInputPropertyNames, setWeightDecay
-
-
-
-
Constructor Detail
-
SupervisedEdgeWiseModelBuilder
public SupervisedEdgeWiseModelBuilder(PgxSession session, oracle.pgx.api.internal.Core core, java.util.function.Supplier<java.lang.String> keystorePathSupplier, java.util.function.Supplier<char[]> keystorePasswordSupplier, java.util.function.BiFunction<PgxSession,oracle.pgx.api.internal.Graph,PgxGraph> graphConstructor)
-
-
Method Detail
-
setEdgeTargetPropertyName
public SupervisedEdgeWiseModelBuilder setEdgeTargetPropertyName(java.lang.String propertyName)
Set the target (labels) for the algorithm in the form of a property name of the graph.Supported property types are given by
SupervisedEdgeWiseModelConfig.SUPPORTED_LABEL_TYPES
.- Parameters:
propertyName
- property name- Returns:
- this
- Since:
- 23.1
-
setPredictionLayerConfigs
public SupervisedEdgeWiseModelBuilder setPredictionLayerConfigs(GraphWisePredictionLayerConfig... layerConfigs)
Set the prediction layer configurations (SeeGraphWisePredictionLayerConfig
. You must pass at least one prediction layer config (or leave it as default).Note that for the last layer:
- the activation function will be ignored (and replaced with the activation function of the loss function, e.g. softmax or sigmoid).
- the hidden dimension will be ignored (and replaced with the number of classes)
default:
SupervisedEdgeWiseModelConfig.DEFAULT_PREDICTION_LAYER_CONFIGS
- Parameters:
layerConfigs
- layer configs- Returns:
- this
- Since:
- 23.1
-
setClassWeights
public SupervisedEdgeWiseModelBuilder setClassWeights(java.util.Map<?,java.lang.Float> classWeights)
Set the class weights to be used in the loss function. The loss for the corresponding class will be multiplied by the factor given in this map. If null, uniform class weights will be used.- Parameters:
classWeights
- map from classes to weights- Returns:
- this
- Since:
- 23.1
-
setLossFunction
public SupervisedEdgeWiseModelBuilder setLossFunction(LossFunction lossFunction)
Sets the loss function for the algorithm. SeeLossFunction
default:
SoftmaxCrossEntropyLoss
- Parameters:
lossFunction
- loss function- Returns:
- this
- Since:
- 23.1
-
setBatchGenerator
public SupervisedEdgeWiseModelBuilder setBatchGenerator(BatchGenerator batchGenerator)
Sets the batch generator. SeeBatchGenerator
default:
StandardBatchGenerator
- Parameters:
batchGenerator
- batch generator- Returns:
- this
- Since:
- 23.1
-
build
public SupervisedEdgeWiseModel build() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Builds the SupervisedEdgeWise model with the specified parameters.- Specified by:
build
in classEdgeWiseModelBuilder<SupervisedEdgeWiseModel,SupervisedEdgeWiseModelConfig,SupervisedEdgeWiseModelBuilder>
- Returns:
- SupervisedEdgeWise model
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
- Since:
- 23.1
-
-