D6 - CDF 和 ECDF 的差別
2019/05/18 01:54 上午
機器學習共學討論版
Yen Ming
觀看數:10
回答數:2
收藏數:0
m100-2
m100-2-d06
請問 CDF 和 ECDF 的差別,以及他們兩個所代表的意義 ?
另外,發現有兩種畫法,圖形類似差在平滑程度,這兩張圖片代表 CDF 和 ECDF 嗎 ?
# CDF vs ECDF
plt.figure(figsize=(16, 6))
cdf = np.cumsum(app_train['REGION_POPULATION_RELATIVE'].value_counts().sort_index())
x, y = list(cdf.index), cdf / cdf.max()
plt.subplot(1, 2, 1)
plt.plot(x, y)
plt.title('CDF')
x = np.sort(app_train['REGION_POPULATION_RELATIVE'])
y = np.arange(1, len(x)+1) / len(x)
plt.subplot(1, 2, 2)
plt.plot(x, y)
plt.title('ECDF')
plt.show()