Class SupervisedEdgeWiseModel

    • Constructor Detail

      • SupervisedEdgeWiseModel

        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)
        This constructor should never be used to get a model. Use SupervisedEdgeWiseModelBuilder instead.
        Parameters:
        session - PgxSession to which the model is connected
        core - Core to which the model is connected
        graphConstructor - Constructor for a PgxGraph
        modelMetadata - Metadata concerning the different hyper-parameters of the EdgeWise Model
        Since:
        23.1
      • SupervisedEdgeWiseModel

        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)
    • Method Detail

      • inferLogitsAsync

        public PgxFuture<PgxFrame> inferLogitsAsync​(PgxGraph graph,
                                                    java.lang.Iterable<PgxEdge> edges)
        Infers the prediction logits for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to produce logits for
        Returns:
        PgxFrame containing the logits for each edge.
        Since:
        23.1
      • inferLogits

        public PgxFrame inferLogits​(PgxGraph graph,
                                    java.lang.Iterable<PgxEdge> edges)
        Blocking version of inferLogitsAsync(PgxGraph, Iterable). Infers the prediction logits for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to produce logits for
        Returns:
        PgxFrame containing the logits for each vertex.
        Since:
        23.1
      • inferLabelsAsync

        public PgxFuture<PgxFrame> inferLabelsAsync​(PgxGraph graph,
                                                    java.lang.Iterable<PgxEdge> edges)
        Infers the labels for the specified edges.
        Parameters:
        graph - the input graph
        edges - the vertices to produce labels to
        Returns:
        PgxFrame containing the labels for each edge.
        Since:
        23.1
      • inferLabelsAsync

        public PgxFuture<PgxFrame> inferLabelsAsync​(PgxGraph graph,
                                                    java.lang.Iterable<PgxEdge> edges,
                                                    float threshold)
        Infers the labels for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to produce labels for
        threshold - decision threshold for classification (unused for regression)
        Returns:
        PgxFrame containing the labels for each edge.
        Since:
        23.1
      • evaluateLabelsAsync

        public PgxFuture<PgxFrame> evaluateLabelsAsync​(PgxGraph graph,
                                                       java.lang.Iterable<PgxEdge> edges)
        Evaluates (macro averaged) classification performance statistics for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to evaluate the model on
        Returns:
        PgxFrame containing the metrics
        Since:
        23.1
      • evaluateLabelsAsync

        public PgxFuture<PgxFrame> evaluateLabelsAsync​(PgxGraph graph,
                                                       java.lang.Iterable<PgxEdge> edges,
                                                       float threshold)
        Evaluates (macro averaged) classification performance statistics for the specified vertices.
        Parameters:
        graph - the input graph
        edges - the edges to evaluate the model on
        threshold - decision threshold for classification (unused for regression)
        Returns:
        PgxFrame containing the labels for each edge.
        Since:
        23.1
      • inferLabels

        public PgxFrame inferLabels​(PgxGraph graph,
                                    java.lang.Iterable<PgxEdge> edges)
        Blocking version of inferLabelsAsync(PgxGraph, Iterable). Infers the labels for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to produce labels for
        Returns:
        PgxFrame containing the labels for each edge.
        Since:
        23.1
      • inferLabels

        public PgxFrame inferLabels​(PgxGraph graph,
                                    java.lang.Iterable<PgxEdge> edges,
                                    float threshold)
        Blocking version of inferLabelsAsync(PgxGraph, Iterable, float). Infers the labels for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to produce labels to
        threshold - decision threshold
        Returns:
        PgxFrame containing the labels for each edge.
        Since:
        23.1
      • evaluateLabels

        public PgxFrame evaluateLabels​(PgxGraph graph,
                                       java.lang.Iterable<PgxEdge> edges)
        Blocking version of evaluateLabelsAsync(PgxGraph, Iterable). Evaluates (macro averaged) classification performance statistics for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to evaluate the model on
        Returns:
        PgxFrame containing the metrics
        Since:
        23.1
      • evaluateLabels

        public PgxFrame evaluateLabels​(PgxGraph graph,
                                       java.lang.Iterable<PgxEdge> edges,
                                       float threshold)
        Blocking version of evaluateLabelsAsync(PgxGraph, Iterable, float). Evaluates (macro averaged) classification performance statistics for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to evaluate the model on
        threshold - decision threshold
        Returns:
        PgxFrame containing the labels for each edge.
        Since:
        23.1
      • inferAsync

        public PgxFuture<PgxFrame> inferAsync​(PgxGraph graph,
                                              java.lang.Iterable<PgxEdge> edges)
        Does inference for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to do inference to
        Returns:
        PgxFrame containing the inference for each edge.
        Since:
        23.1
      • inferAsync

        public PgxFuture<PgxFrame> inferAsync​(PgxGraph graph,
                                              java.lang.Iterable<PgxEdge> edges,
                                              float threshold)
        Does the inference for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to do inference for
        threshold - decision threshold for classification (unused for regression)
        Returns:
        PgxFrame containing the inference for each edge.
        Since:
        23.1
      • evaluateAsync

        public PgxFuture<PgxFrame> evaluateAsync​(PgxGraph graph,
                                                 java.lang.Iterable<PgxEdge> edges)
        Evaluates performance statistics for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to evaluate the model on
        Returns:
        PgxFrame containing the metrics
        Since:
        23.1
      • evaluateAsync

        public PgxFuture<PgxFrame> evaluateAsync​(PgxGraph graph,
                                                 java.lang.Iterable<PgxEdge> edges,
                                                 float threshold)
        Evaluates performance statistics for the specified vertices.
        Parameters:
        graph - the input graph
        edges - the edges to evaluate the model on
        threshold - decision threshold for classification (unused for regression)
        Returns:
        PgxFrame containing the labels for each edge.
        Since:
        23.1
      • infer

        public PgxFrame infer​(PgxGraph graph,
                              java.lang.Iterable<PgxEdge> edges)
        Blocking version of inferAsync(PgxGraph, Iterable). Does inference for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to do inference for
        Returns:
        PgxFrame containing the inference for each edge.
        Since:
        23.1
      • infer

        public PgxFrame infer​(PgxGraph graph,
                              java.lang.Iterable<PgxEdge> edges,
                              float threshold)
        Blocking version of inferAsync(PgxGraph, Iterable, float). Does inference for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to do inference to
        threshold - decision threshold
        Returns:
        PgxFrame containing the inference for each edge.
        Since:
        23.1
      • evaluate

        public PgxFrame evaluate​(PgxGraph graph,
                                 java.lang.Iterable<PgxEdge> edges)
        Blocking version of evaluateAsync(PgxGraph, Iterable). Evaluates performance statistics for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to evaluate the model on
        Returns:
        PgxFrame containing the metrics
        Since:
        23.1
      • evaluate

        public PgxFrame evaluate​(PgxGraph graph,
                                 java.lang.Iterable<PgxEdge> edges,
                                 float threshold)
        Blocking version of evaluateAsync(PgxGraph, Iterable, float). Evaluates performance statistics for the specified edges.
        Parameters:
        graph - the input graph
        edges - the edges to evaluate the model on
        threshold - decision threshold
        Returns:
        PgxFrame containing the labels for each edge.
        Since:
        23.1
      • storeAsync

        public PgxFuture<java.lang.Void> storeAsync​(java.lang.String path,
                                                    java.lang.String key)
                                             throws java.util.concurrent.ExecutionException,
                                                    java.lang.InterruptedException
        Stores the GraphWise model in the specified path, with encryption.
        Parameters:
        path - path to store the model
        key - the encryption key, or null if no encryption should be used.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
        Since:
        23.1
      • storeAsync

        public 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.
        Parameters:
        path - path to store the model
        key - the encryption key, or null if no encryption should be used.
        Since:
        23.1
      • store

        public void store​(java.lang.String path,
                          java.lang.String key)
                   throws java.util.concurrent.ExecutionException,
                          java.lang.InterruptedException
        Blocking version of storeAsync(String, String). Calls storeAsync(String, String) and waits for the returned PgxFuture to complete.
        Throws:
        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.
        Since:
        23.1
      • store

        public void store​(java.lang.String path,
                          java.lang.String key,
                          boolean overwrite)
                   throws java.util.concurrent.ExecutionException,
                          java.lang.InterruptedException
        Blocking version of storeAsync(String, String). Calls storeAsync(String, String) and waits for the returned PgxFuture to complete.
        Throws:
        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.
        Since:
        23.1
      • getLossFunctionClass

        public LossFunction getLossFunctionClass()
        Gets the loss function
        Returns:
        loss function
        Since:
        23.1
      • getPredictionLayerConfigs

        public GraphWisePredictionLayerConfig[] getPredictionLayerConfigs()
        Gets the configuration objects for the prediction layers
        Returns:
        configurations
        Since:
        23.1
      • getClassWeights

        public java.util.Map<?,​java.lang.Float> getClassWeights()
        Gets the class weights
        Returns:
        class weights
        Since:
        23.1
      • getEdgeTargetPropertyName

        public java.lang.String getEdgeTargetPropertyName()
        Gets the edge target property name
        Returns:
        edge target property name
      • getTargetEdgeLabels

        public java.util.List<java.util.Set<java.lang.String>> getTargetEdgeLabels()
        Gets the target vertex labels
        Returns:
        target vertex labels
        Since:
        23.1