class_docstr: Visualizer for a single Additive Force plot.
class_docstr_tok: ["Visualizer","for","a","single","Additive","Force","plot","."]
docstr: Parameters
  ----------
  e : AdditiveExplanation
      Contains the data necessary for additive force plots.
  
  plot_cmap : str or list[str]
      Color map to use. It can be a string (defaults to ``RdBu``) or a list of hex color strings.
docstr_tok: ["Parameters","--","--","--","--","--","e",":","AdditiveExplanation","Contains","the","data","necessary","for","additive","force","plots",".","plot_cmap",":","str","or","list","[","str","]","Color","map","to","use",".","It","can","be","a","string","(","defaults","to","``","RdBu","``",")","or","a","list","of","hex","color","strings","."]
code: def __init__(self, e, plot_cmap="RdBu"):
      """
  
      Parameters
      ----------
      e : AdditiveExplanation
          Contains the data necessary for additive force plots.
  
      plot_cmap : str or list[str]
          Color map to use. It can be a string (defaults to ``RdBu``) or a list of hex color strings.
      """
      if not isinstance(e, AdditiveExplanation):
          emsg = "AdditiveForceVisualizer can only visualize AdditiveExplanation objects!"
          raise TypeError(emsg)
  
      # build the json data
      features = {}
      for i in filter(
          lambda j: e.effects[j] != 0, range(len(e.data.group_names))
      ):
          features[i] = {
              "effect": ensure_not_numpy(e.effects[i]),
              "value": ensure_not_numpy(
                  e.instance.group_display_values[i]
              ),
          }
      self.data = {
          "outNames": e.model.out_names,
          "baseValue": ensure_not_numpy(e.base_value),
          "outValue": ensure_not_numpy(e.out_value),
          "link": str(e.link),
          "featureNames": e.data.group_names,
          "features": features,
          "plot_cmap": plot_cmap,
      }
  
imports: import base64
  import json
  import os
  import random
  import re
  import string
  import warnings
  from collections.abc import Sequence
  import numpy
  import pandas
  import scipy.sparse
  from ..plots._force_matplotlib import draw_additive_plot
  from ..utils import hclust_ordering
  from ..utils._exceptions import DimensionError
  from ..utils._legacy import Data, DenseData, Instance, Link, Model, convert_to_link
  from ._labels import labels
label_desc: Use image node_id 1 to create a new AdditiveForceVisualizer object from inherited base classes: BaseVisualizer with example: obj = AdditiveForceVisualizer(e, plot_cmap)