andrey.data.missingness.Missingness#
- class andrey.data.missingness.Missingness(*, mask, parents, mechanism, form, rate)[source]#
The missing values drawn over a dataset, with the parents of each missingness indicator.
The missingness indicator
R_iof columniis 1 where its value is missing. The m-graph adds every indicator to the causal graph, with an edge into it from each of its parents (Mohan, Pearl, and Tian 2013);andrey.data.missingnessdraws them.- Parameters:
mask (
ndarray) –Truewhere a value is missing; the data holdNaNthere.parents (
dict[int,list[int]]) – Each column that can go missing, mapped to the columns its indicator depends on, in ascending order:[]under"mcar", always-observed columns under"mar", other columns that can go missing under"mnar", and[i]for columniunder"self_masking". A column it does not list is always observed.mechanism (
str) –"mcar","mar","mnar", or"self_masking".form (
str|None) – How an indicator depends on its parents,"logistic"or"quantile";Noneunder"mcar".rate (
float) – The expected share of missing values in each column that can go missing.
References
Mohan, K., Pearl, J., and Tian, J. (2013). Graphical models for inference with missing data. Advances in Neural Information Processing Systems 26.