docstr: Add information of feature importance to the report.
  
  Args:
      notes(str): Explain the block
      importance_ranking(:list of :list): a list of 2-item lists,
                                  item[0]: score, item[1] feature_name
      importance_threshold(float): threshold for displaying the feature
                                  name and score in tables
      maximum_number_feature(int): maximum number of features shown in bar-chart diagram
docstr_tok: ["Add","information","of","feature","importance","to","the","report",".","Args",":","notes","(","str",")",":","Explain","the","block","importance_ranking","(",":","list","of",":","list",")",":","a","list","of","2-item","lists",",","item","[","0","]",":","score",",","item","[","1","]","feature_name","importance_threshold","(","float",")",":","threshold","for","displaying","the","feature","name","and","score","in","tables","maximum_number_feature","(","int",")",":","maximum","number","of","features","shown","in","bar-chart","diagram"]
code: def draw_feature_importance(
      self,
      notes: str,
      *,
      importance_ranking: List[List],
      importance_threshold: float,
      maximum_number_feature=20,
  ):
      """
      Add information of feature importance to the report.
  
      Args:
          notes(str): Explain the block
          importance_ranking(:list of :list): a list of 2-item lists,
                                      item[0]: score, item[1] feature_name
          importance_threshold(float): threshold for displaying the feature
                                      name and score in tables
          maximum_number_feature(int): maximum number of features shown in bar-chart diagram
      """
      from xai.graphs import graph_generator
  
      image_path = "%s/feature_importance.png" % self.figure_path
      image_path = graph_generator.FeatureImportance(
          figure_path=image_path,
          data=importance_ranking,
          title="feature_importance",
      ).draw(limit_length=maximum_number_feature)
  
      # -- Draw Content --
      if not (notes is None):
          self.pdf.add_new_line(notes)
      elif maximum_number_feature < len(importance_ranking):
          self.pdf.add_new_line(
              "The figure below shows the top %s important features for the trained model."
              % maximum_number_feature
          )
      else:
          self.pdf.add_new_line(
              "The figure below shows importance ranking for all features from the trained model."
          )
  
      self.pdf.add_large_image(image_path)
  
      self.pdf.ln()
  
      self.pdf.add_new_line(
          "The features which have an importance score larger than %s are listed in the below table."
          % importance_threshold
      )
  
      table_header = ["Feature", "Importance"]
      table_data = []
  
      for feature_name, importance in importance_ranking:
          if float(importance) < importance_threshold:
              break
          table_data.append(
              [
                  feature_name
                  if len(feature_name) < 50
                  else "%s_~" % feature_name[:50],
                  round(importance, 10),
              ]
          )
          #
  
      self.pdf.add_table(
          header=table_header, data=table_data, col_width=[140, 30]
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import os
  import tempfile
  import warnings
  import numpy
  import shutil
  from typing import Tuple, Dict, List
  from xai import MODE
  from xai.data.constants import DatetimeResolution
  from xai.data.explorer import CategoricalStats, NumericalStats, TextStats, DatetimeStats
  from xai.formatter.contents import Title, SectionTitle, Header
  from xai.formatter.portable_document.publisher import CustomPdf
  from xai.formatter.report.section import OverviewSection, DetailSection
  from xai.formatter.writer import Writer
label_desc: Use image node_id 23 for calling the PdfWriter obj's underlying member method code with example usage: obj.draw_feature_importance(notes) without return types