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を使ったデータ分析、機械学習
492
5
章 機械学習
In[1]: %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import numpy as np
5.13.1
KDE
の必要性:ヒストグラム
既に説明したように、密度推定器はデータセットを生成した確率分布をモデル化するアルゴリズ
ムです。
1
次元データの場合、ヒストグラムという単純な密度推定器については熟知しているはず
です。ヒストグラムは、データを個別のビンに分割し、各ビンに含まれるポイントの数を数え、直
感的な方法で結果を可視化します。
例えば、
2
つの正規分布から得られるデータを作成しましょう。
In[2]: def make_data(N, f=0.3, rseed=1):
rand = np.random.RandomSt
ate(rseed)
x = rand.randn(N)
x[int(f * N):] += 5
return x
x = make_data(1000)
標準的な個数ベースのヒストグラムは、
plt.hist()
関数を使って作成します。
normed
パラメー
タを指定することで、ビンの高さが個数を反映するのではなく、確率密度を反映する正規化ヒスト
グラムになります( 5-140)。
In[3]: hist = plt.hist(x, bins=30, normed=True)
図5-140 正規分布の組み合わせから得られたデータ
5.13 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

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

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

Jake VanderPlas, 菊池 彰
リーンエンタープライズ ―イノベーションを実現する創発的な組織づくり

リーンエンタープライズ ―イノベーションを実現する創発的な組織づくり

Jez Humble, Joanne Molesky, Barry O'Reilly, 角 征典, 笹井 崇司, Eric Ries

Publisher Resources

ISBN: 9784873118413Other