synthetic¶
Synthetic data-generating processes for validation studies (spec 10.1).
All generators share an additive logistic base DGP with known shape functions; each study carves a controllable truth into it (density gap, missingness mechanism, pure-noise feature, interaction term).
SyntheticData
dataclass
¶
SyntheticData(
X: DataFrame,
y: ndarray,
eta: ndarray,
meta: Mapping[str, Any],
)
Generated design matrix, labels, true logit and DGP metadata.
make_additive ¶
make_additive(
n: int = 5000, *, seed: int = 0
) -> SyntheticData
Additive logistic base DGP with three known shape functions.
Source code in src/triadxai/synthetic.py
55 56 57 58 59 60 61 62 63 64 65 | |
make_density_gap ¶
make_density_gap(
n: int = 5000,
*,
gap: tuple[float, float] = (1.0, 2.5),
keep_frac: float = 0.02,
seed: int = 0
) -> SyntheticData
Base DGP with training mass carved out of a region of x0 (study 10.1.1).
Source code in src/triadxai/synthetic.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
make_interacting ¶
make_interacting(
n: int = 5000,
*,
gap: tuple[float, float] = (1.0, 2.5),
seed: int = 0
) -> SyntheticData
Non-additive DGP (x0*x1 interaction) with a density gap in x0.
Ground truth for the approximate-mode study: an unconstrained booster must model the interaction, and bag disagreement should concentrate the D channel inside the carved gap.
Source code in src/triadxai/synthetic.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
make_missingness ¶
make_missingness(
n: int = 5000,
*,
mechanism: str = "MNAR",
missing_rate: float = 0.3,
missing_effect: float = 1.0,
seed: int = 0
) -> SyntheticData
Base DGP with MCAR / MAR / MNAR missingness injected into x0 (study 10.1.2).
MNAR plants missing_effect on the logit of masked rows (informative
missingness); meta["eta_base"] retains the pre-effect logit so tests
can recover the planted effect exactly.
Source code in src/triadxai/synthetic.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
make_noise_feature ¶
make_noise_feature(
n: int = 5000, *, seed: int = 0
) -> SyntheticData
Base DGP plus a pure-noise feature with zero coefficient (study 10.1.3).
Source code in src/triadxai/synthetic.py
144 145 146 147 148 149 150 151 152 153 154 155 | |