t0mst0ne / OPD_waiting

Calculate and estimate the waiting time of OPD
0 stars 2 forks source link

用 kde fit 來看 distribution , krr 來做regression #4

Open t0mst0ne opened 7 years ago

t0mst0ne commented 7 years ago

如果只有 報到時間 和等待時間 2個欄位 做出來的圖

PM distribution AM distribution

看看能不能用 kde fit , krr 做 regression

http://scikit-learn.org/stable/auto_examples/plot_kernel_ridge_regression.html

t0mst0ne commented 7 years ago

from sklearn.neighbors.kde import KernelDensity X = np.array(PM) kde = KernelDensity(kernel='gaussian', bandwidth=0.2).fit(X) kde.score_samples(X)

pd.DataFrame( kde.sample(100)) .plot.scatter(0,1)