coco_pipe.diagnostics.streaming_variance#

Exact variance diagnostics over re-iterable feature batches.

Attributes#

Functions#

streamed_subject_probe(feature_batches, subject, *[, ...])

Fit a deterministic CPU PyTorch multinomial probe over streamed batches.

streamed_variance_decomposition_report(...[, ...])

Return the dense diagnostic schema without assembling a feature matrix.

Module Contents#

type coco_pipe.diagnostics.streaming_variance.FeatureBatch = tuple[np.ndarray, np.ndarray]#
type coco_pipe.diagnostics.streaming_variance.FeatureBatchSource = Iterable[FeatureBatch] | Callable[[], Iterable[FeatureBatch]]#
coco_pipe.diagnostics.streaming_variance.DEFAULT_PARTICIPATION_RATIO_MAX_GRAM_BYTES = 4294967296#
coco_pipe.diagnostics.streaming_variance.streamed_subject_probe(feature_batches, subject, *, cap=100, n_splits=5, seed=42, blocks=None, epochs=10, learning_rate=0.01, weight_decay=0.0001, _n_features=None, _validated=False)#

Fit a deterministic CPU PyTorch multinomial probe over streamed batches.

Parameters:
Return type:

tuple[float | None, int]

coco_pipe.diagnostics.streaming_variance.streamed_variance_decomposition_report(feature_batches, subject, label, *, feature_scaling='zscore', n_null_permutations=200, rng=None, probe_blocks=None, probe_cap=100, probe_n_splits=5, probe_seed=42, probe_epochs=10, probe_learning_rate=0.01, probe_weight_decay=0.0001, participation_ratio_max_gram_bytes=DEFAULT_PARTICIPATION_RATIO_MAX_GRAM_BYTES)#

Return the dense diagnostic schema without assembling a feature matrix.

feature_batches must be re-iterable (or a callable returning an iterable) and yield (row_indices, features) pairs. Row indices refer to the supplied subject/label vectors and must cover them exactly once per complete pass.

Parameters:
Return type:

pandas.DataFrame