MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_01D0291F.546B2F60" このドキュメントは単一ファイル Web ページ (Web アーカイブ ファイル) です。お使いのブラウザー、またはエディターは Web アーカイブ ファイルをサポートしていません。Windows? Internet Explorer? など、Web アーカイブをサポートするブラウザーをダウンロードしてください。 ------=_NextPart_01D0291F.546B2F60 Content-Location: file:///C:/26838E50/db10.htm Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="shift_jis"
データベース特論資料 10 (Advanced Database Exercise=
10)
2014年12月22日
概要 Abstract
今日の授業では、データの分類に関する演習を行う.今日も
ZODB を使う.
Tod=
ay's
class is exercise on data classification using an object-oriented database
management system 'ZODB'.
■ SVM kernel
■
Nearest Neighbor
■
Random Forests
演習 10 (Exercises 10)
出典:htt=
p://archive.ics.uci.edu/ml/datasets/Pen-Based+Recognition+of+Handwritten+Di=
gits
=3D=3D=3D
E. Alpaydin, Fevzi. Alimoglu
Department of Computer Engineering =
;
Bogazici University, 80815 Istanbul Turkey
alpaydin '@' boun.edu.tr
■ <=
/span>ステップ1
(Step 1)
課題:以下の手順で Spyderの設定を行いなさい =
(Setup the Spyder software)
1.&n=
bsp;
Spyder の起動
(execute the Spyder)
&=
nbsp; &nbs=
p; &=
nbsp; &nbs=
p;
2.&n=
bsp;
Interpreters で =
span>「Open an IPython Console<=
/b>」を選ぶ. (Select Interpreters, and Select =
gOpen
an IPython console”)
3.&n=
bsp;
「IPy=
thon
console」をクリック. (Click “IPython console”)
■ <=
/span>ステップ2
(Step 2)
課題:以下の手順で ZODB データベースに接続し=
, 散布図の作成まで行いなさい=
u> (Connect to a ZODB=
database,
and generate a scatter plot)
◆
今日の授業では、ZOD=
B データベースファイル名は =
span>hoge9.fs
(The
ZODB database file name in the previous class was 'hoge9.fs'.
Let us use it again here)
1. IPython コンソールで、ZODBデータベースに接続し、変数= b>root にZOD= Bのルートオ= uジェクトを格納
(connect to a ZODB database using I=
Python
console, and store the root object into the variable named root)
2. データベース内のデータからの散布図の作成の練習 Exercises o= n displaying a scatter plot using datab= ase
データフレームの x 列と y =
列=
u>を、新し=
いデータフレーム X に格納する.データフレームの c 列を新しい=
変数 Y に格納する(データフレームから
= p>
■ <=
/span>ステップ3
(Step 3)
SVM
を=
pいて分類する. SVM の詳細はこの授業では触れない。 =
Do
classification using SVM
1.
準=
2.
分=
゙する Do classify using three
different algorithms
<=
span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;font-family:"Courier New"'>=
<=
span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;font-family:"Courier New"'>=
■ <=
/span>ステップ4
(Step 4)
最近傍を用いて分類する. Nearest Neighbot Classificat=
ion
1.
準=
2.
最=
煖゚い1点による分類
Classifiation using the nearest point
2. 最も近い2点による分類
Classifiation using the 2-nearest points
3. 最も近い3点による分類
Classifiation using the 3-nearest points
■ <=
/span>ステップ5
(Step 5)
Random
Forestsを=
pいて分類する. Random Forest Classification=
classifier7.feature_importances_
■ ステップ6 (Step 6)
教師なしで分類する.
1.
使=
pするデータのプロット Plot the source data
2.
準=
3.
教師なしで分類する。k-means アルゴリズムを用いる Classification without learning. U=
se
k-means algorithm
3.
教師なしで分類する。今度は Gaussian Mixture Model<=
/b>(混合ガウスモデル)を用いる=
Classification without learning. U=
se GMM.
4. モデルを示す7つの図を作る
plt.pcolor(xx,
yy, Z[1][:,0].reshape(xx.shape))
plt.pcolor(xx,
yy, Z[1][:,1].reshape(xx.shape))
plt.pcolor(xx,
yy, Z[1][:,2].reshape(xx.shape))
plt.pcolor(xx,
yy, Z[1][:,3].reshape(xx.shape))
plt.pcolor(xx,
yy, Z[1][:,4].reshape(xx.shape))
plt.pcolor(xx,
yy, Z[1][:,5].reshape(xx.shape))
plt.pcolor(xx,
yy, Z[1][:,6].reshape(xx.shape))
<=
img
width=3D796 height=3D1013 src=3D"db10.files/image075.png" v:shapes=3D"図_x=
0020_72 図_x0020_73 図_x0020_74 図_x0020_75 図_x0020_76 図_x0020_77 図_x002=
0_79">
演習シート 10 (Exercises S=
heet
10) 2014/12/22
氏名 専攻 = 学生番号
Name = &nb= sp; Department &= nbsp; &nbs= p; Student number =
記入して提出しなさい Fill out and submit
Q1<= span style=3D'mso-spacerun:yes'> ステップ1は終わった= ゥ 終わっていないか? Did you finish = the step 1 ?
□ はい Yes = □ いいえ No
Q2<= span style=3D'mso-spacerun:yes'> ステップ2は終わった= ゥ 終わっていないか? Did you finish = the step 2 ?
□ はい Yes = □ いいえ No
Q3<= span style=3D'mso-spacerun:yes'> ステップ3は終わった= ゥ 終わっていないか? Did you finish = the step 3 ?
□ はい Yes = □ いいえ No
Q4<= span style=3D'mso-spacerun:yes'> ステップ4は終わった= ゥ 終わっていないか? Did you finish = the step 4 ?
□ はい Yes = □ いいえ No
Q5<= span style=3D'mso-spacerun:yes'> ステップ5は終わった= ゥ 終わっていないか? Did you finish = the step 5 ?
□ はい Yes = □ いいえ No