Data Mining Algoritms Explained Using R: Book Webpage Contents


R Packages

All the reusable R functions defined in this book's examples, as well as illustrative datasets and some simple utility functions not included in the book due to their lack of didactic value, are contained in a number of R packages. They all have the \texttt{dmr.} name prefix and are referred to as DMR packages in the book. These can be downloaded using the links below and then installed from local files.
Package Description Chapter
dmr.attrsel attribute selection filters and wrappers 19
dmr.bayes naive Bayes classifier 4
dmr.claseval classification performance measures, model evaluation procedures 7
dmr.cluseval clustering quality measures 14
dmr.data illustrative tiny datasets 1
dmr.dectree decision trees 3
dmr.disc discretization 18
dmr.dissim dissimilarity and similarity measures 11
dmr.ensemble model ensembles 15
dmr.hierclus hierarchical clustering 13
dmr.kcenters k-centers clustering 12
dmr.kernel support vector machines, support vector regression, kernel functions 16
dmr.linclas linear classification 5
dmr.linreg linear regression 8
dmr.miscost incorporating misclassification costs 6
dmr.regeval regression performance measures 10
dmr.regtree regression trees 9
dmr.rpartutil utilities for using rpart decision and regression trees 20
dmr.stats descriptive statistics and statistical relationship measures 2
dmr.trans attribute transformations 17
dmr.util utility functions

Example Code Snippets

Each code snippet contained in the book is available for as an R source file. There are two categories of these code snippets:

Code from Chapter 1

Source file Section Example
1-3-1.R 1.3 1.3.1
1-3-2.R 1.3 1.3.2
1-4-1.R 1.4 1.4.1
1-5-1.R 1.5 1.5.1

Code from Chapter 2

Source file Section Example
2-1-1.R 2.1 2.1.1
2-4-1.R 2.4 2.4.1
2-4-2.R 2.4 2.4.2
2-4-3.R 2.4 2.4.3
2-4-4.R 2.4 2.4.4
2-4-5.R 2.4 2.4.5
2-4-6.R 2.4 2.4.6
2-4-7.R 2.4 2.4.7
2-4-8.R 2.4 2.4.8
2-4-9.R 2.4 2.4.9
2-4-10.R 2.4 2.4.10
2-4-11.R 2.4 2.4.11
2-4-12.R 2.4 2.4.12
2-4-13.R 2.4 2.4.13
2-4-14.R 2.4 2.4.14
2-4-15.R 2.4 2.4.15
2-4-16.R 2.4 2.4.16
2-4-17.R 2.4 2.4.17
2-4-18.R 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R 4.4 4.4.1
4-4-2.R 4.4 4.4.2
4-4-3.R 4.4 4.4.3

Code from Chapter 5

Source file Section Example
5-1-1.R 5.1 5.1.1
5-2-1.R 5.2 5.2.1
5-2-2.R 5.2 5.2.2
5-2-3.R 5.2 5.2.3
5-2-4.R 5.2 5.2.4
5-2-5.R 5.2 5.2.5
5-2-6.R 5.2 5.2.6
5-2-7.R 5.2 5.2.7
5-3-1.R 5.3 5.3.1
5-3-2.R 5.3 5.3.2
5-3-3.R 5.3 5.3.3
5-3-4.R 5.3 5.3.4
5-4-1.R 5.4 5.4.1

Code from Chapter 6

Source file Section Example
6-1-1.R 6.1 6.1.1
6-2-1.R 6.2 6.2.1
6-2-2.R 6.2 6.2.2
6-3-1.R 6.3 6.3.1
6-3-2.R 6.3 6.3.2
6-3-3.R 6.3 6.3.3
6-3-4.R 6.3 6.3.4
6-4-1.R 6.4 6.4.1
6-5-1.R 6.5 6.5.1

Code from Chapter 7

Source file Section Example
7-1-1.R 7.1 7.1.1
7-2-1.R 7.2 7.2.1
7-2-2.R 7.2 7.2.2
7-2-3.R 7.2 7.2.3
7-2-4.R 7.2 7.2.4
7-2-5.R 7.2 7.2.5
7-2-6.R 7.2 7.2.6
7-2-7.R 7.2 7.2.7
7-2-8.R 7.2 7.2.8
7-2-9.R 7.2 7.2.9
7-2-10.R 7.2 7.2.10
7-2-11.R 7.2 7.2.11
7-2-12.R 7.2 7.2.12
7-2-13.R 7.2 7.2.13
7-2-14.R 7.2 7.2.14
7-2-15.R 7.2 7.2.15
7-2-16.R 7.2 7.2.16
7-2-17.R 7.2 7.2.17
7-3-1.R 7.3 7.3.1
7-3-2.R 7.3 7.3.2
7-3-3.R 7.3 7.3.3
7-3-4.R 7.3 7.3.4
7-3-5.R 7.3 7.3.5

Code from Chapter 8

Source file Section Example
8-1-1.R 8.1 8.1.1
8-2-1.R 8.2 8.2.1
8-2-2.R 8.2 8.2.2
8-3-1.R 8.3 8.3.1
8-3-2.R 8.3 8.3.2
8-3-3.R 8.3 8.3.3
8-3-4.R 8.3 8.3.4
8-4-1.R 8.4 8.4.1
8-6-1.R 8.6 8.6.1
8-6-2.R 8.6 8.6.2
8-6-3.R 8.6 8.6.3
8-6-4.R 8.6 8.6.4

Code from Chapter 09

Source file Section Example
9-1-1.R 9.1 9.1.1
9-2-1.R 9.2 9.2.1
9-3-1.R 9.3 9.3.1
9-3-2.R 9.3 9.3.2
9-3-3.R 9.3 9.3.3
9-3-4.R 9.3 9.3.4
9-3-5.R 9.3 9.3.5
9-3-6.R 9.3 9.3.6
9-3-7.R 9.3 9.3.7
9-3-8.R 9.3 9.3.8
9-5-1.R 9.5 9.5.1
9-7-1.R 9.7 9.7.1
9-7-2.R 9.7 9.7.2
9-8-1.R 9.8 9.8.1
9-8-2.R 9.8 9.8.2

Code from Chapter 10

Source file Section Example
10-1-1.R 10.1 10.1.1
10-2-1.R 10.2 10.2.1
10-2-2.R 10.2 10.2.2
10-2-3.R 10.2 10.2.3
10-2-4.R 10.2 10.2.4
10-2-5.R 10.2 10.2.5
10-2-6.R 10.2 10.2.6
10-2-7.R 10.2 10.2.7
10-2-8.R 10.2 10.2.8
10-2-9.R 10.2 10.2.9
10-3-1.R 10.3 10.3.1
10-3-2.R 10.3 10.3.2
10-3-3.R 10.3 10.3.3
10-3-4.R 10.3 10.3.4
10-3-5.R 10.3 10.3.5

Code from Chapter 11

Source file Section Example
11-1-1.R 11.1 11.1.1
11-2-1.R 11.2 11.2.1
11-3-1.R 11.3 11.3.1
11-3-2.R 11.3 11.3.2
11-3-3.R 11.3 11.3.3
11-3-4.R 11.3 11.3.4
11-3-5.R 11.3 11.3.5
11-3-6.R 11.3 11.3.6
11-3-7.R 11.3 11.3.7
11-3-8.R 11.3 11.3.8
11-4-1.R 11.4 11.4.1
11-4-2.R 11.4 11.4.2
11-4-3.R 11.4 11.4.3
11-4-4.R 11.4 11.4.4

Code from Chapter 12

Source file Section Example
12-1-1.R 12.1 12.1.1
12-2-1.R 12.2 12.2.1
12-3-1.R 12.3 12.3.1
12-4-1.R 12.4 12.4.1
12-4-2.R 12.4 12.4.2
12-6-1.R 12.6 12.6.1

Code from Chapter 13

Source file Section Example
13-1-1.R 13.1 13.1.1
13-2-1.R 13.2 13.2.1
13-3-1.R 13.3 13.3.1
13-3-2.R 13.3 13.3.2
13-3-3.R 13.3 13.3.3
13-3-4.R 13.3 13.3.4
13-3-5.R 13.3 13.3.5
13-3-6.R 13.3 13.3.6
13-4-1.R 13.4 13.4.1
13-5-1.R 13.5 13.5.1
13-6-1.R 13.6 13.6.1
13-6-2.R 13.6 13.6.2

Code from Chapter 14

Source file Section Example
14-1-1.R 14.1 14.1.1
14-1-2.R 14.1 14.1.2
14-2-1.R 14.2 14.2.1
14-2-2.R 14.2 14.2.2
14-2-3.R 14.2 14.2.3
14-2-4.R 14.2 14.2.4
14-2-5.R 14.2 14.2.5
14-3-1.R 14.3 14.3.1
14-3-2.R 14.3 14.3.2
14-3-3.R 14.3 14.3.3
14-3-4.R 14.3 14.3.4
14-3-5.R 14.3 14.3.5
14-4-1.R 14.4 14.4.1
14-4-2.R 14.4 14.4.2
14-4-3.R 14.4 14.4.2

Code from Chapter 15

Source file Section Example
15-1-1.R 15.1 15.1.1
15-3-1.R 15.3 15.3.1
15-3-2.R 15.3 15.3.2
15-3-3.R 15.3 15.3.3
15-3-4.R 15.3 15.3.4
15-3-5.R 15.3 15.3.5
15-4-1.R 15.4 15.4.1
15-4-2.R 15.4 15.4.2
15-4-3.R 15.4 15.4.3
15-4-4.R 15.4 15.4.4
15-5-1.R 15.5 15.5.1
15-5-2.R 15.5 15.5.2
15-5-3.R 15.5 15.5.3
15-5-4.R 15.5 15.5.4
15-5-5.R 15.5 15.5.5
15-5-6.R 15.5 15.5.6
15-6-1.R 15.6 15.6.1

Code from Chapter 16

Source file Section Example
16-1-1.R 16.1 16.1.1
16-2-1.R 16.2 16.2.1
16-2-2.R 16.2 16.2.2
16-2-3.R 16.2 16.2.3
16-2-4.R 16.2 16.2.4
16-2-5.R 16.2 16.2.5
16-2-6.R 16.2 16.2.6
16-3-1.R 16.3 16.3.1
16-3-2.R 16.3 16.3.2
16-3-3.R 16.3 16.3.3
16-4-1.R 16.4 16.4.1
16-5-1.R 16.5 16.5.1
16-6-1.R 16.6 16.6.1
16-7-1.R 16.7 16.7.1
16-7-2.R 16.7 16.7.2

Code from Chapter 17

Source file Section Example
17-1-1.R 17.1 17.1.1
17-2-1.R 17.2 17.2.1
17-2-2.R 17.2 17.2.2
17-3-1.R 17.3 17.3.1
17-3-2.R 17.3 17.3.2
17-3-3.R 17.3 17.3.3
17-3-4.R 17.3 17.3.4
17-3-5.R 17.3 17.3.5
17-4-1.R 17.4 17.4.1
17-4-2.R 17.4 17.4.2
17-4-3.R 17.4 17.4.3
17-4-4.R 17.4 17.4.4
17-4-5.R 17.4 17.4.5

Code from Chapter 18

Source file Section Example
18-1-1.R 18.1 18.1.1
18-2-1.R 18.2 18.2.1
18-3-1.R 18.3 18.3.1
18-3-2.R 18.3 18.3.2
18-3-3.R 18.3 18.3.3
18-4-1.R 18.4 18.4.1
18-4-2.R 18.4 18.4.2
18-4-3.R 18.4 18.4.3
18-4-4.R 18.4 18.4.4
18-4-5.R 18.4 18.4.5
18-4-6.R 18.4 18.4.6
18-4-7.R 18.4 18.4.7
18-4-8.R 18.4 18.4.8
18-4-9.R 18.4 18.4.9
18-5-1.R 18.5 18.5.1

Code from Chapter 19

Source file Section Example
19-1-1.R 19.1 19.1.1
19-3-1.R 19.3 19.3.1
19-3-2.R 19.3 19.3.2
19-3-3.R 19.3 19.3.3
19-4-1.R 19.4 19.4.1
19-4-2.R 19.4 19.4.2
19-4-3.R 19.4 19.4.3
19-4-4.R 19.4 19.4.4
19-4-5.R 19.4 19.4.5
19-4-6.R 19.4 19.4.6
19-4-7.R 19.4 19.4.7
19-4-8.R 19.4 19.4.8
19-4-9.R 19.4 19.4.9
19-5-1.R 19.5 19.5.1
19-5-2.R 19.5 19.5.2
19-5-3.R 19.5 19.5.3
19-6-1.R 19.6 19.6.1
19-6-2.R 19.6 19.6.2

Code from Chapter 20

Source file Section Example
20-1.R 20.1
20-2.R 20.2
20-3.R 20.3
20-4.R 20.4

Datasets

Several datasets available from the UCI Machine Learning Repository are used in the illustrative examples presented in most of the book, algorithm usage demonstrations, and case studies. Except for the datasets used for the case studies of Chapter 20, they do not have to be downloaded from the repository, since the examples and demonstrations use their copies available in the mlbench or datasets R packages (sometimes under slightly different names). It is still worthwhile to refer to the corresponding UCI pages for some basic characteristics of the data as well as information about their origin and past usage. The table presented below lists all the UCI datasets used in the book, providing their original repository names with links to their repository pages as well their R package names, where available.
Dataset UCI name/link R package/name
Census Income Census-Income (KDD)
Communities and Crime Communities and Crime
Cover Type Covertype
Boston Housing Housing mlbench/BostonHousing
Breast Cancer Breast Cancer mlbench/BreastCancer
Glass Glass Identification mlbench/Glass
HouseVotes84 Congressional Voting Records mlbench/HouseVotes84
Iris Iris datasets/iris
Pima Indians Diabetes Pima Indians Diabetes mlbench/PimaIndiansDiabetes
Servo Servo mlbench/Servo
Soybean Soybean (Large) mlbench/Soybean
Vehicle Silhouettes Statlog (Vehicle Silhouettes) mlbench/Vehicle


Paweł Cichosz