版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、WEKA數(shù)據(jù)分析實驗1. 實驗簡介借助工具 Weka 3.6,對數(shù)據(jù)樣本進行測試,分類測試方法包括:樸素貝葉斯、決策樹、 隨機數(shù)三類,聚類測試方法包括:DBScan K均值兩種;2. 數(shù)據(jù)樣本以熟悉數(shù)據(jù)分類的各類常用算法,以及了解Weka的使用方法為目的,本次試驗中,采用的數(shù)據(jù)樣本是 Weka軟件自帶的“ Vote”樣本,如圖:査看:T嘔C3E1. 士o齊開a Weka ExplorerPrepr®e#ts-filterAt tn buttsAll回0回回居諸rffCurrftt rilatiiMRilsti&h: Uc-nInst«!£*«
2、163;: H:-ryweather.no m inaLarff我的交栢計茸機交件宮:右班加打幵心wot*. ur££屐近便用的項s寶面門contast-lensw.arff cpu-srff 匚 pu.with.wndona rff diabettrarff g怙強聲廣桿 iorwpherB.arfF iris.arfflaboir,arff4 Reuler?Com-test.arffReutersCorn -train-a rff,ReutersGrain-testiarffI J ReutersGraintrain.arff4 segmerft-chal lenge.
3、arff 厶 tegmeiHrt-tEkEt-airffs soybean.arff3. 關聯(lián)規(guī)則分析1) 操作步驟:a) 點擊 “ Explorer ”按鈕,彈出“ Weka Explorer ”控制界面b) 選擇“ Associate”選項卡;c) 點擊“ Choose”按鈕,選擇“ Apriori ”規(guī)則d) 點擊參數(shù)文本框框,在參數(shù)選項卡設置參數(shù)如:Q weka.gui .GenericObject Editornk*Aprs eriAbvulClass implemenijng an Apriori-tjipe alonihm匚測訃ili ti««car dfll
4、tii le-w erBwnJNiiiSuffi srtFhAilricIypt rvi汕祖r冷 hutlAiiI ts uputlteAeU ren ovcJlILMi e s l 眶佇 ols EijEhi fL(iux«Lcv#l ufip詁M】£upp 口七F a1e«f us«D. ij5vtrbftttOpen.I1 C曲紅1Le) 點擊左側"Start”按鈕2) 執(zhí)行結果:=Run in formatio n =Scheme: Relatio n: In sta nces: Attributes:weka.associations
5、.Apriori -I -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.5 -S -1.0 -c -1 vote43517han dicapped-i nfantswater-project-cost-shari ngadopti on-o f-the-budget-resoluti onphysicia n-fee-freezeel-salvador-aidreligious-groups-i n-schoolsan ti-satellite-test-ba naid-to-ni caragua n-con trasmx-missileimmigrati onsy
6、n fuels-corporati on-cutbackeducati on-spe ndingsuperfu nd-right-to-suecrimeduty-free-exportsexport-adm ini stratio n-act-south-africaClassAssociator model (full trai ning set)AprioriMinimum support: 0.5 (218 instances)Minimum metric <confidence>: 0.9Number of cycles performed: 10Generated set
7、s of large itemsets:Size of set of large itemsets L(1): 12Large Itemsets L(1): handicapped-infants=n 236adoption-of-the-budget-resolution=y 253 physician-fee-freeze=n 247religious-groups-in-schools=y 272 anti-satellite-test-ban=y 239aid-to-nicaraguan-contras=y 242 synfuels-corporation-cutback=n 264e
8、ducation-spending=n 233crime=y 248 duty-free-exports=n 233export-administration-act-south-africa=y 269Class=democrat 267Size of set of large itemsets L(2): 4Large Itemsets L(2): adoption-of-the-budget-resolution=y physician-fee-freeze=n 219 adoption-of-the-budget-resolution=y Class=democrat 231 phys
9、ician-fee-freeze=n Class=democrat 245aid-to-nicaraguan-contras=y Class=democrat 218Size of set of large itemsets L(3): 1Large Itemsets L(3): adoption-of-the-budget-resolution=y physician-fee-freeze=n Class=democrat 219Best rules found:1. adoption-of-the-budget-resolution=y physician-fee-freeze=n 219
10、 => Class=democrat 219 conf:(1)2. physician-fee-freeze=n 247 => Class=democrat 245conf:(0.99)3. adoption-of-the-budget-resolution=y Class=democrat 231 => physician-fee-freeze=n 219 conf:(0.95)4. Class=democrat 267 => physician-fee-freeze=n 245conf:(0.92)5. adoption-of-the-budget-resoluti
11、on=y 253 => Class=democrat 231conf:(0.91)6. aid-to-nicaraguan-contras=y 242 => Class=democrat 218conf:(0.9)3) 結果分析:a) 該樣本數(shù)據(jù),數(shù)據(jù)記錄數(shù) 435個, 17個屬性,進行了 10 輪測試b) 最小支持度為 0.5,即至少需要 218 個實例;c) 最小置信度為 0.9 ;d) 進行了 10輪搜索,頻繁 1項集 12個,頻繁 2項集 4個,頻繁 3項集1個;4. 分類算法 -隨機樹 分析1) 操作步驟:a) 點擊 “ Explorer ”按鈕,彈出“ Weka Exp
12、lorer ”控制界面b) 選擇“ Classify ”選項卡;c) 點擊"Choose”按鈕,選擇"trees”“ RandomTree”規(guī)則d) 設置 Cross-validation 為 10 次e) 點擊左側"Start”按鈕2) 執(zhí)行結果:= Run information =Scheme:weka.classifiers.trees.RandomTree -K 0 -M 1.0 -S 1 Relation: voteInstances:435Attributes:17handicapped-infants water-project-cost-shar
13、ing adoption-of-the-budget-resolution physician-fee-freeze el-salvador-aid religious-groups-in-schools anti-satellite-test-ban aid-to-nicaraguan-contras mx-missile immigration synfuels-corporation-cutback education-spending superfund-right-to-sue crime duty-free-exports export-administration-act-sou
14、th-africaClassTest mode:10-fold cross-validation = Classifier model (full training set) =RandomTree el-salvador-aid = n|physician-fee-freeze = n| duty-free-exports = n| | |anti-satellite-test-ban = n| | synfuels-corporation-cutback = ncrime = n : republican (0.96 /0) crime = y | handicapped-infants
15、= n : democrat (2.02 /0.01)| handicapped-infants = y : democrat (0.05 /0)| | synfuels-corporation-cutback = y|handicapped-infants = n : democrat (0.79/ 0.01)| | | handicapped-infants = y : democrat (2.12 /0)| | |anti-satellite-test-ban = y| |adoption-of-the-budget-resolution = n|handicapped-infants
16、= n : democrat (1.26 /0.01)|handicapped-infants = y : republican (1.25 /0.25)| |adoption-of-the-budget-resolution = yhandicapped-infants = n|crime = n : democrat (5.94 /0.01)|crime = y : democrat (5.15 /0.12)handicapped-infants = y : democrat (36.99/ 0.09)| | duty-free-exports = y| | |crime = n : de
17、mocrat (124.23 /0.29) | | | crime = y | | | | handicapped-infants = n : democrat (16.9/ 0.38)| | | |handicapped-infants = y : democrat (8.99/ 0.02)| physician-fee-freeze = y| |immigration = n| | education-spending = n| | | | crime = n : democrat (1.09/ 0) | | | | crime = y : democrat (1.01 /0.01)| |
18、 | education-spending = y : republican (1.06 /0.02)| | immigration = y| | | synfuels-corporation-cutback = n| | | |religious-groups-in-schools = n : republican (3.02 /0.01)| | religious-groups-in-schools = y : republican (1.54 /0.04)| |synfuels-corporation-cutback = y : republican (1.06 /0.05) el-sa
19、lvador-aid = y | synfuels-corporation-cutback = n | | physician-fee-freeze = n|handicapped-infants = n| superfund-right-to-sue = ncrime = n : democrat (1.36 /0) crime = y | mx-missile = n : republican (1.01 /0) | mx-missile = y : democrat (1.01/0.01)| | superfund-right-to-sue = y : democrat (4.83 /0
20、.03)| | | handicapped-infants = y : democrat (8.42 /0.02) | | physician-fee-freeze = y | | | adoption-of-the-budget-resolution = n| |export-administration-act-south-africa = n|mx-missile = n : republican (49.03/0)|mx-missile = y : democrat (0.11 /0)| |export-administration-act-south-africa = yduty-f
21、ree-exports = n| mx-missile = n : republican (60.67/0)| mx-missile = y : republican (6.21 /0.15) duty-free-exports = y| aid-to-nicaraguan-contras = n| | water-project-cost-sharing = n | | | mx-missile = n : republican (3.12 /0)| | |mx-missile = y : democrat (0.01 /0)| | water-project-cost-sharing =
22、y : democrat (1.15 /0.14) | aid-to-nicaraguan-contras = y : republican (0.16 /0)| | | adoption-of-the-budget-resolution = y| | anti-satellite-test-ban = n | | | immigration = n : democrat (2.01 /0.01)immigration = y | water-project-cost-sharing = n| |mx-missile = n : republican (1.63 /0)| |mx-missil
23、e = y : republican (1.01 /0.01)water-project-cost-sharing = y| superfund-right-to-sue = n : republican (0.45 /0)| superfund-right-to-sue = y : republican (1.71 /0.64)| | anti-satellite-test-ban = y|mx-missile = n : republican (7.74/0)|mx-missile = y : republican (4.05/0.03)| synfuels-corporation-cut
24、back = y| |adoption-of-the-budget-resolution = n|superfund-right-to-sue = n | | | | | |anti-satellite-test-ban = nphysician-fee-freeze = n : democrat (1.39/ 0.01) physician-fee-freeze = y| water-project-cost-sharing = n : republican (1.01 /0) | water-project-cost-sharing = y : democrat (1.05 /0.05)|
25、anti-satellite-test-ban = y : democrat (1.13 /0.01)superfund-right-to-sue = y | | | | | | | | |education-spending = n |physician-fee-freeze = n | |crime = n : democrat (0.09/ 0)crime = y| handicapped-infants = n : democrat (1.01 /0.01) | handicapped-infants = y : democrat (1 /0)physician-fee-freeze
26、= y |immigration = n |export-administration-act-south-africa = n : democrat(0.34/0.11)|export-administration-act-south-africa = y| | | | | |crime = n : democrat (0.16 /0) crime = y|mx-missile = n|handicapped-infants = n : republican (0.29/ 0)|handicapped-infants = y : republican (1.88 /0.87)mx-missi
27、le = y : democrat (0.01 /0)immigration = y : republican (1.01 /0)education-spending = y|physician-fee-freeze = n| handicapped-infants = n : democrat (1.51 /0.01) | handicapped-infants = y : democrat (2.01 /0) physician-fee-freeze = y|crime = n : republican (1.02 /0) crime = y | | |export-administrat
28、ion-act-south-africa = n handicapped-infants = n |immigration = n | |mx-missile = nwater-project-cost-sharing = n : democrat(1.01/0.01)| |(1.81/0)|water-project-cost-sharing = y : republicanmx-missile = y : democrat (0.01 /0)| immigration = y| mx-missile = n : republican (2.78 /0)| | |mx-missile = y
29、 : democrat (0.01 /0)| handicapped-infants = y| |mx-missile = n : republican (2/0)| |mx-missile = y : democrat (0.4 /0)| export-administration-act-south-africa = y| | | mx-missile = n : republican (8.77 /0)| | |mx-missile = y : democrat (0.02 /0)| adoption-of-the-budget-resolution = y| | anti-satell
30、ite-test-ban = n| | handicapped-infants = ncrime = n : democrat (2.52 /0.01)crime = y : democrat (7.65 /0.07)| |handicapped-infants = y : democrat (10.83 /0.02)| | |anti-satellite-test-ban = y| | physician-fee-freeze = nhandicapped-infants = n|crime = n : democrat (2.42 /0.01) | crime = y : democrat
31、 (2.28 /0.03) handicapped-infants = y : democrat (4.17 /0.01)| | physician-fee-freeze = y|mx-missile = n : republican (2.3/0)|mx-missile = y : democrat (0.01 /0)Size of the tree : 143Time taken to build model: 0.01seconds = Stratified cross-validation = Summary =Correctly Classified Instances40793.5
32、632 %Incorrectly Classified Instances286.4368 %Kappa statistic0.8636Mean absolute error0.0699Root mean squared error0.2379Relative absolute error14.7341 %Root relative squared error48.8605 %Total Number of Instances435= Detailed Accuracy By Class =TP Rate FP Rate PrecisionRecall F-MeasureROC Area Cl
33、ass0.955 0.095 democrat0.941 0.955 0.948 0.9660.9050.0450.9270.9050.9160.967republicanWeighted Avg.0.9360.0760.9360.9360.9350.966= Confusion Matrix =a b<- classified as255 12 |a = democrat16 152 |b = republican3) 結果分析:a) 該樣本數(shù)據(jù),數(shù)據(jù)記錄數(shù) 435個, 17個屬性,進行了 10 輪交叉驗證b) 隨機樹長 143c) 正確分類共 407個,正確率達 93.5632 %d
34、) 錯誤分類 28 個,錯誤率 6.4368 %e) 測試數(shù)據(jù)的正確率較好5. 分類算法 - 隨機樹 分析1) 操作步驟:a) 點擊 “ Explorer ”按鈕,彈出“ Weka Explorer ”控制界面b) 選擇“ Classify ”選項卡;c) 點擊"Choose”按鈕,選擇"trees”“ J48'規(guī)則d) 設置 Cross-validation 為 10 次e) 點擊左側"Start”按鈕2) 執(zhí)行結果:= Run information =Scheme:weka.classifiers.trees.J48 -C 0.25 -M 2Rela
35、tion: voteInstances:435Attributes:17handicapped-infantswater-project-cost-sharingadoption-of-the-budget-resolutionphysician-fee-freeze el-salvador-aid religious-groups-in-schools anti-satellite-test-ban aid-to-nicaraguan-contras mx-missile immigrationsynfuels-corporation-cutback education-spending s
36、uperfund-right-to-sue crime duty-free-exports export-administration-act-south-africa ClassTest mode:10-fold cross-validation = Classifier model (full training set) =J48 pruned tree physician-fee-freeze = n: democrat (253.41 /3.75)physician-fee-freeze = y| synfuels-corporation-cutback = n: republican
37、 (145.71 /4.0)| synfuels-corporation-cutback = y| | mx-missile = n| | | adoption-of-the-budget-resolution = n: republican (22.61 /3.32)| | | adoption-of-the-budget-resolution = y| | | | anti-satellite-test-ban = n: democrat (5.04 /0.02)| | | | anti-satellite-test-ban = y: republican (2.21)| | mx-mis
38、sile = y: democrat (6.03 /1.03)Number of Leaves : 6Size of the tree : 11Time taken to build model: 0.06seconds = Stratified cross-validation = Summary =419160.92240.06110.174812.887 %35.9085 %43596.3218 %3.6782 %Correctly Classified Instances Incorrectly Classified Instances Kappa statisticMean abso
39、lute errorRoot mean squared error Relative absolute errorRoot relative squared error Total Number of Instances= Detailed Accuracy By Class =TP Rate0.97FP Rate0.048Precision0.97Recall F-MeasureROC Area Class0.9710.970.97democrat0.9520.030.9520.9520.9520.971republicanWeighted Avg.0.9630.0410.9630.9630.9630.971= Confusion Matrix =a b <- classified as 259 8 | a = democrat8 160 | b = republican3) 結果分析:a) 該樣本數(shù)據(jù),數(shù)據(jù)記錄數(shù) 435個, 17個屬性,進行了 10 輪交叉驗證b) 決策樹分 6 級
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年全球車展品牌形象合作合同協(xié)議4篇
- 2025年冷鏈物流產品運輸全程監(jiān)控合同3篇
- 2025年度生態(tài)修復工程承包山林合同書2篇
- 2024版香港高管聘用合同
- 2025年度智能倉儲承建與自動化裝修服務合同4篇
- 2024版化妝品供應合同協(xié)議書范本
- 檢查檢驗結果互認知識培訓考核試題
- 2024版技術開發(fā)合同:甲方與乙方共同研發(fā)新技術的具體內容
- 2025年度五星級酒店廚師員工勞動合同范本4篇
- 2025年度智能豬舍承包服務合同3篇
- 2025年度版權授權協(xié)議:游戲角色形象設計與授權使用3篇
- 2024年08月云南省農村信用社秋季校園招考750名工作人員筆試歷年參考題庫附帶答案詳解
- 防詐騙安全知識培訓課件
- 心肺復蘇課件2024
- 2024年股東股權繼承轉讓協(xié)議3篇
- 2024-2025學年江蘇省南京市高二上冊期末數(shù)學檢測試卷(含解析)
- 四川省名校2025屆高三第二次模擬考試英語試卷含解析
- 《城鎮(zhèn)燃氣領域重大隱患判定指導手冊》專題培訓
- 湖南財政經濟學院專升本管理學真題
- 考研有機化學重點
- 全國身份證前六位、區(qū)號、郵編-編碼大全
評論
0/150
提交評論