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

Regression of energy efficiency with building parameters


In this section, we will do a linear regression of the building's energy efficiency measure, heating load (Y1) as a function of the building parameters. It would be useful to do a preliminary descriptive analysis to find which building variables are statistically significant. For this, we will first create bivariate plots of Y1 and all the X variables. We will also compute the Spearman correlation between Y1 and all the X variables. The R script for performing these tasks is as follows:

>library(ggplot2)
>library(gridExtra)

>df <- read.csv("ENB2012_data.csv",header = T)
>df <- df[,c(1:9)]
>str(df)
>df[,6] <- as.numeric(df[,6])
>df[,8] <- as.numeric(df[,8])

>attach(df)
>bp1 <- ggplot(data = df,aes(x = X1,y = Y1)) + geom_point()
>bp2 <- ggplot(data = df,aes(x = X2,y = Y1)) + geom_point()
>bp3 <- ggplot(data = df,aes(x = X3,y = Y1)) + geom_point()
>bp4 <- ggplot(data = df,aes...
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}