首页 > 解决方案 > 大型数据集的置信区间

问题描述

我想获得非常大的数据集的置信区间。它由 x 和 y 的大约 700,000 个点组成。我还尝试使用更少的数据,例如 200 个点,这样就可以进行绘图。但是,当涉及到我的特定数据集时,它没有显示置信区间。

为此,我的代码基于:

x_x = np.array(y_test[:, 0]) #about 700,000 points
y_y = np.array(y_pred[:, 0]) #about 700,000 points

sns.set(style = 'whitegrid')

p = sns.FacetGrid(d, size = 4, aspect = 1.5) 
p.map(plt.scatter, 'x_x', 'y_y', color = 'red')
p.map(sns.regplot, 'x_x', 'y_y', scatter = False, ci = 95, 
    fit_reg = True, color = 'blue') 
p.map(sns.regplot, 'x_x', 'y_y', scatter = False, ci = 0, 
    fit_reg = True, color = 'darkgreen')

以及到目前为止的图:

标签: matplotlibstatisticsregressionseabornconfidence-interval

解决方案


推荐阅读