Inference
neureptrace.inference
sign_flip_time_inference(csv_paths, *, metric='accuracy', chance=0.5, n_permutations=10000, random_state=13, cluster_alpha=0.05, decoder=None, emission_mode=None, observation_csv_paths=None, observation_subject_column=None, ece_bins=DEFAULT_ECE_BINS, metric_direction='auto')
Run one-sided subject-level sign-flip inference over time.
The test uses fold-size-weighted subject time courses as independent
samples. Pointwise p-values test whether the metric is better than the
reference value chance. Higher-is-better metrics use metric - chance;
lower-is-better metrics use chance - metric. Cluster p-values use a
max-cluster-mass correction over contiguous positive-effect time points.
Source code in src/neureptrace/inference.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
subject_time_effects(csv_paths, *, metric='accuracy', chance=0.5, decoder=None, emission_mode=None, observation_csv_paths=None, observation_subject_column=None, ece_bins=DEFAULT_ECE_BINS, metric_direction='auto')
Return a subject-by-time matrix of signed effects against a reference value.
The sign is chosen so positive values mean better than the reference: higher-is-better metrics use metric minus reference, while lower-is-better metrics use reference minus metric. ECE inference uses pooled held-out probability observations. Pass observation_csv_paths when metric='ece'; fold-averaged ECE is not used for inferential tests.
Source code in src/neureptrace/inference.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | |