andrey.data.sample_scm#
- andrey.data.sample_scm(*, graph='erdos_renyi', functional='linear', noise='gaussian', d, n, seed, density=4.0, scale='standardize', latents=0, dtype=<class 'numpy.float64'>, shuffle=True)[source]#
One-shot convenience: build an
SCMfrom string axes and sample it.- Parameters:
graph (
str) – Axis selectors; seegraphs/functional/noisefor the available names.functional (
str) – Axis selectors; seegraphs/functional/noisefor the available names.noise (
str) – Axis selectors; seegraphs/functional/noisefor the available names.d (
int) – Node count and sample count.n (
int) – Node count and sample count.seed (
int) – Root seed.density (
float) – Mean total degree (2 * |E| / d), for everygraph. Each builder rounds it to the nearest value it can draw.scale (
str) – How the generated values are scaled; forwarded toSCM.sample(), which describes each mode."standardize"z-scores the columns;"unitless"(linear functional, at most 1,000 nodes) gives every node variance 1 by its draw of weights and noise scales, with R^2-sortability near 0.5;"rescale"divides each node by its sample standard deviation as it is generated;"raw"keeps the generated values. Temporal functionals take"standardize"and"raw".latents (
int) – How many of thednodes to hide as latent confounders, chosen among nodes with at least two children:datadrops them, and the true graph lists them last. Temporal functionals take only0.dtype (
DTypeLike) – Output dtype of the sampleddata; forwarded toSCM.sample().shuffle (
bool) – Shuffle the column order with the true graph; forwarded toSCM.sample().
- Return type:
CausalDataset