Class ArrowConfusion

java.lang.Object
edu.cmu.tetrad.algcomparison.statistic.utils.ArrowConfusion

public class ArrowConfusion extends Object
A confusion matrix for arrows--i.e. TP, FP, TN, FN for counts of arrow endpoints. A true positive arrow is counted for X*->Y in the estimated graph if X is not adjacent to Y or X--Y or X<--Y.
Author:
josephramsey, rubens (November, 2016)
  • Constructor Details

    • ArrowConfusion

      public ArrowConfusion(Graph truth, Graph est)
      Constructs a new ArrowConfusion object.
      Parameters:
      truth - the true graph
      est - the estimated graph
    • ArrowConfusion

      public ArrowConfusion(Graph truth, Graph est, boolean truthAdj)
      Constructs a new ArrowConfusion object.
      Parameters:
      truth - the true graph
      est - the estimated graph
      truthAdj - if true, use the true graph to determine adjacency for arrowhead FP's
  • Method Details

    • getTp

      public int getTp()
      True positives.
      Returns:
      the number of true positives
    • getFp

      public int getFp()
      False positives.
      Returns:
      the number of false positives
    • getFn

      public int getFn()
      False negatives.
      Returns:
      the number of false negatives
    • getTn

      public int getTn()
      True negatives.
      Returns:
      the number of true negatives
    • getTwoCycleTp

      public int getTwoCycleTp()
      Two positives for two-cycles.
      Returns:
      the number of true positives for two-cycles.
    • getTwoCycleFp

      public int getTwoCycleFp()
      False positives for two-cycles.
      Returns:
      the number of false positives for two-cycles.
    • getTwoCycleFn

      public int getTwoCycleFn()
      False negatives for two-cycles.
      Returns:
      the number of false negatives for two-cycles.
    • getTpc

      public int getTpc()
      True positives for common edges.
      Returns:
      the number of true positives for common edges
    • getFpc

      public int getFpc()
      False positives for common edges.
      Returns:
      the number of false positives for common edges
    • getFnc

      public int getFnc()
      False negatives for common edges.
      Returns:
      the number of false negatives for common edges
    • getTnc

      public int getTnc()
      True Negatives for common edges.
      Returns:
      the number of true negatives for common edges
    • isTruthAdj

      public boolean isTruthAdj()
      Returns true if the truth graph is used to determine adjacency for arrowhead FP's.
      Returns:
      true if the truth graph is used to determine adjacency for arrowhead FP's