superstats.simulation.augmentation.missing#
Abstract base class for missing-data augmentation processes.
Classes
Introduces missingness into simulated data. |
- class superstats.simulation.augmentation.missing.MissingProcess[source]#
Bases:
ABCIntroduces missingness into simulated data.
Contract:
(data, rng) -> filled | {"missing_mask": mask}, wheredatais a mapping of named arrays with shape(batch_size, num_steps).maskis a boolean array of shape(batch_size, num_steps)(True = missing), and the returned data keys contain the masked entries set to the process’smissing_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:
- data
mappingofnp.ndarray Simulated data to corrupt with missingness.
- rng
np.random.GeneratororNone,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.
- data
- Returns:
- result
flatdictwithdatakeys, “missing_mask”,andoptionalmetadata
- result
- Parameters:
- Return type: