Final weka

Post on 16-Aug-2015

151 views 0 download

Transcript of Final weka

WekaWaikato Environment for Knowledge Analysis

Tidarat Srikoedkruen54102011129

Classifyการทำ�าเหมืองข้ อมื�ลด้ วยเทำคนิ�คการจำ�าแนิกข้ อมื�ล

เตร�ยมืไฟล�excel --> .csv

1. แบ่�งข้�อมูลเป็ น 2 ชุ�ด• recript_for_train สํ�าหรั�บ่ Train จำ�านวน 40 Record• recript_for_deploy สํ�าหรั�บ่ทํ�านาย จำ�านวน 18 Record 2. เป็�ดไฟล� recript• ลบ่ชุ�องว�างออกทํ�!งหมูด• Copy ข้�อมูลจำ�านวน 40 แถว• Save เป็ นไฟล� recript_for_train.csv3. เป็�ดไฟล� recript• ลบ่ชุ�องว�างออกทํ�!งหมูด• Copy ข้�อมูลทํ#$เหล%อจำ�านวน 18 แถว และลบ่ เรัคอดทํ#$จำะใชุ�ทํ�านายออก• Save เป็ นไฟล� recript_for_deploy.csv

* ไฟล�ทํ#$ใชุ� Train และ Depoy จำะต้�องมู#ห�วต้างรัาง

recript_for_train recript_for_depoy

เตร�ยมืไฟล�.csv --> .arff

เปิ�ด้โปิรแกรมื Weka

1. เล%อก Explorer

1. เป็�ดไฟล� .csv

2. Instance = 40Attributes = 79

4.อ�ลกอรั+ทํ,มูเล%อกเป็ นอะไรัก-ได�

5.เล%อก Use Training Set

6. เล%อก Start

3. เล%อก Classity

7. เล%อก Visualize Classifire errors

8. ทํ�าการั Save จำะได�ไฟล� .arff

*File recript_for_depoy ทํ�าเชุ�นเด#ยวก�น

• Open file “recript_for_train.arff”• ลบ่บ่รัรัทํ�ด @attribute predicted ออกทํ�!งหมูด• “เป็�ดไฟล� recript_for_train.csv” • Copy ข้�อมูลทํ#$เป็ น data มูาใสํ�ในใต้� @data ทํ�บ่ข้องเก�าทํ#$ไฟล�

“recript_for_train.arff”

• Save “recript_for_train.arff”

*ทํ�าเชุ�นเด#ยวก�นก�บ่ไฟล� recript_for_depoy.arff

Classify

1. เป็�ดไฟล� recript_for_train.arff

2. Instance = 40Attributes = 79

4.อ�ลกอรั+ทํ,มูเล%อกเป็ นอะไรัก-ได�

5.เล%อก Use Training Set

6. เล%อก Start

3. เล%อก Classity

3. เล%อก Classify

4. เล%อกเป็ น MultilayerPerceptron

5. ก�าหนด GUI เป็ น True

6. กด Start

7. กด Start รัอจำนรั�นเสํรั-จำและกด Accept

8. ทํ�าการั Save Model

9. ทํ�าการั Load Model ทํ#$ได� Save ไว�ในข้�อก�อนหน�า

10. เล%อก Re-evaluate model on current test set

11. เล%อก Visualize classifier errors

12. Save

13. เล%อก ArffViewer

14. เป็�ดไฟล�ทํ#$เรัาทํ�าการัSaveไว�ในข้�อ 13

Clusterการทำ�าเหมืองข้ อมื�ลด้ วยเทำคนิ�คการจำ ด้กล!"มื

1. เป็�ดไฟล�ทํ#$ต้�องการัจำะClustering .artt

2. Instance =58Attributes = 9

3. เล%อกแทํ-บ่ Cluster

4. เล%อกอ�ลกอรั+ทํ,มูเป็ น SimpleKMean

5. ก�าหนด Numcluster

6. กด Startและวนทํ�า ข้�อ 5 และ 6 จำนได�Numcluster = 25

7. น�าค�า Squared error มูา plot กรัาฟ

NumCluster

Squared Errors

2 1473 1314 1265 1236 1197 1078 1049 100

10 9811 9612 9213 89

NumCluster

Squared Errors

14 8815 8616 8417 8218 8119 7820 7621 7522 7423 7024 6725 64

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 240

20

40

60

80

100

120

140

160

Knee Curve = 22

สํามูารัถแบ่�งกล��มูได�ทํ�!งหมูด 22 กล��มู เน%$องจำากค�าSquared error ในชุ�วง NumCluster 22 มู#ล�กษณะล�ลงเป็ นรัป็ทํรัง

ข้อง Knee Curve

Associateการทำ�าเหมืองข้ อมื�ลด้ วยเทำคนิ�คการว�เคราะห�

ความืสั มืพั นิธ์�

1. เป็�ดไฟล�ทํ#$ต้�องการัจำะ Association

2. Attribute = 26Instances = 58

3. เล%อกแทํป็ Associate

4. ก�าหนดอ�ลกอรั+ทํ,มูเป็ น Apriori

5. กด Start

ผลล�พธ์�

• Minimum support: 0.95 (55 instances)• Minimum metric <confidence>: 0.9

• Best rules :Association Rule Confidence

SaltedPeanutsKohkae-->UHTFreshMilkForemost2000ml 1.00

UHTFreshMilkForemost2000ml-->SaltedPeanutsKohkae 1.00

CheeseCornae-->UHTFreshMilkForemost2000ml 1.00

UHTFreshMilkForemost2000ml-->CheeseCornae 1.00

CheeseCornae-->SaltedPeanutsKohkae 1.00

SaltedPeanutsKohkae-->CheeseCornae 1.00

BigCola1500ml-->ChickenFrankfurtFeetLong 1.00

ChickenFrankfurtFeetLong-->BigCola1500ml 1.00

CroissantSandwichHamAndCheese-->ChickenFrankfurtFeetLong 1.00

ChickenFrankfurtFeetLong-->CroissantSandwichHamAndCheese 1.00