Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Predictive Analytics with R

You're reading from   Mastering Predictive Analytics with R Master the craft of predictive modeling by developing strategy, intuition, and a solid foundation in essential concepts

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781783982806
Length 414 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (13) Chapters Close

Preface 1. Gearing Up for Predictive Modeling 2. Linear Regression FREE CHAPTER 3. Logistic Regression 4. Neural Networks 5. Support Vector Machines 6. Tree-based Methods 7. Ensemble Methods 8. Probabilistic Graphical Models 9. Time Series Analysis 10. Topic Modeling 11. Recommendation Systems Index

Predicting lynx trappings


Our second data set, known as the lynx data set, is a very famous data set and is provided with the core distribution of R. This was first presented in a 1942 paper by C. Elton and M. Nicholson, titled The ten year cycle in numbers of Canadian lynx, which appears in the Journal of Animal Ecology. The data consist of the number of Canadian lynx trapped in the MacKenzie river over the period 1821-1934. We can load the data as follows:

> data(lynx)

The following diagram shows a plot of the lynx data:

We will repeat the exact same series of analysis steps as we did with the earthquake data. First, we will create a grid of parameter combinations and use this to train multiple models. Then we will pick the best one on account of it having the smallest AIC value. Finally, we will use the chosen parameter combination to train a model and forecast the next few data points. The reader is encouraged to also experiment with auto.arima().

> d <- 0:2
> p <- 0:6
&gt...
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 $19.99/month. Cancel anytime
Banner background image