教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

29
Big Data- 海海海海海海海海海海海 海海海海海海海 海海海 NetStat 海海海海海海海海海海 (http://netstat.stat.tku.edu.tw ) R海 海海海海海海海海海 體:

description

 

Transcript of 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

Page 1: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

Big Data-海量資料的資料採礦方法淡江大學統計系 陳景祥

NetStat 線上統計計算網站作者 (http://netstat.stat.tku.edu.tw)「 R 軟體:應用統計方法」作者

Page 2: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

活動議程 (1)

Day 1[1] 9:00-12:00。 R 軟體快速簡介、常用程式技巧、與常用圖形函數。常用的資料探勘技術簡介。決策樹 (Decision Trees) (1)

[2]13:30-16:30。決策樹 (Decision Trees) (2)。類神經網路 (Artifical Nueral Network) (1)。類神經網路 (Artifical Nueral Network) (2)

Page 3: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

活動議程 (2)

Day 2[3] 9:00-12:00。 SVM(Support Vetor Machine) 與其他分類方法。集群分析 (Clustering Analysin) 與其他多變量方法 [4] 13:30-16:30。關聯分析 (Association Analysis)。實例演練與分析。綜合講解

Page 4: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體的特色:完整的程式語言功能Vector 與 Array 運算導向與統計領域直接對應的變數型態函數 (function) 與套件 (package) 為主要單元強大的繪圖功能活躍的套件 (package) 發展與更新R 程式可以使用 C, Fortran, Java 等程式可執行平行運算 (Parallel Computing)樂高玩具特質:可打照出自己的 R 環境

Page 5: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 與 SAS 、 SPSS 的不同功能 R SAS SPSS

程式語言功能 完整 不完整 不完整

繪圖功能 強悍 普通 普通

應用最新研究 快 慢 慢

分析模組數目 非常多 (3606個 )

多 普通

使用介面客製化 容易 麻煩 麻煩

輸出介面客製化 容易 很難 很難

使用其他語言或軟體的功能

強 稀少 稀少

價格 0 昂貴 / 每年版權費

昂貴

Page 6: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R Programming Levels (1) 寫程式引用適當函數來分析資料 (2) 細緻化處理或美化 Output 與圖形 (3) 動態變數替換 (Variable-Replacement) (4) 在 R 程式中使用其他程式語言 library (5) Package 包裝 (6) 簡單 package 寫作 (R programs) (7) Class 與 Methods (8) 進階 package 寫作 (C, Fortran, Java) (9) 高階 package 寫作 (GUI, HTML, LaTeX 處理 )(10) 大型資料處理、多機平行運算

Page 7: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體強大的繪圖功能 (1)

Page 8: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體強大的繪圖功能 (2)

Page 9: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體強大的繪圖功能 (3)

Page 10: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體強大的繪圖功能 (4)

Page 11: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體強大的繪圖功能 (5)

Page 12: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體範例:迴歸分析> ( IQ = round(rnorm(6,110,15)) ) # 隨機產生 6 個服從 N(110, 15) 的亂數,並四捨五

入[1] 118 121 107 108 87 131> ( scores = 5 + 0.6*IQ + rnorm(6,0,2) ) # 分數 = 5 + 0.6 * IQ + 隨機誤差(N(0,2))[1] 79.09683 77.53507 69.82176 69.17460 55.32896 84.49939> summary( lm(scores ~ IQ) ) # 使用 lm( ) 函數作迴歸分析Call:lm(formula = scores ~ IQ)Residuals: 1 2 3 4 5 6 2.4883 -1.0897 0.6060 -0.7132 -0.4453 -0.8461 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.69628 5.05144 -0.534 0.621786 IQ 0.67207 0.04476 15.014 0.000115 ***---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.514 on 4 degrees of freedomMultiple R-squared: 0.9826, Adjusted R-squared: 0.9782 F-statistic: 225.4 on 1 and 4 DF, p-value: 0.0001147

Page 13: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體範例: ANOVA> scores[1] 79.09683 77.53507 69.82176 69.17460 55.32896 84.49939> gender [1] "男" "男" "女" "女" "男" "女"> gender = as.factor(gender) # 使用 as.factor( ) 函數轉為 factor 變數> gender[1] 男 男 女 女 男 女Levels: 女 男

> anova(lm(scores ~ gender)) # 用 lm( ) 分析,再用 anova( ) 製作表格Analysis of Variance Table

Response: scores Df Sum Sq Mean Sq F value Pr(>F)gender 1 22.18 22.176 0.1761 0.6963Residuals 4 503.72 125.930

Page 14: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體應用的領域 (1) Bayesian Inference 貝氏統計方法 Chemometrics and Computational Physics 化學與物理 Clinical Trial Design, Monitoring, and Analysis 臨床實驗分析 Cluster Analysis & Finite Mixture Models 集群分析 Probability Distributions 機率分配 Computational Econometrics 計量經濟 Analysis of Ecological and Environmental Data 生態與環境分析 Design of Experiments (DoE) & Analysis of Experimental Data 實驗設計 Empirical Finance 財政實務分析 Statistical Genetics 基因統計 Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization

圖形分析 gRaphical Models in R 圖形模組 High-Performance and Parallel Computing 高效率運算與平行運算 Machine Learning & Statistical Learning 機器學習、資料探勘

Page 15: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 軟體應用的領域 (2) Medical Image Analysis 醫學影像分析 Multivariate Statistics 多變量分析 Natural Language Processing 自然語言分析 Official Statistics & Survey Methodology 政府統計與調查 Optimization and Mathematical Programming 函數最佳化 Analysis of Pharmacokinetic Data 藥物動力學分析 Phylogenetics 系統發生學 Psychometric Models and Methods 心理學測量分析 Reproducible Research 實驗複製分析 Robust Statistical Methods 強韌統計方法 Statistics for the Social Sciences 社會科學統計 Analysis of Spatial Data 空間統計 Survival Analysis 存活分析、可靠度分析 Time Series Analysis 時間數列

Page 16: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

應用:舊金山購物商場客戶舊金山海灣區 (Bay Area) Shopping Mall 顧客問卷資料:9409 個受訪者, 14 個人口統計變數income( 目標變數 )sex, marital, age, education,,occupation, livetime, dualincome, persons, young, house, hometype, ethnic, language

Page 17: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

CHAID 決策樹分析收入因素

Page 18: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

應用: Bank of America高維度資料圖形顯示、模型分析

Page 19: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

應用: Mu Sigma 決策顧問公司最佳決策組合與客戶轉向預測分析

Page 20: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

應用: CardioDx 基因檢測公司心血管疾病相關的基因檢測研究

Page 21: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

應用: Pfizer ( 輝瑞 ) 研究中心基因資料分析、 MicroArray 資料分析

Page 22: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

應用:澳洲國稅局 (1)Australian Taxation Office — Case Study全澳洲共有 22,000 員工Revenue Collection and Refund ManagementCompliance and Risk Modelling12M Individuals, $450B Income,

$100B Tax2M Companies..., $1800B Income,

$40B Tax2005 年改用 R 軟體分析資料

Page 23: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

應用:澳洲國稅局 (2)主要任務:High Risk RefundsRequired to Lodge ($110M)Assessing Levels of DebtPropensity to PayCapacity to PayDetermining Optimal Treatment StrategiesIdentity Theft — eTax and InternationalProject Wickenby Text Mining

Page 24: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

R 的應用:澳洲國稅局 (3)Major task is all about the data:data understanding/preparation, feature

generation/selection100,000 cases by 1,000 variablesStock and trade: glm, rpart, ada, randomForest,

kernlabSimple binary classification and $ regression Identify new characteristics to target high risk (5%);Focus resources on productive cases - $ and tax payer

benefit;Decision trees and ensembles (random forests) are

often effective

Page 25: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

應用:台灣健保門診資料庫提供醫師與研究者遠端資料分析服務

Page 26: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

德國 Fraunhofer 財經顧問公司 (1)

60 家分支機構、 80 個研究單位18000 個員工,年預算 1.65 億歐元http://www.fraunhofer.orgA case study on using generalizedadditive models to fit credit ratingScores (客戶信用評分卡系統 )by Marlene Müller,[email protected]

Page 27: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

德國 Fraunhofer 顧問公司 (2)credit data case study: 4 credit datasets

Page 28: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

德國 Fraunhofer 顧問公司 (3)

使用的 R 套件:Two main approaches for GAM in - gam::gam; backfitting with local scoring (Hastie and Tibshirani; 1990) - mgcv::gam ; penalized regression splines (Wood; 2006); compare these procedures under the default settings of gam::gam and

mgcv::gam Competing estimators: - logit binary GLM with G(u) = 1/{1 + exp(−u)} (logistic cdf as link) - logit2, logit3 binary GLM with 2nd / 3rd order polynomial terms for

the continuous regressors - logitc binary GLM with continuous regressors categorized (4–5 levels) - gam binary GAM using gam::gam with s() terms for continuous - mgcv binary GAM using mgcv::gam

Page 29: 教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521

德國 Fraunhofer 顧問公司 (4)