ComfyUI Node: NNT SHAP Summary Node

Class Name

NntSHAPSummaryNode

Category
NNT Neural Network Toolkit/Models
Author
inventorado (Account age: 3209days)
Extension
ComfyUI Neural Network Toolkit NNT
Latest Updated
2025-01-08
Github Stars
0.07K

How to Install ComfyUI Neural Network Toolkit NNT

Install this extension via the ComfyUI Manager by searching for ComfyUI Neural Network Toolkit NNT
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Neural Network Toolkit NNT in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

NNT SHAP Summary Node Description

Generate SHAP summary plot and text report highlighting top feature importance for model interpretation.

NNT SHAP Summary Node:

The NntSHAPSummaryNode is designed to provide a comprehensive analysis of model predictions using SHAP (SHapley Additive exPlanations) values, which are a popular method for interpreting machine learning models. This node generates a visual summary of feature importance, helping you understand which features most significantly impact the model's predictions. By leveraging SHAP values, the node offers insights into the model's decision-making process, making it easier to identify key features and their contributions. This is particularly beneficial for AI artists and developers who want to ensure their models are not only accurate but also interpretable. The node's primary function is to create a SHAP summary plot and a text report that highlights the top features by importance, providing a clear and concise overview of the model's behavior.

NNT SHAP Summary Node Input Parameters:

model

The model parameter represents the machine learning model you wish to analyze. It is crucial as it determines the context in which SHAP values are calculated, directly affecting the interpretation of feature importance. There are no specific minimum or maximum values for this parameter, but it should be a trained model compatible with SHAP's KernelExplainer.

X_train_sample

The X_train_sample parameter is a sample of your training data used to establish a baseline for SHAP value calculations. It impacts the accuracy and relevance of the SHAP explanations. The minimum size of this sample should be equal to or greater than the background_sample_size parameter to avoid errors.

X_test_sample

The X_test_sample parameter is the data sample for which you want to generate SHAP explanations. It is essential for determining how the model's predictions are influenced by different features. There are no specific size constraints, but it should be representative of the data you are interested in analyzing.

plot_type

The plot_type parameter specifies the type of plot to generate for visualizing SHAP values. Options include "dot", "bar", and other SHAP-supported plot types. The choice of plot type affects how the feature importance is visually represented, with "dot" being the default option for a detailed view.

background_sample_size

The background_sample_size parameter defines the number of samples from X_train_sample to use as a background for SHAP value calculations. It influences the stability and accuracy of the SHAP explanations. The default value is 100, and it should not exceed the size of X_train_sample.

NNT SHAP Summary Node Output Parameters:

image_tensor

The image_tensor output is a visual representation of the SHAP summary plot, converted into a tensor format. This output is crucial for visually interpreting the feature importance and understanding the model's decision-making process. It provides a normalized image tensor that can be easily integrated into further analysis or visualization workflows.

text_report

The text_report output is a textual summary of the top features by importance, based on SHAP values. This report is essential for quickly identifying which features have the most significant impact on the model's predictions, offering a concise and interpretable overview of feature importance.

NNT SHAP Summary Node Usage Tips:

  • Ensure that your X_train_sample is large enough to accommodate the background_sample_size to avoid errors and ensure accurate SHAP value calculations.
  • Use the plot_type parameter to customize the visualization according to your preferences and the specific insights you wish to gain from the SHAP summary.
  • Regularly update your model and data samples to reflect the most current and relevant information, ensuring that the SHAP analysis remains accurate and meaningful.

NNT SHAP Summary Node Common Errors and Solutions:

Error generating SHAP summary: Background sample size exceeds training data size

  • Explanation: This error occurs when the background_sample_size is larger than the number of samples in X_train_sample.
  • Solution: Reduce the background_sample_size to be equal to or less than the size of X_train_sample.

Error generating SHAP summary: <specific error message>

  • Explanation: This error indicates a problem during the SHAP summary generation, possibly due to incompatible model or data inputs.
  • Solution: Ensure that the model is compatible with SHAP's KernelExplainer and that the data samples are correctly formatted and representative of the analysis you wish to perform.

NNT SHAP Summary Node Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Neural Network Toolkit NNT
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.