Machine Learning and Data Science: An Introduction to Statistical Learning Methods with R by Daniel Gutierrez
Author:Daniel Gutierrez [Gutierrez, Daniel]
Language: eng
Format: azw3, epub
Publisher: Technics Publications
Published: 2015-09-26T04:00:00+00:00
Figure 5-1 Scatterplot of the linear regression model for medv and rm with regression line
Now you can use the coefficients and the trained model to make predictions for new data (not data from the Boston data set). Let’s say you want to predict the median home value based on the average number of rooms—6, in this case. In the line of code below, we extract out the first coefficient using coef(lm1)[1] and add to it the second coefficient coef(lm1)[2] multiplied by 6. Here, we see the predicted median home value is $19,942.
> coef(lm1)[1] + coef(lm1)[2]*6
(Intercept)
19.94203
Here is another way of making a prediction, this time using the predict() function for the linear model lm1. We need to pass a data frame as an argument containing the rm value of 6. We get the same predicted median home value as before.
> newdata <- data.frame(rm=6)
> predict(lm1, newdata)
1
19.94203
Download
Machine Learning and Data Science: An Introduction to Statistical Learning Methods with R by Daniel Gutierrez.epub
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8301)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6744)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6722)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6599)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6382)
Driving Data Quality with Data Contracts by Andrew Jones(6331)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6093)
Learning SQL by Alan Beaulieu(5995)
Weapons of Math Destruction by Cathy O'Neil(5779)
Big Data Analysis with Python by Ivan Marin(5366)
Data Engineering with dbt by Roberto Zagni(4364)
Solidity Programming Essentials by Ritesh Modi(4011)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3872)
Pandas Cookbook by Theodore Petrou(3580)
Blockchain Basics by Daniel Drescher(3294)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2905)
Feature Store for Machine Learning by Jayanth Kumar M J(2815)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2796)
Mastering Python for Finance by Unknown(2744)
