Book Image

Unsupervised Learning with R

By : Erik Rodríguez Pacheco
Book Image

Unsupervised Learning with R

By: Erik Rodríguez Pacheco

Overview of this book

<p>The R Project for Statistical Computing provides an excellent platform to tackle data processing, data manipulation, modeling, and presentation. The capabilities of this language, its freedom of use, and a very active community of users makes R one of the best tools to learn and implement unsupervised learning.</p> <p>If you are new to R or want to learn about unsupervised learning, this book is for you. Packed with critical information, this book will guide you through a conceptual explanation and practical examples programmed directly into the R console.</p> <p>Starting from the beginning, this book introduces you to unsupervised learning and provides a high-level introduction to the topic. We quickly move on to discuss the application of key concepts and techniques for exploratory data analysis. The book then teaches you to identify groups with the help of clustering methods or building association rules. Finally, it provides alternatives for the treatment of high-dimensional datasets, as well as using dimensionality reduction techniques and feature selection techniques.</p> <p>By the end of this book, you will be able to implement unsupervised learning and various approaches associated with it in real-world projects.</p>
Table of Contents (15 chapters)
Unsupervised Learning with R
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Preface

Currently, the amount of information we are able to produce is increasing exponentially. In the past, data storage was very expensive. However, today, new technologies make it cheaper to store this information. So we are able to generate massive amounts of data, which it is also feasible to store. This means that we are immersed in a universe of data, of which we are not able to exploit the vast majority.

Among these large deposits of data storage there is valuable knowledge, but it is hidden and difficult to identify using traditional methods.

Fortunately, new technologies such as artificial intelligence, machine learning, and the management of databases converge with other disciplines that are more traditional such as statistics or mathematics to create the means to locate, extract, or even construct this valuable information from raw data.

This convergence of knowledge areas gives rise to, for example, very important subfields such as supervised learning and unsupervised learning, both derived from machine learning.

Both subfields contain a large quantity of tools to enhance the use of stored data so that it is possible to generate knowledge about the data and extract it in a human-interpretable way.

In this book, you will learn how to implement some of the most important concepts of unsupervised learning directly in the R console, one of the best tools for a data scientist, through practical examples using more than 40 R packages and a lot of useful functions.

Considering the wide range of techniques and knowledge related to unsupervised learning, this book is not intended to be in any way exhaustive. However, it contains some valuable knowledge and main techniques to introduce the reader to the study and implementation of this important sub field of machine learning.

What this book covers

Chapter 1, Welcome to the Age of Information Technology, aims at introducing the reader to the unsupervised learning context and explains the relation between unsupervised and supervised learning in the context of data mining. It also provides the reader with an introduction to the key concepts of information theory.

Chapter 2, Working with Data – Exploratory Data Analysis, is about some techniques for exploratory data analysis such as summarization, manipulation, correlation, and data visualization. An adequate knowledge of data, by exploration, is essential in order to apply unsupervised learning algorithms correctly. This assertion is true for any effort in data mining, not just for unsupervised learning.

Chapter 3, Identifying and Understanding Groups – Clustering Algorithms, teaches the readers about one of the most used techniques in unsupervised learning, clustering. Identifying groups can help discover and explain some patterns hidden in data. It is frequently the answer for multiple problems in many industries or contexts. Finding clusters can help uncover relationships in data, which can in turn be used to support future decisions.

Chapter 4, Association Rules, covers another grouping technique, the association rules. The association process makes groups of observations and attempts to discover links or associations between different attributes of groups. This association becomes rules, which can in turn be used to support future decisions.

Chapter 5, Dimensionality Reduction, aims to explain some dimensionality reduction techniques. In machine learning, this concept is the process of reducing the number of random variables considered, and it can be subdivided into feature selection and extraction. The key is to reduce the number of dimensions, but preserve most parts of the information.

Chapter 6, Feature Selection Methods, explains some techniques for feature selection, also known as variable selection or attribute selection. The key point is to choose a subset of relevant features of variables for modeling and not to use features that seem to be redundant, considering correlation to simplify model construction.

Appendix, References, provides a list of links referenced in the book, which are sorted chapter-wise. Given the amount of package and functions used in this book, it is very difficult to cite references and authors within the text of each chapter, as it would appear intermittent for the reader.

What you need for this book

You need to download R to follow the examples. You can download and install R using the CRAN website available at http://cran.r-project.org/. All the code was written using RStudio. RStudio is an integrated development environment (IDE) for R and can be downloaded from http://www.rstudio.com/products/rstudio/. Many of the examples are created using R packages, and they are discussed in their respective sections.

Who this book is for

This book is intended for professionals who are interested in data analysis using unsupervised learning techniques, as well as data analysts, statisticians, and data scientists seeking to learn to use R to apply data mining techniques. Knowledge of R, machine learning, and mathematics would help, but are not a strict requirement.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows:

A block of code is set as follows:

# Clean the Work Space
rm(list = ls(all = TRUE))

# Read the iris.csv file

Iris <- read.table("iris.csv", header = TRUE, 
sep = ",",dec = ".", row.names = 1)

In R it is a general practice to use <- for assignment instead of the = sign.

New terms and important words are shown in bold. Words that you see on the screen, for example in menus or dialog boxes, appear in the text like this: "We can also use the Summary of dataset option for exploratory data analysis:"

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/1234OT_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.