Class ExplanationResult

java.lang.Object
com.sap.ai.sdk.foundationmodels.rpt.generated.model.ExplanationResult

public class ExplanationResult extends Object
Explanation data for predictions.
  • Constructor Details

    • ExplanationResult

      protected ExplanationResult()
      Default constructor for ExplanationResult.
  • Method Details

    • topColumnScores

      @Nonnull public ExplanationResult topColumnScores(@Nullable List<Map<String,BigDecimal>> topColumnScores)
      Set the topColumnScores of this ExplanationResult instance and return the same instance.
      Parameters:
      topColumnScores - Column scores per query row extracted from the model (higher means more weight was put on this column).
      Returns:
      The same instance of this ExplanationResult class
    • addTopColumnScoresItem

      @Nonnull public ExplanationResult addTopColumnScoresItem(@Nonnull Map<String,BigDecimal> topColumnScoresItem)
      Add one topColumnScores instance to this ExplanationResult.
      Parameters:
      topColumnScoresItem - The topColumnScores that should be added
      Returns:
      The same instance of type ExplanationResult
    • getTopColumnScores

      @Nullable public List<Map<String,BigDecimal>> getTopColumnScores()
      Column scores per query row extracted from the model (higher means more weight was put on this column).
      Returns:
      topColumnScores The topColumnScores of this ExplanationResult instance.
    • setTopColumnScores

      public void setTopColumnScores(@Nullable List<Map<String,BigDecimal>> topColumnScores)
      Set the topColumnScores of this ExplanationResult instance.
      Parameters:
      topColumnScores - Column scores per query row extracted from the model (higher means more weight was put on this column).
    • topRelevantContextRows

      @Nonnull public ExplanationResult topRelevantContextRows(@Nullable List<List<Integer>> topRelevantContextRows)
      Set the topRelevantContextRows of this ExplanationResult instance and return the same instance.
      Parameters:
      topRelevantContextRows - 2D array where each subarray contains indices of most relevant context rows for that query row. The first dimension indexes query rows, the second dimension indexes all rows as a sequential integer index.
      Returns:
      The same instance of this ExplanationResult class
    • addTopRelevantContextRowsItem

      @Nonnull public ExplanationResult addTopRelevantContextRowsItem(@Nonnull List<Integer> topRelevantContextRowsItem)
      Add one topRelevantContextRows instance to this ExplanationResult.
      Parameters:
      topRelevantContextRowsItem - The topRelevantContextRows that should be added
      Returns:
      The same instance of type ExplanationResult
    • getTopRelevantContextRows

      @Nullable public List<List<Integer>> getTopRelevantContextRows()
      2D array where each subarray contains indices of most relevant context rows for that query row. The first dimension indexes query rows, the second dimension indexes all rows as a sequential integer index.
      Returns:
      topRelevantContextRows The topRelevantContextRows of this ExplanationResult instance.
    • setTopRelevantContextRows

      public void setTopRelevantContextRows(@Nullable List<List<Integer>> topRelevantContextRows)
      Set the topRelevantContextRows of this ExplanationResult instance.
      Parameters:
      topRelevantContextRows - 2D array where each subarray contains indices of most relevant context rows for that query row. The first dimension indexes query rows, the second dimension indexes all rows as a sequential integer index.
    • getCustomFieldNames

      @Nonnull public Set<String> getCustomFieldNames()
      Get the names of the unrecognizable properties of the ExplanationResult.
      Returns:
      The set of properties names
    • getCustomField

      @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
      Deprecated.
      Use toMap() instead.
      Get the value of an unrecognizable property of this ExplanationResult instance.
      Parameters:
      name - The name of the property
      Returns:
      The value of the property
      Throws:
      NoSuchElementException - If no property with the given name could be found.
    • toMap

      @Nonnull public Map<String,Object> toMap()
      Get the value of all properties of this ExplanationResult instance including unrecognized properties.
      Returns:
      The map of all properties
    • setCustomField

      public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
      Set an unrecognizable property of this ExplanationResult instance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
      Parameters:
      customFieldName - The name of the property
      customFieldValue - The value of the property
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • create

      public static ExplanationResult create()
      Create a new ExplanationResult instance. No arguments are required.