logo
Loading...

[HW6] 繪製ecdf - Cupoy

# 繪製 Empirical Cumulative Density Plot (ECDF) """ ...

ml100-2,ecdf,ml100-2-d06

[HW6] 繪製ecdf

2019/05/02 11:10 PM
機器學習新手論壇
吳孟和
觀看數:0
回答數:1
收藏數:0
ml100-2
ecdf
ml100-2-d06

# 繪製 Empirical Cumulative Density Plot (ECDF) """ YOUR CODE HERE """  data = app_train['AMT_INCOME_TOTAL'] num_bins = 50  # Use the histogram function to bin the data counts, bin_edges = np.histogram(data, bins=num_bins, normed=True)  # Now find the cdf cdf = np.cumsum(counts)  #plot plt.plot(list(cdf.index), cdf/cdf.max())


如上之取得cdf的方式是否有誤,因在要畫圖時,顯示"'numpy.ndarray' object has no attribute 'index'",應該是變數格式有錯誤?再麻煩解答,感恩!