public class SupervisedEdgeWiseModel extends EdgeWiseModel<SupervisedEdgeWiseModelConfig,oracle.pgx.api.internal.mllib.SupervisedEdgeWiseModelMetadata,SupervisedEdgeWiseModel>
SupervisedEdgeWiseModelBuilder
for documentation of the hyperparameters.Modifier and Type | Class and Description |
---|---|
static class |
SupervisedEdgeWiseModel.SupervisedEdgeWiseInferenceType |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALGORITHM_NAME |
Constructor and Description |
---|
SupervisedEdgeWiseModel(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,
oracle.pgx.api.internal.mllib.ModelMetadata modelMetadata) |
SupervisedEdgeWiseModel(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,
oracle.pgx.api.internal.mllib.SupervisedEdgeWiseModelMetadata modelMetadata)
This constructor should never be used to get a model.
|
Modifier and Type | Method and Description |
---|---|
PgxFrame |
evaluate(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Blocking version of
evaluateAsync(PgxGraph, Iterable) . |
PgxFrame |
evaluate(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges,
float threshold)
Blocking version of
evaluateAsync(PgxGraph, Iterable, float) . |
PgxFuture<PgxFrame> |
evaluateAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Evaluates performance statistics for the specified edges.
|
PgxFuture<PgxFrame> |
evaluateAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges,
float threshold)
Evaluates performance statistics for the specified vertices.
|
PgxFrame |
evaluateLabels(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Blocking version of
evaluateLabelsAsync(PgxGraph, Iterable) . |
PgxFrame |
evaluateLabels(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges,
float threshold)
Blocking version of
evaluateLabelsAsync(PgxGraph, Iterable, float) . |
PgxFuture<PgxFrame> |
evaluateLabelsAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Evaluates (macro averaged) classification performance statistics for the specified edges.
|
PgxFuture<PgxFrame> |
evaluateLabelsAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges,
float threshold)
Evaluates (macro averaged) classification performance statistics for the specified vertices.
|
PgxFuture<java.lang.Double> |
fitAsync(PgxGraph graph)
Trains the EdgeWise model on the input graph.
|
java.util.Map<?,java.lang.Float> |
getClassWeights()
Gets the class weights
|
java.lang.String |
getEdgeTargetPropertyName()
Gets the edge target property name
|
LossFunction |
getLossFunctionClass()
Gets the loss function
|
GraphWisePredictionLayerConfig[] |
getPredictionLayerConfigs()
Gets the configuration objects for the prediction layers
|
java.util.List<java.util.Set<java.lang.String>> |
getTargetEdgeLabels()
Gets the target vertex labels
|
PgxFrame |
infer(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Blocking version of
inferAsync(PgxGraph, Iterable) . |
PgxFrame |
infer(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges,
float threshold)
Blocking version of
inferAsync(PgxGraph, Iterable, float) . |
PgxFuture<PgxFrame> |
inferAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Does inference for the specified edges.
|
PgxFuture<PgxFrame> |
inferAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges,
float threshold)
Does the inference for the specified edges.
|
PgxFuture<PgxFrame> |
inferEmbeddingsAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Infers the embeddings for the specified edges.
|
PgxFrame |
inferLabels(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Blocking version of
inferLabelsAsync(PgxGraph, Iterable) . |
PgxFrame |
inferLabels(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges,
float threshold)
Blocking version of
inferLabelsAsync(PgxGraph, Iterable, float) . |
PgxFuture<PgxFrame> |
inferLabelsAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Infers the labels for the specified edges.
|
PgxFuture<PgxFrame> |
inferLabelsAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges,
float threshold)
Infers the labels for the specified edges.
|
PgxFrame |
inferLogits(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Blocking version of
inferLogitsAsync(PgxGraph, Iterable) . |
PgxFuture<PgxFrame> |
inferLogitsAsync(PgxGraph graph,
java.lang.Iterable<PgxEdge> edges)
Infers the prediction logits for the specified edges.
|
void |
store(java.lang.String path,
java.lang.String key)
Blocking version of
storeAsync(String, String) . |
void |
store(java.lang.String path,
java.lang.String key,
boolean overwrite)
Blocking version of
storeAsync(String, String) . |
PgxFuture<java.lang.Void> |
storeAsync(java.lang.String path,
java.lang.String key)
Stores the GraphWise model in the specified path, with encryption.
|
PgxFuture<java.lang.Void> |
storeAsync(java.lang.String path,
java.lang.String key,
boolean overwrite)
Stores the GraphWise model in the specified path, with encryption.
|
destroy, destroyAsync, fit, getBatchSize, getConfig, getConvLayerConfigs, getEdgeCombinationMethod, getEdgeInputFeatureDim, getEdgeInputPropertyNames, getEmbeddingDim, getInputFeatureDim, getLearningRate, getNumEpochs, getSeed, getTrainingLoss, getVertexInputPropertyNames, inferEmbeddings, isFitted
public static final java.lang.String ALGORITHM_NAME
public SupervisedEdgeWiseModel(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, oracle.pgx.api.internal.mllib.ModelMetadata modelMetadata)
public SupervisedEdgeWiseModel(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, oracle.pgx.api.internal.mllib.SupervisedEdgeWiseModelMetadata modelMetadata)
SupervisedEdgeWiseModelBuilder
instead.session
- PgxSession to which the model is connectedcore
- Core to which the model is connectedgraphConstructor
- Constructor for a PgxGraphmodelMetadata
- Metadata concerning the different hyper-parameters of the EdgeWise Modelpublic PgxFrame evaluate(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
evaluateAsync(PgxGraph, Iterable)
.
Evaluates performance statistics for the specified edges.graph
- the input graphedges
- the edges to evaluate the model onpublic PgxFrame evaluate(PgxGraph graph, java.lang.Iterable<PgxEdge> edges, float threshold)
evaluateAsync(PgxGraph, Iterable, float)
.
Evaluates performance statistics for the specified edges.graph
- the input graphedges
- the edges to evaluate the model onthreshold
- decision thresholdpublic PgxFuture<PgxFrame> evaluateAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
graph
- the input graphedges
- the edges to evaluate the model onpublic PgxFuture<PgxFrame> evaluateAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges, float threshold)
graph
- the input graphedges
- the edges to evaluate the model onthreshold
- decision threshold for classification (unused for regression)public PgxFrame evaluateLabels(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
evaluateLabelsAsync(PgxGraph, Iterable)
.
Evaluates (macro averaged) classification performance statistics for the specified edges.graph
- the input graphedges
- the edges to evaluate the model onpublic PgxFrame evaluateLabels(PgxGraph graph, java.lang.Iterable<PgxEdge> edges, float threshold)
evaluateLabelsAsync(PgxGraph, Iterable, float)
.
Evaluates (macro averaged) classification performance statistics for the specified edges.graph
- the input graphedges
- the edges to evaluate the model onthreshold
- decision thresholdpublic PgxFuture<PgxFrame> evaluateLabelsAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
graph
- the input graphedges
- the edges to evaluate the model onpublic PgxFuture<PgxFrame> evaluateLabelsAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges, float threshold)
graph
- the input graphedges
- the edges to evaluate the model onthreshold
- decision threshold for classification (unused for regression)public PgxFuture<java.lang.Double> fitAsync(PgxGraph graph)
fitAsync
in class EdgeWiseModel<SupervisedEdgeWiseModelConfig,oracle.pgx.api.internal.mllib.SupervisedEdgeWiseModelMetadata,SupervisedEdgeWiseModel>
graph
- input graph to fit on.public java.util.Map<?,java.lang.Float> getClassWeights()
public java.lang.String getEdgeTargetPropertyName()
public LossFunction getLossFunctionClass()
public GraphWisePredictionLayerConfig[] getPredictionLayerConfigs()
public java.util.List<java.util.Set<java.lang.String>> getTargetEdgeLabels()
public PgxFrame infer(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
inferAsync(PgxGraph, Iterable)
.
Does inference for the specified edges.graph
- the input graphedges
- the edges to do inference forpublic PgxFrame infer(PgxGraph graph, java.lang.Iterable<PgxEdge> edges, float threshold)
inferAsync(PgxGraph, Iterable, float)
.
Does inference for the specified edges.graph
- the input graphedges
- the edges to do inference tothreshold
- decision thresholdpublic PgxFuture<PgxFrame> inferAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
graph
- the input graphedges
- the edges to do inference topublic PgxFuture<PgxFrame> inferAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges, float threshold)
graph
- the input graphedges
- the edges to do inference forthreshold
- decision threshold for classification (unused for regression)public PgxFuture<PgxFrame> inferEmbeddingsAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
inferEmbeddingsAsync
in class EdgeWiseModel<SupervisedEdgeWiseModelConfig,oracle.pgx.api.internal.mllib.SupervisedEdgeWiseModelMetadata,SupervisedEdgeWiseModel>
graph
- the input graphedges
- the edges to produce embeddings topublic PgxFrame inferLabels(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
inferLabelsAsync(PgxGraph, Iterable)
.
Infers the labels for the specified edges.graph
- the input graphedges
- the edges to produce labels forpublic PgxFrame inferLabels(PgxGraph graph, java.lang.Iterable<PgxEdge> edges, float threshold)
inferLabelsAsync(PgxGraph, Iterable, float)
.
Infers the labels for the specified edges.graph
- the input graphedges
- the edges to produce labels tothreshold
- decision thresholdpublic PgxFuture<PgxFrame> inferLabelsAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
graph
- the input graphedges
- the vertices to produce labels topublic PgxFuture<PgxFrame> inferLabelsAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges, float threshold)
graph
- the input graphedges
- the edges to produce labels forthreshold
- decision threshold for classification (unused for regression)public PgxFrame inferLogits(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
inferLogitsAsync(PgxGraph, Iterable)
.
Infers the prediction logits for the specified edges.graph
- the input graphedges
- the edges to produce logits forpublic PgxFuture<PgxFrame> inferLogitsAsync(PgxGraph graph, java.lang.Iterable<PgxEdge> edges)
graph
- the input graphedges
- the edges to produce logits forpublic void store(java.lang.String path, java.lang.String key) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
storeAsync(String, String)
.
Calls storeAsync(String, String)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will
be nested.public void store(java.lang.String path, java.lang.String key, boolean overwrite) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
storeAsync(String, String)
.
Calls storeAsync(String, String)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will
be nested.public PgxFuture<java.lang.Void> storeAsync(java.lang.String path, java.lang.String key) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
path
- path to store the modelkey
- the encryption key, or null if no encryption should be used.java.util.concurrent.ExecutionException
java.lang.InterruptedException
public PgxFuture<java.lang.Void> storeAsync(java.lang.String path, java.lang.String key, boolean overwrite)
path
- path to store the modelkey
- the encryption key, or null if no encryption should be used.