class_docstr: Test behaviour of the roc_auc_states metric
docstr: TPR should always be better than FPR for accurate predictions
docstr_tok: ["TPR","should","always","be","better","than","FPR","for","accurate","predictions"]
code: def test_roc_of_accurate_predictions(self):
      """TPR should always be better than FPR for accurate predictions"""
  
      # equal class (c) weighting to guarantee high ROC expected
      train = pd.DataFrame(
          [
              [a, b, 0]
              for a in range(0, 2)
              for b in range(0, 2)
              for _ in range(10)
          ]
          + [
              [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(10)
          ],
          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)
  
      roc, _ = roc_auc(bn, train, "c")
      assert all(tpr > fpr for fpr, tpr in roc if tpr not in [0.0, 1.0])
  
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 5 for calling the TestROCAUCStates obj's underlying member method code with example usage: obj.test_roc_of_accurate_predictions() without return types