plot.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:bmlingam 作者: taku-y 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号