Learning Bayesian Models with R
eBook - ePub

Learning Bayesian Models with R

Dr. Hari M. Koduvely

Share book
  1. 168 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Bayesian Models with R

Dr. Hari M. Koduvely

Book details
Book preview
Table of contents
Citations

About This Book

Become an expert in Bayesian Machine Learning methods using R and apply them to solve real-world big data problems

About This Book

  • Understand the principles of Bayesian Inference with less mathematical equations
  • Learn state-of-the art Machine Learning methods
  • Familiarize yourself with the recent advances in Deep Learning and Big Data frameworks with this step-by-step guide

Who This Book Is For

This book is for statisticians, analysts, and data scientists who want to build a Bayes-based system with R and implement it in their day-to-day models and projects. It is mainly intended for Data Scientists and Software Engineers who are involved in the development of Advanced Analytics applications. To understand this book, it would be useful if you have basic knowledge of probability theory and analytics and some familiarity with the programming language R.

What You Will Learn

  • Set up the R environment
  • Create a classification model to predict and explore discrete variables
  • Get acquainted with Probability Theory to analyze random events
  • Build Linear Regression models
  • Use Bayesian networks to infer the probability distribution of decision variables in a problem
  • Model a problem using Bayesian Linear Regression approach with the R package BLR
  • Use Bayesian Logistic Regression model to classify numerical data
  • Perform Bayesian Inference on massively large data sets using the MapReduce programs in R and Cloud computing

In Detail

Bayesian Inference provides a unified framework to deal with all sorts of uncertainties when learning patterns form data using machine learning models and use it for predicting future observations. However, learning and implementing Bayesian models is not easy for data science practitioners due to the level of mathematical treatment involved. Also, applying Bayesian methods to real-world problems requires high computational resources. With the recent advances in computation and several open sources packages available in R, Bayesian modeling has become more feasible to use for practical applications today. Therefore, it would be advantageous for all data scientists and engineers to understand Bayesian methods and apply them in their projects to achieve better results.

Learning Bayesian Models with R starts by giving you a comprehensive coverage of the Bayesian Machine Learning models and the R packages that implement them. It begins with an introduction to the fundamentals of probability theory and R programming for those who are new to the subject. Then the book covers some of the important machine learning methods, both supervised and unsupervised learning, implemented using Bayesian Inference and R.

Every chapter begins with a theoretical description of the method explained in a very simple manner. Then, relevant R packages are discussed and some illustrations using data sets from the UCI Machine Learning repository are given. Each chapter ends with some simple exercises for you to get hands-on experience of the concepts and R packages discussed in the chapter.

The last chapters are devoted to the latest development in the field, specifically Deep Learning, which uses a class of Neural Network models that are currently at the frontier of Artificial Intelligence. The book concludes with the application of Bayesian methods on Big Data using the Hadoop and Spark frameworks.

Style and approach

The book first gives you a theoretical description of the Bayesian models in simple language, followed by details of its implementation in the R package. Each chapter has illustrations for the use of Bayesian model and the corresponding R package, using data sets from the UCI Machine Learning repository. Each chapter also contains sufficient exercises for you to get more hands-on practice.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning Bayesian Models with R an online PDF/ePUB?
Yes, you can access Learning Bayesian Models with R by Dr. Hari M. Koduvely in PDF and/or ePUB format, as well as other popular books in Computer Science & Open Source Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781783987603
Edition
1

Learning Bayesian Models with R


Table of Contents

Learning Bayesian Models with R
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introducing the Probability Theory
Probability distributions
Conditional probability
Bayesian theorem
Marginal distribution
Expectations and covariance
Binomial distribution
Beta distribution
Gamma distribution
Dirichlet distribution
Wishart distribution
Exercises
References
Summary
2. The R Environment
Setting up the R environment and packages
Installing R and RStudio
Your first R program
Managing data in R
Data Types in R
Data structures in R
Importing data into R
Slicing and dicing datasets
Vectorized operations
Writing R programs
Control structures
Functions
Scoping rules
Loop functions
lapply
sapply
mapply
apply
tapply
Data visualization
High-level plotting functions
Low-level plotting commands
Interactive graphics functions
Sampling
Random uniform sampling from an interval
Sampling from normal distribution
Exercises
References
Summary
3. Introducing Bayesian Inference
Bayesian view of uncertainty
Choosing the right prior distribution
Non-informative priors
Subjective priors
Conjugate priors
Hierarchical priors
Estimation of posterior distribution
Maximum a posteriori estimation
Laplace approximation
Monte Carlo simulations
The Metropolis-Hasting algorithm
R packages for the Metropolis-Hasting algorithm
Gibbs sampling
R packages for Gibbs sampling
Variational approximation
Prediction of future observations
Exercises
References
Summary
4. Machine Learning Using Bayesian Inference
Why Bayesian inference for machine learning?
Model overfitting and bias-variance tradeoff
Selecting models of optimum complexity
Subset selection
Model regularization
Bayesian averaging
An overview of common machine learning tasks
References
Summary
5. Bayesian Regression Models
Generalized linear regression
The arm package
The Energy efficiency dataset
Regression of energy efficiency with building parameters
Ordinary regression
Bayesian regression
Simulation of the posterior distribution
Exercises
References
Summary
6. Bayesian Classification Models
Performance metrics for classification
The Naïve Bayes classifier
Text processing using the tm package
Model training and prediction
The Bayesian logistic regression model
The BayesLogit R package
The dataset
Preparation of the training and testing datasets
Using the Bayesian logistic model
Exercises
References
Summary
7. Bayesian Models for Unsupervised Learning
Bayesian mixture models
The bgmm package for Bayesian mixture models
Topic modeling using Bayesian inference
Latent Dirichlet allocation
R packages for LDA
The topicmodels package
The lda package
Exercises
References
Summary
8. Bayesian Neural Networks
Two-layer neural networks
Bayesian treatment of neural networks
The brnn R package
Deep belief networks and deep learning
Restricted Boltzmann machines
Deep belief networks
The darch R package
Other deep learning packages in R
Exercises
References
Summary
9. Bayesian Modeling at Big Data Scale
Distributed computing using Hadoop
RHadoop for using Hadoop from R
Spark – in-memory distributed computing
SparkR
Linear regression using SparkR
Computing clusters on the cloud
Amazon Web Services
Creating and running computing instances on AWS
Installing R and RStudio
Running Spark on EC2
Microsoft Azure
IBM Bluemix
Other R packages for large scale machine learning
The parallel R package
The foreach R package
Exercises
References
Summary
Index

Learning Bayesian Models with R

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the...

Table of contents