Class SupervisedGnnExplainer

    • Method Detail

      • inferAndExplainAsync

        public <ID> PgxFuture<SupervisedGnnExplanation<ID>> inferAndExplainAsync​(PgxGraph graph,
                                                                                 PgxVertex<ID> vertex)
        Performs inference on the specified vertex and generates an explanation that contains scores of how important each property and each vertex in the computation graph is for the prediction.
        Parameters:
        graph - the input graph
        vertex - the vertex
        Returns:
        explanation containing feature importance and vertex importance.
        Since:
        22.2
      • inferAndExplainAsync

        public <ID> PgxFuture<SupervisedGnnExplanation<ID>> inferAndExplainAsync​(PgxGraph graph,
                                                                                 PgxVertex<ID> vertex,
                                                                                 float threshold)
        Performs inference on the specified vertex and generates an explanation that contains scores of how important each property and each vertex in the computation graph is for the prediction.
        Parameters:
        graph - the input graph
        vertex - the vertex
        threshold - decision threshold
        Returns:
        explanation containing feature importance and vertex importance.
        Since:
        22.2
      • inferAndExplain

        public <ID> SupervisedGnnExplanation<ID> inferAndExplain​(PgxGraph graph,
                                                                 PgxVertex<ID> vertex)
        Blocking version of inferAndExplainAsync(PgxGraph, PgxVertex). Performs inference on the specified vertex and generates an explanation that contains scores of how important each property and each vertex in the computation graph is for the prediction.
        Parameters:
        graph - the input graph
        vertex - the vertex
        Returns:
        explanation containing feature importance and vertex importance.
        Since:
        22.2
      • inferAndExplain

        public <ID> SupervisedGnnExplanation<ID> inferAndExplain​(PgxGraph graph,
                                                                 PgxVertex<ID> vertex,
                                                                 float threshold)
        Blocking version of inferAndExplainAsync(PgxGraph, PgxVertex, float). Performs inference on the specified vertex and generates an explanation that contains scores of how important each property and each vertex in the computation graph is for the prediction.
        Parameters:
        graph - the input graph
        vertex - the vertex
        threshold - threshold
        Returns:
        explanation containing feature importance and vertex importance.
        Since:
        22.2
      • numOptimizationSteps

        public SupervisedGnnExplainer numOptimizationSteps​(int numOptimizationSteps)
        Set the number of optimization steps for the explainer.
        Parameters:
        numOptimizationSteps - number of optimization steps
        Since:
        22.2
      • learningRate

        public SupervisedGnnExplainer learningRate​(double learningRate)
        Set the learning rate for the explainer.
        Parameters:
        learningRate - learning rate
        Since:
        22.2
      • marginalize

        public SupervisedGnnExplainer marginalize​(boolean marginalize)
        Set whether the explainer loss is marginalized over features. This can help in cases where there are important features that take values close to zero. Without marginalization the explainer can learn to mask such features out even if they are important, marginalization solves this by instead learning a mask for the deviation from the estimated input distribution.
        Parameters:
        marginalize - true if loss should be marginalized, false otherwise
        Since:
        22.2