class_docstr: Test Case to generate html report
class_docstr_tok: ["Test","Case","to","generate","html","report"]
code: def test_add_model_evaluation(self):
      self.name = "model-evaluation"
      self.report_name = "Model Evaluation Report"
      self.tag_number = 1
      ## Create Report
      self.report = Report(name=self.report_name)
      ### Create Data Evaluation Section
      self.report.detail.add_new_page()
      self.report.detail.add_section_title(
          "Example for Data Evaluation"
      )
  
      ### Add Header Level 1
      self.report.detail.add_header_level_1(
          text="Binary Classification Evaluation Analysis"
      )
      ### Add Header Level 2
      self.report.detail.add_header_level_2(text="Overall Result")
      self.assertEqual(len(self.report.detail.contents), 4)
  
      ### Numeric Metric
      # with open(prepare_input_path(data_path='sample_data/binary_evaluation_results.json'), 'r') as f:
      #     eval_result = json.load(f)
      #
      # splits = eval_result.keys()
      # numeric_metrics_list = []
      #
      # for split in splits:
      #     label_eval_result = eval_result[split]
      #     del (label_eval_result['vis_result'])
      #     numeric_metrics_list.append((split, label_eval_result))
      # print(numeric_metrics_list)
      #
      # self.report.detail.add_binary_class_evaluation_metric_results(
      #     numeric_metrics_list,
      #     notes='The section shows general results like accuracy, precision, recall.')
  
      ### Add Header Level 2
      self.report.detail.add_header_level_2(text="Confusion Matrix")
      ### Confusion Matrix
      # with open(prepare_input_path(data_path='sample_data/binary_evaluation_results.json'), 'r') as f:
      #     eval_result = json.load(f)
      # splits = eval_result.keys()
      # confusion_matrix_list = []
      #
      # for split in splits:
      #     label_eval_result = eval_result[split]
      #     confusion_matrix_list.append((split,
      #                                   {"labels": ["Negative", "Positive"],
      #                                    "values": label_eval_result["CM"]}))
      # print(confusion_matrix_list)
      #
      # self.report.detail.add_confusion_matrix_results(
      #     confusion_matrix_tuple=confusion_matrix_list)
      self.assertEqual(len(self.report.detail.contents), 5)
  
      ### Add Header Level 2
      self.report.detail.add_header_level_2(
          text="Confidence Distribution"
      )
      ### Confidence Distribution
      # with open(prepare_input_path(data_path='sample_data/binary_evaluation_results.json'), 'r') as f:
      #     eval_result = json.load(f)
      #
      # splits = eval_result.keys()
      # probability_plot_list = []
      #
      # for split in splits:
      #     vis_result = eval_result[split]['vis_result']
      #     probability_plot_list.append((split, vis_result))
      #     print('Split name:', split)
      #     for key, value in vis_result.items():
      #         print(' - %s:' % key, type(value), value[:3])
      #
      # self.report.detail.add_binary_class_confidence_distribution(
      #     probability_plot_list)
      self.assertEqual(len(self.report.detail.contents), 6)
  
      ### Add Header Level 2
      self.report.detail.add_header_level_2(text="Reliability Diagram")
      ### Reliability Diagram
      # with open(prepare_input_path(data_path='sample_data/binary_evaluation_results.json'), 'r') as f:
      #     eval_result = json.load(f)
      #
      # splits = eval_result.keys()
      # probability_plot_list = []
      #
      # for split in splits:
      #     label_eval_result = eval_result[split]['vis_result']
      #     probability_plot_list.append((split, vis_result))
      #     print('Split name:', split)
      #     for key, value in vis_result.items():
      #         print(' - %s:' % key, type(value), value[:3])
      #
      # self.report.detail.add_binary_class_reliability_diagram(probability_plot_list)
      self.assertEqual(len(self.report.detail.contents), 7)
  
      ### Add Header Level 1
      self.report.detail.add_header_level_1(
          text="Multi-class Classification Evaluation Analysis"
      )
      # with open(prepare_input_path(data_path='sample_data/multi_evaluation_results.json'), 'r') as f:
      #     eval_result = json.load(f)
      #
      # label_key = 'label_1'
      # label_eval_result = eval_result[label_key]
      # vis_result = label_eval_result['vis_result']
      # del (label_eval_result['vis_result'])
      self.assertEqual(len(self.report.detail.contents), 8)
  
      ### Add Header Level 2
      self.report.detail.add_header_level_2(text="Overall Result")
      ### Numeric Metrics
      # print(label_eval_result)
      #
      # ### Add Header Level 2
      # report.detail.add_header_level_2(text='Confusion Matrix')
      # ### Confusion Matrix
      # print(label_eval_result['CM'])
      #
      # self.report.detail.add_confusion_matrix_results(
      #     confusion_matrix_tuple=[('', label_eval_result['CM'])])
      self.assertEqual(len(self.report.detail.contents), 9)
  
      ### Add Header Level 2
      self.report.detail.add_header_level_2(
          text="Confidence Distribution"
      )
      ###  Probability Plot
      # for class_name, class_value in vis_result.items():
      #     print('Class:', class_name)
      #     for key, value in class_value.items():
      #         print(' - %s:' % key, type(value), value[:4])
      #
      # self.report.detail.add_multi_class_confidence_distribution([('', vis_result)])
      self.assertEqual(len(self.report.detail.contents), 10)
  
imports: import json
  import os
  import sys
  import unittest
  import warnings
  from pathlib import Path
  import numpy
  import pandas
  from datetime import datetime
  from xai.data import DataUtil
  from xai.data.constants import DATATYPE
  from xai.model.interpreter import FeatureInterpreter
  from xai.formatter import Report, HtmlWriter
  from tests.formatter.util import prepare_input_path, prepare_output_path
label_desc: Use image node_id 9 for calling the TestGenerateHtmlReport obj's underlying member method code with example usage: obj.test_add_model_evaluation() without return types