Class CVReport
java.lang.Object
edu.cmu.tetrad.sem.CVReport
- All Implemented Interfaces:
TetradSerializable, Serializable
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
FieldsModifier and TypeFieldDescriptionfinal doubleFraction of non-root nodes whose OOS metric beats their respective baseline (R² > 0 for continuous; xent improvement > 0 for discrete).final doubleMean OOS MMD² across folds.final doubleMean OOS R² across continuous non-root nodes.final doubleMean OOS cross-entropy improvement (baseline − model) across discrete non-root nodes.final List<NodeCVSummary> Per-node OOS summaries, one per non-root node.final intNumber of folds used. -
Constructor Summary
ConstructorsConstructorDescriptionCVReport(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 TypeMethodDescriptionGenerates 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.toString()toText()Returns a human-readable multi-line summary of the CV results.
-
Field Details
-
numFolds
public final int numFoldsNumber of folds used. -
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 meanOosMmd2Mean 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 meanOosR2Mean 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 meanOosXentImprovementMean 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 fracNodesBeatBaselineFraction 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
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 aNodeCVSummary.meanOosMmd2- The mean out-of-sample squared maximum mean discrepancy (OOS MMD²) across all nodes.
-
-
Method Details
-
toText
Returns a human-readable multi-line summary of the CV results.- Returns:
- a human-readable multi-line summary of the CV results
-
toString
-
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.
-