code: def add_shap_multiclass(fout, model_path, fold_cnt, repeat_cnt):
      try:
          # Dependence SHAP
          dep_plots = [
              f
              for f in os.listdir(model_path)
              if "_shap_dependence" in f
          ]
          if not len(dep_plots):
              return
  
          # get number of classes
          start_ind = 0
          for i, a in enumerate(dep_plots[0].split("_")):
              if a == "class":
                  start_ind = i + 1
                  break
  
          classes = []
          for l in dep_plots:
              a = l.split("_")
              classes += ["".join(a[start_ind:])[:-4]]
          classes = np.unique(classes)
  
          fout.write("\n\n## SHAP Dependence plots\n")
  
          for repeat in range(repeat_cnt):
              repeat_str = (
                  f", Repeat {repeat+1}" if repeat_cnt > 1 else ""
              )
              for fold in range(fold_cnt):
                  learner_name = construct_learner_name(
                      fold, repeat, repeat_cnt
                  )
                  for t in classes:
                      fname = (
                          learner_name
                          + f"_shap_dependence_class_{t}.png"
                      )
                      if fname in dep_plots:
                          fout.write(
                              f"\n### Dependence {t} (Fold {fold+1}{repeat_str})\n"
                          )
                          fout.write(
                              f"![SHAP Dependence from fold {fold+1}{repeat_str}]({fname})"
                          )
  
          # SHAP Decisions
          dec_plots = [
              f
              for f in os.listdir(model_path)
              if "_sample_" in f and "decisions.png" in f
          ]
          if not len(dec_plots):
              return
  
          fout.write("\n\n## SHAP Decision plots\n")
          for decision_type in ["worst", "best"]:
              for sample in [0, 1, 2, 3]:
                  for repeat in range(repeat_cnt):
                      repeat_str = (
                          f", Repeat {repeat+1}"
                          if repeat_cnt > 1
                          else ""
                      )
                      for fold in range(fold_cnt):
                          learner_name = construct_learner_name(
                              fold, repeat, repeat_cnt
                          )
                          fname = (
                              learner_name
                              + f"_sample_{sample}_{decision_type}_decisions.png"
                          )
                          if fname in dec_plots:
                              fout.write(
                                  f"\n### {decision_type.capitalize()} decisions for selected sample {sample+1} (Fold {fold+1}{repeat_str})\n"
                              )
                              fout.write(
                                  f"![SHAP {decision_type} decisions from Fold {fold+1}{repeat_str}]({fname})"
                              )
      except Exception as e:
          logger.error(
              f"Exception while saving SHAP explanations. {str(e)}\nContinuing ..."
          )
  
imports: import copy
  import json
  import logging
  import os
  import time
  import uuid
  import warnings
  import numpy
  import pandas
  from sklearn.metrics import accuracy_score, classification_report, confusion_matrix, f1_score, matthews_corrcoef, mean_absolute_error, mean_absolute_percentage_error, mean_squared_error, precision_score, r2_score, recall_score, roc_auc_score
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION
  from supervised.utils.metric import logloss
  from supervised.utils.config import LOG_LEVEL
  from tabulate import tabulate
  from supervised.fairness.metrics import FairnessMetrics
  from supervised.fairness.report import FairnessReport
  from supervised.fairness.utils import accuracy, false_negative_rate, false_positive_rate, selection_rate, true_negative_rate, true_positive_rate
  from supervised.utils.additional_plots import AdditionalPlots
  from supervised.utils.common import construct_learner_name, get_fold_repeat_cnt
  from supervised.utils.learning_curves import LearningCurves
  from supervised.utils.jsonencoder import MLJSONEncoder
label_desc: Use image node_id 16 for calling the AdditionalMetrics obj's underlying member method code with example usage: obj.add_shap_multiclass(fout, model_path, fold_cnt, repeat_cnt) without return types