Class CVReport

java.lang.Object
edu.cmu.tetrad.sem.CVReport
All Implemented Interfaces:
TetradSerializable, Serializable

public final class CVReport extends Object implements TetradSerializable
Result of k-fold cross-validation performed by NNEstimator#crossValidate(int).

Contains:

  • Per-node OOS metrics in nodeSummaries — one entry per non-root node, giving OOS MSE / R² (continuous) or OOS cross-entropy (discrete).
  • A whole-graph OOS MMD² score averaged across folds, measuring how well the simulator trained on k-1 folds reproduces the joint distribution of the held-out fold.
  • Summary statistics: mean OOS R² across continuous non-root nodes, mean OOS cross-entropy improvement across discrete non-root nodes, and the fraction of non-root nodes that beat their baseline out of sample.

Node summaries for root nodes are omitted — roots have no parents and therefore no conditional prediction to evaluate.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    Fraction of non-root nodes whose OOS metric beats their respective baseline (R² > 0 for continuous; xent improvement > 0 for discrete).
    final double
    Mean OOS MMD² across folds.
    final double
    Mean OOS R² across continuous non-root nodes.
    final double
    Mean OOS cross-entropy improvement (baseline − model) across discrete non-root nodes.
    Per-node OOS summaries, one per non-root node.
    final int
    Number of folds used.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CVReport(int numFolds, List<NodeCVSummary> nodeSummaries, double meanOosMmd2)
    Constructs an immutable cross-validation report, summarizing the results of k-fold cross-validation across multiple nodes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates a single-line summary of the cross-validation (CV) results for the current instance, including details such as the number of CV folds, mean out-of-sample squared maximum mean discrepancy (MMD²), mean out-of-sample R², and the count of nodes that improved over the baseline.
     
    Returns a human-readable multi-line summary of the CV results.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • numFolds

      public final int numFolds
      Number of folds used.
    • nodeSummaries

      public final List<NodeCVSummary> nodeSummaries
      Per-node OOS summaries, one per non-root node. Root nodes are excluded since they have no conditional mechanism to evaluate.
    • meanOosMmd2

      public final double meanOosMmd2
      Mean OOS MMD² across folds. Each fold contributes one MMD² value computed between the observed held-out rows and data simulated by the model trained on the remaining folds.
    • meanOosR2

      public final double meanOosR2
      Mean OOS R² across continuous non-root nodes. Positive means the NN beats the marginal-mean baseline on average. NaN if there are no continuous non-root nodes.
    • meanOosXentImprovement

      public final double meanOosXentImprovement
      Mean OOS cross-entropy improvement (baseline − model) across discrete non-root nodes. Positive means the NN beats the marginal-frequency baseline on average. NaN if there are no discrete non-root nodes.
    • fracNodesBeatBaseline

      public final double fracNodesBeatBaseline
      Fraction of non-root nodes whose OOS metric beats their respective baseline (R² > 0 for continuous; xent improvement > 0 for discrete). NaN if there are no non-root nodes.
  • Constructor Details

    • CVReport

      public CVReport(int numFolds, List<NodeCVSummary> nodeSummaries, double meanOosMmd2)
      Constructs an immutable cross-validation report, summarizing the results of k-fold cross-validation across multiple nodes.
      Parameters:
      numFolds - The number of folds used in the cross-validation.
      nodeSummaries - A list of per-node cross-validation summaries, where each node is represented as a NodeCVSummary.
      meanOosMmd2 - The mean out-of-sample squared maximum mean discrepancy (OOS MMD²) across all nodes.
  • Method Details

    • toText

      public String toText()
      Returns a human-readable multi-line summary of the CV results.
      Returns:
      a human-readable multi-line summary of the CV results
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStatusLine

      public String toStatusLine()
      Generates a single-line summary of the cross-validation (CV) results for the current instance, including details such as the number of CV folds, mean out-of-sample squared maximum mean discrepancy (MMD²), mean out-of-sample R², and the count of nodes that improved over the baseline.
      Returns:
      A formatted string summarizing the CV results, including the number of folds, mean OOS MMD², mean R², and the proportion of nodes that beat the baseline.