Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Bayesian Models with R

You're reading from  Learning Bayesian Models with R

Product type Book
Published in Oct 2015
Publisher Packt
ISBN-13 9781783987603
Pages 168 pages
Edition 1st Edition
Languages
Author (1):
Hari Manassery Koduvely Hari Manassery Koduvely
Profile icon Hari Manassery Koduvely

Table of Contents (16) Chapters

Learning Bayesian Models with R
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Introducing the Probability Theory 2. The R Environment 3. Introducing Bayesian Inference 4. Machine Learning Using Bayesian Inference 5. Bayesian Regression Models 6. Bayesian Classification Models 7. Bayesian Models for Unsupervised Learning 8. Bayesian Neural Networks 9. Bayesian Modeling at Big Data Scale Index

Exercises


For the following exercises in this chapter, we use the Auto MPG dataset from the UCI Machine Learning repository (references 5 and 6 in the References section of this chapter). The dataset can be downloaded from https://archive.ics.uci.edu/ml/datasets.html. The dataset contains the fuel consumption of cars in the US measured during 1970-1982. Along with consumption values, there are attribute variables, such as the number of cylinders, displacement, horse power, weight, acceleration, year, origin, and the name of the car:

  • Load the dataset into R using the read.table() function.

  • Produce a box plot of mpg values for each car name.

  • Write a function that will compute the scaled value (subtract the mean and divide by standard deviation) of a column whose name is given as an argument of the function.

  • Use the lapply() function to compute scaled values for all variables.

  • Produce a scatter plot of mgp versus acceleration for each car name using coplot(). Use legends to annotate the graph.

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 $15.99/month. Cancel anytime}