superstats.simulation.augmentation.missing#

Abstract base class for missing-data augmentation processes.

Classes

MissingProcess()

Introduces missingness into simulated data.

class superstats.simulation.augmentation.missing.MissingProcess[source]#

Bases: ABC

Introduces missingness into simulated data.

Contract: (data, rng) -> filled | {"missing_mask": mask}, where data is a mapping of named arrays with shape (batch_size, num_steps). mask is a boolean array of shape (batch_size, num_steps) (True = missing), and the returned data keys contain the masked entries set to the process’s missing_value. Instances are callable, so a MissingProcess, a subclass, or a bare function with this signature are interchangeable.

abstract apply(data, rng=None)[source]#

Apply the missingness process.

Parameters:
datamapping of np.ndarray

Simulated data to corrupt with missingness.

rngnp.random.Generator or None, optional, default: None

Random generator to use. If None, a fresh, unseeded generator is created via _default_rng, so calling apply directly is safe but not reproducible unless a seeded rng is supplied.

Returns:
resultflat dict with data keys, “missing_mask”, and optional metadata
Parameters:
Return type:

dict