Skip to Content
Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
book

Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

by Jake VanderPlas, 菊池 彰
May 2018
Intermediate to advanced
556 pages
13h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
498
5
章 機械学習
cv=LeaveOneOut())
grid.fit(x[:, None]);
こうしてスコアを最大にするバンド幅を見つけることができます(この場合、対数尤度がデフォ
ルトになります)。
In[12]: grid.best_params_
Out[12]: {'bandwidth': 1.1233240329780276}
最適なバンド幅は、
1.0
(すなわち、
scipy.stats.norm
のデフォルト値)であり、以前プロットし
た例に非常に近いものでした。
5.13.3
 事例:球面上の
KDE
おそらく
KDE
の最も一般的な使い方は、点の分布を図式的に表現することです。例えば、
Seaborn
ライブラリ(「4.16 Seabornによる可視化」で取り上げました)には
KDE
が組み込まれ、
1
次元や
2
次元のポイントを可視化するのに役立ちます。
ここ
では、分布を可視化するために
KDE
を少し洗練された形で使用します。
2
種類の南米哺乳類、
ノドチャナマケモノ(
Bradypus variegatus
)とコメネズミ(
Microryzomys minutus
)の記録された観
察の地理的分布を使用します。
scikit-learn
では、次のようにしてデータを取得できます。
In[13]: from sklearn.datasets import fetch_species_distributions
data = fetch_species_distributions()
# Get matrices/arrays ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Jake VanderPlas, 菊池 彰
初めてのGraphQL ―Webサービスを作って学ぶ新世代API

初めてのGraphQL ―Webサービスを作って学ぶ新世代API

Eve Porcello, Alex Banks, 尾崎 沙耶, あんどうやすし

Publisher Resources

ISBN: 9784873118413Other