Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
R for Data Science

You're reading from   R for Data Science Learn and explore the fundamentals of data science with R

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781784390860
Length 364 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
 Toomey Toomey
Author Profile Icon Toomey
Toomey
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

R for Data Science
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Data Mining Patterns 2. Data Mining Sequences FREE CHAPTER 3. Text Mining 4. Data Analysis – Regression Analysis 5. Data Analysis – Correlation 6. Data Analysis – Clustering 7. Data Visualization – R Graphics 8. Data Visualization – Plotting 9. Data Visualization – 3D 10. Machine Learning in Action 11. Predicting Events with Machine Learning 12. Supervised and Unsupervised Learning Index

Dataset


Machine learning works by featuring a dataset that we break up into a training section and a testing section. We use the training data to come up with our model. We can then prove or test that model against the remaining testing section data.

The first issue is finding a dataset with several variables and, hopefully, several hundred observations. I am using the housing data from http://uci.edu. Let's find the dataset using the following command:

> housing <- read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data")
> colnames(housing) <- c("CRIM","ZN","INDUS","CHAS","NOX","RM","AGE","DIS","RAD","TAX","PRATIO","B","LSTAT","MDEV")

There are close to 500 observations with 14 variables. We can see a summary for a better idea, as follows:

> summary(housing)
      CRIM                ZN             INDUS            CHAS        
 Min.   : 0.00632   Min.   :  0.00   Min.   : 0.46   Min.   :0.00000  
 1st Qu.: 0.08204   1st Qu.:  0.00   1st Qu...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images