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を使ったデータ分析、機械学習
5.7
 詳細:サポートベクターマシン
409
いくつか例を示しましょう( 5-54)。
In[3]: xfit = np.linspace(-1, 3.5)
plt.scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='autumn')
plt.plot([0.6], [2.1], 'x', color='red', markeredgewidth=2, markersize=10)
for m, b in [(1, 0.65), (0.5, 1.6), (-0.2, 2.9)]:
plt.plot(xfit, m * xfit + b, '-k')
plt.xlim(-1, 3.5);
図5-54 3つの線形識別分類
これらはデータを完全に分割する
3
つのまったく異なる分割線です。どの線を選択するかにより、
新しいデータポイント( 5-54の「
X
」でマークされたポイント)に対して別のラベルが割り当てら
れます。「クラスの間に線を引く」という単純かつ直感的な考え方は十分ではなく、もう少し深い
考察が必要です。
5.7.2
 サポートベクターマシン:マージンの最大化
サポートベクターマシンはこうした状況を改善する
1
つの方法を示します。直感的に理解するな
ら、単純にクラスの間に幅がゼロの線を描画するのではなく、ある幅のマージンを線の周囲に最も
近い点まで描画することを考えます。例で示しましょう( 5-55)。
In[4]:
xfit = np.linspace(-1, 3.5) ...
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