code: def test_estimate_tan_auto_class_node(self):
      # learn tree structure using auto root and class node
      est = TreeSearch(self.data22)
  
      # root and class node selection
      weights = est._get_weights(self.data22)
      sum_weights = weights.sum(axis=0)
      maxw_idx = np.argsort(sum_weights)[::-1]
      root_node = self.data22.columns[maxw_idx[0]]
      class_node = self.data22.columns[maxw_idx[1]]
  
      dag = est.estimate(
          estimator_type="tan",
          class_node=class_node,
          show_progress=False,
      )
      nodes = list(dag.nodes())
      self.assertEqual(nodes[0], root_node)
      self.assertEqual(nodes[-1], class_node)
      self.assertEqual(
          sorted(nodes), sorted(["C", "R", "A", "D", "E", "B"])
      )
  
imports: import unittest
  import networkx
  import numpy
  import pandas
  from joblib.externals.loky import get_reusable_executor
  from pgmpy.estimators import TreeSearch
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.models import BayesianNetwork
  from pgmpy.sampling import BayesianModelSampling
  from pgmpy.utils import get_example_model
label_desc: Use image node_id 5 for calling the TestTreeSearch obj's underlying member method code with example usage: obj.test_estimate_tan_auto_class_node() without return types