tag:crieit.net,2005:https://crieit.net/tags/95%E3%83%91%E3%83%BC%E3%82%BB%E3%83%B3%E3%82%BF%E3%82%A4%E3%83%AB/feed
「95パーセンタイル」の記事 - Crieit
Crieitでタグ「95パーセンタイル」に投稿された最近の記事
2021-01-25T03:06:35+09:00
https://crieit.net/tags/95%E3%83%91%E3%83%BC%E3%82%BB%E3%83%B3%E3%82%BF%E3%82%A4%E3%83%AB/feed
tag:crieit.net,2005:PublicArticle/16648
2021-01-25T03:06:35+09:00
2021-01-25T03:06:35+09:00
https://crieit.net/posts/Python-95
Pythonで95パーセンタイル区間を色塗り
<h1 id="95パーセンタイル(95 percentile)を色塗り"><a href="#95%E3%83%91%E3%83%BC%E3%82%BB%E3%83%B3%E3%82%BF%E3%82%A4%E3%83%AB%2895+percentile%29%E3%82%92%E8%89%B2%E5%A1%97%E3%82%8A">95パーセンタイル(95 percentile)を色塗り</a></h1>
<pre><code class="python">up=np.zeros(141) #塗りつぶす範囲の上縁
down=np.zeros(141) #塗りつぶす範囲の下縁
for i in range(141):
b=loss_all[((parameters[:,0]-i/10-0.5)*(parameters[:,0]-i/10-1) <= 0)]
up[i]=np.percentile(b,q=[2.5,97.5])[1]
down[i]=np.percentile(b,q=[2.5,97.5])[0]
plt.figure(figsize=(6, 6), dpi=150)
plt.tick_params(labelsize=15)
plt.scatter(parameters[:,0],loss_all,s=10, alpha=0.3)
plt.fill_between(np.arange(141)/10+0.5,up,down,color='red',alpha=0.4)
plt.xlabel('Hs1[m]')
plt.ylabel('Test absolute error of sea state parameters')
#plt.ylim(-2,2)
plt.grid()
plt.show()
</code></pre>
<p><a href="https://crieit.now.sh/upload_images/c45e68ad33678bfa3b123e2fc7345bd3600db6b05015d.png" target="_blank" rel="nofollow noopener"><img src="https://crieit.now.sh/upload_images/c45e68ad33678bfa3b123e2fc7345bd3600db6b05015d.png?mw=700" alt="image" /></a></p>
kawai_mizugorou