def plot_gendata():
"""Plot artificial data with n_confounders=[0, 1, 6, 12].
This program is used to check artificial data.
"""
n_samples = 200
rng = np.random.RandomState(0)
plt.figure(figsize=(10, 10))
gs = gridspec.GridSpec(2, 2)
# ---- Loop over the number of confonders ----
for i, n_confounders in enumerate([0, 1, 6, 12]):
# ---- Generate samples ----
xs = gendata_latents(n_confounders, n_samples, rng)
# ---- Plot samples ----
ax = plt.subplot(gs[i])
ax.scatter(xs[:, 0], xs[:, 1])
ax.set_xlim(-10, 10)
ax.set_ylim(-10, 10)
ax.set_title('n_confounders=%d' % n_confounders)
return
评论列表
文章目录