全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 数据分析与数据挖掘
1003 1
2017-01-04
R and Data Mining
Contents
List of Figures v
List of Tables vii
List of Abbreviations ix
1 Introduction 1
1.1 Data Mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2.1 R Packages and Functions for Data Mining . . . . . . . . . . . . . . . . . . 2
1.3 Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.1 Iris Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.2 Bodyfat Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Data Import/Export 7
2.1 Save/Load R Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Import from and Export to .CSV Files . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Import Data from SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Import/Export via ODBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.1 Read from Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.2 Output to and Input from EXCEL Files . . . . . . . . . . . . . . . . . . . . 9
3 Data Exploration 11
3.1 Have a Look at Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Explore Individual Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 Explore Multiple Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4 More Explorations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.5 Save Charts into Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4 Decision Trees and Random Forest 27
4.1 Building Decision Trees with Package party . . . . . . . . . . . . . . . . . . . . . . 27
4.2 Building Decision Trees with Package rpart . . . . . . . . . . . . . . . . . . . . . . 29
4.3 Random Forest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5 Regression 37
5.1 Linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.2 Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.3 Generalized Linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.4 Non-linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
ii CONTENTS
6 Clustering 45
6.1 k-Means Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.2 k-Medoids Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.3 Hierarchical Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.4 Density-based Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.5 Fuzzy Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.6 Subspace Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7 Outlier Detection 53
7.1 Univariate Outlier Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7.2 Outlier Detection with LOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7.3 Outlier Detection by Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.4 Outlier Detection from Time Series Data . . . . . . . . . . . . . . . . . . . . . . . . 61
7.5 Discussions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8 Time Series Analysis and Mining 65
8.1 Time Series Data in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.2 Time Series Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.3 Time Series Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
8.4 Time Series Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.4.1 Dynamic Time Warping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.4.2 Synthetic Control Chart Time Series Data . . . . . . . . . . . . . . . . . . . 70
8.4.3 Hierarchical Clustering with Euclidean Distance . . . . . . . . . . . . . . . 71
8.4.4 Hierarchical Clustering with DTW Distance . . . . . . . . . . . . . . . . . . 74
8.5 Time Series Classi cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.5.1 Classi cation with Original Data . . . . . . . . . . . . . . . . . . . . . . . . 75
8.5.2 Classi cation with Extracted Features . . . . . . . . . . . . . . . . . . . . . 76
8.5.3 k-NN Classi cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.7 Further Readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9 Association Rules 79
9.1 The Titantic Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
9.2 Association Rule Mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
9.3 Removing Redundancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.4 Visualizing Association Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
9.5 Discussions and Further Readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
10 Text Mining 89
10.1 Retrieving Text from Twitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
10.2 Transforming Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
10.3 Stemming Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
10.4 Building a Term-Document Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
10.5 Frequent Terms and Associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
10.6 Word Cloud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
10.7 Clustering Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
10.8 Clustering Tweets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
10.8.1 Clustering Tweets with the k-means Algorithm . . . . . . . . . . . . . . . . 98
10.8.2 Clustering Tweets with the k-medoids Algorithm . . . . . . . . . . . . . . . 99
10.9 Packages, Further Readings and Discussions . . . . . . . . . . . . . . . . . . . . . . 101
CONTENTS iii
11 Social Network Analysis 103
11.1 Network of Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
11.2 Network of Tweets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
11.3 Two-Mode Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
11.4 Discussions and Further Readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
12 Case Study I: Analysis and Forecasting of House Price Indices 117
13 Case Study II: Customer Response Prediction 119
14 Case Study III: Risk Rating on Big Data with Limited Memory 121
15 Case Study IV: Customer Behavior Prediction and Intervention 123
16 Online Resources 125
16.1 R Reference Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
16.2 R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
16.3 Data Mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
16.4 Data Mining with R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
16.5 Decision Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
16.6 Time Series Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
16.7 Spatial Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
16.8 Text Mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
16.9 Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Bibliography 129
Index 133

附件列表

R and Data Mining.pdf

大小:1.46 MB

只需: 1 个论坛币  马上下载

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-1-7 17:24:29
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群