class_docstr: Test behaviour of the roc_auc_states metric
docstr: Should be possible to compute auc for state with no parent nodes
docstr_tok: ["Should","be","possible","to","compute","auc","for","state","with","no","parent","nodes"]
code: def test_auc_node_with_no_parents(self):
      """Should be possible to compute auc for state with no parent nodes"""
  
      train = pd.DataFrame(
          [
              [a, b, 0]
              for a in range(0, 2)
              for b in range(0, 2)
              for _ in range(1)
          ]
          + [
              [a, b, 1]
              for a in range(0, 2)
              for b in range(0, 2)
              for _ in range(a * 10 + b * 10 + 1000)
          ]
          + [
              [a, b, 0]
              for a in range(2, 4)
              for b in range(2, 4)
              for _ in range(a * 10 + b * 10 + 1000)
          ]
          + [
              [a, b, 1]
              for a in range(2, 4)
              for b in range(2, 4)
              for _ in range(1)
          ],
          columns=["a", "b", "c"],
      )
  
      cg = StructureModel()
      cg.add_weighted_edges_from([("a", "c", 1), ("b", "c", 1)])
  
      bn = BayesianNetwork(cg)
      bn.fit_node_states(train)
      bn.fit_cpds(train)
  
      _, auc = roc_auc(bn, train, "a")
      assert math.isclose(auc, 0.5, abs_tol=0.01)
  
imports: import math
  import random
  import numpy
  import pandas
  from causalnex.evaluation import classification_report, roc_auc
  from causalnex.network import BayesianNetwork
  from causalnex.structure.notears import from_pandas
  from causalnex.structure.structuremodel import StructureModel
label_desc: Use image node_id 8 for calling the TestROCAUCStates obj's underlying member method code with example usage: obj.test_auc_node_with_no_parents() without return types