SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
This question is about statistics and is related to the dataset called "Carseats", which can be
obtained from the library called "ISLR". So you can simply use the following commands in R-
language to view the data:
install.packages("ISLR")
library(ISLR)
summary(Carseats)
We now consider the k-nearest neighbour regression using Sales as response and Price as
predictor.
(a) For k=3 state how the estimate y is defined in the regression context. How does this estimate
differ from that used in classification with k-nearest neighbours? Why should they differ?
(b) For k=3, calculate the regression estimate and error and show suitable graphics. (Hint: you
may use the code chunk below and note that the "error" is simply the "sum of squares of the
predicted residuals", PRESS.)
(c) Try writing a loop over k, using k=1,..., 21 and determine the k that results in the smallest
error. Comment.
Code Chunk for knn is the following:
Carseats.knn <- knn.reg(train = Carseats$Price, y = Carseats$Sales, k=3) Carseats.knn
Please show all your answer step by step, and show your code using R language please, thank
you.

Mais conteúdo relacionado

Semelhante a This question is about statistics and is related to the dataset call.pdf

Data Visualization With R: Introduction
Data Visualization With R: IntroductionData Visualization With R: Introduction
Data Visualization With R: IntroductionRsquared Academy
 
Trust Measurement Presentation_Part 3
Trust Measurement Presentation_Part 3Trust Measurement Presentation_Part 3
Trust Measurement Presentation_Part 3Gan Chun Chet
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Simplilearn
 
R markup code to create Regression Model
R markup code to create Regression ModelR markup code to create Regression Model
R markup code to create Regression ModelMohit Rajput
 
Random forest algorithm for regression a beginner's guide
Random forest algorithm for regression   a beginner's guideRandom forest algorithm for regression   a beginner's guide
Random forest algorithm for regression a beginner's guideprateek kumar
 
Matrix multiplicationdesign
Matrix multiplicationdesignMatrix multiplicationdesign
Matrix multiplicationdesignRespa Peter
 
An Interactive Introduction To R (Programming Language For Statistics)
An Interactive Introduction To R (Programming Language For Statistics)An Interactive Introduction To R (Programming Language For Statistics)
An Interactive Introduction To R (Programming Language For Statistics)Dataspora
 
Finding the best K- Knn
Finding the best K- KnnFinding the best K- Knn
Finding the best K- Knnstanleysayanka
 
Efficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemEfficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemcsandit
 
Efficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemEfficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemcsandit
 
Efficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemEfficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemcsandit
 
Exercise Problems for Chapter 5Numerical example on page 203Pe.docx
Exercise Problems for Chapter 5Numerical example on page 203Pe.docxExercise Problems for Chapter 5Numerical example on page 203Pe.docx
Exercise Problems for Chapter 5Numerical example on page 203Pe.docxgitagrimston
 
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...ijcisjournal
 

Semelhante a This question is about statistics and is related to the dataset call.pdf (20)

Data Visualization With R: Introduction
Data Visualization With R: IntroductionData Visualization With R: Introduction
Data Visualization With R: Introduction
 
Data Visualization With R
Data Visualization With RData Visualization With R
Data Visualization With R
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Trust Measurement Presentation_Part 3
Trust Measurement Presentation_Part 3Trust Measurement Presentation_Part 3
Trust Measurement Presentation_Part 3
 
Tarea1
Tarea1Tarea1
Tarea1
 
FINAL_TAKE_HOME
FINAL_TAKE_HOMEFINAL_TAKE_HOME
FINAL_TAKE_HOME
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
 
R markup code to create Regression Model
R markup code to create Regression ModelR markup code to create Regression Model
R markup code to create Regression Model
 
pairs
pairspairs
pairs
 
Random forest algorithm for regression a beginner's guide
Random forest algorithm for regression   a beginner's guideRandom forest algorithm for regression   a beginner's guide
Random forest algorithm for regression a beginner's guide
 
Matrix multiplicationdesign
Matrix multiplicationdesignMatrix multiplicationdesign
Matrix multiplicationdesign
 
An Interactive Introduction To R (Programming Language For Statistics)
An Interactive Introduction To R (Programming Language For Statistics)An Interactive Introduction To R (Programming Language For Statistics)
An Interactive Introduction To R (Programming Language For Statistics)
 
Finding the best K- Knn
Finding the best K- KnnFinding the best K- Knn
Finding the best K- Knn
 
Efficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemEfficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystem
 
Efficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemEfficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystem
 
Efficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystemEfficient asic architecture of rsa cryptosystem
Efficient asic architecture of rsa cryptosystem
 
K nearest neighbor algorithm
  K nearest neighbor algorithm  K nearest neighbor algorithm
K nearest neighbor algorithm
 
Exercise Problems for Chapter 5Numerical example on page 203Pe.docx
Exercise Problems for Chapter 5Numerical example on page 203Pe.docxExercise Problems for Chapter 5Numerical example on page 203Pe.docx
Exercise Problems for Chapter 5Numerical example on page 203Pe.docx
 
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
 
Scaling up data science applications
Scaling up data science applicationsScaling up data science applications
Scaling up data science applications
 

Mais de alankareyecare

Thomas Greenin karar verme becerilerini ve kiileraras becerilerini .pdf
Thomas Greenin karar verme becerilerini ve kiileraras becerilerini .pdfThomas Greenin karar verme becerilerini ve kiileraras becerilerini .pdf
Thomas Greenin karar verme becerilerini ve kiileraras becerilerini .pdfalankareyecare
 
Three radio buttons that lets you select the direction left or right.pdf
Three radio buttons that lets you select the direction left or right.pdfThree radio buttons that lets you select the direction left or right.pdf
Three radio buttons that lets you select the direction left or right.pdfalankareyecare
 
This weeks discussion topic is this Are zoning laws a form of taki.pdf
This weeks discussion topic is this Are zoning laws a form of taki.pdfThis weeks discussion topic is this Are zoning laws a form of taki.pdf
This weeks discussion topic is this Are zoning laws a form of taki.pdfalankareyecare
 
Though popular participation in colonial government was limited, not.pdf
Though popular participation in colonial government was limited, not.pdfThough popular participation in colonial government was limited, not.pdf
Though popular participation in colonial government was limited, not.pdfalankareyecare
 
This morning you are in Chris�s office. Chris says, �I have 20 proje.pdf
This morning you are in Chris�s office. Chris says, �I have 20 proje.pdfThis morning you are in Chris�s office. Chris says, �I have 20 proje.pdf
This morning you are in Chris�s office. Chris says, �I have 20 proje.pdfalankareyecare
 
This is under Human Resource Management Applications Cases, Exercis.pdf
This is under Human Resource Management Applications Cases, Exercis.pdfThis is under Human Resource Management Applications Cases, Exercis.pdf
This is under Human Resource Management Applications Cases, Exercis.pdfalankareyecare
 
This is an opportunity for you to share what you know about 401k pro.pdf
This is an opportunity for you to share what you know about 401k pro.pdfThis is an opportunity for you to share what you know about 401k pro.pdf
This is an opportunity for you to share what you know about 401k pro.pdfalankareyecare
 
This is an individual assignment. The word count should not exceed 1.pdf
This is an individual assignment. The word count should not exceed 1.pdfThis is an individual assignment. The word count should not exceed 1.pdf
This is an individual assignment. The word count should not exceed 1.pdfalankareyecare
 
this is all the information given 2. (4 PTS) Under the 1990 Farm Bi.pdf
this is all the information given  2. (4 PTS) Under the 1990 Farm Bi.pdfthis is all the information given  2. (4 PTS) Under the 1990 Farm Bi.pdf
this is all the information given 2. (4 PTS) Under the 1990 Farm Bi.pdfalankareyecare
 
This exercise refers to the experiment of tossing four coins. What i.pdf
This exercise refers to the experiment of tossing four coins. What i.pdfThis exercise refers to the experiment of tossing four coins. What i.pdf
This exercise refers to the experiment of tossing four coins. What i.pdfalankareyecare
 
The volume of air within stiff, cartilaginous conduits of a respirat.pdf
The volume of air within stiff, cartilaginous conduits of a respirat.pdfThe volume of air within stiff, cartilaginous conduits of a respirat.pdf
The volume of air within stiff, cartilaginous conduits of a respirat.pdfalankareyecare
 
There are several commonalities and differences between the role and.pdf
There are several commonalities and differences between the role and.pdfThere are several commonalities and differences between the role and.pdf
There are several commonalities and differences between the role and.pdfalankareyecare
 
there is no figure The brain organizes touch infomation in a particu.pdf
there is no figure The brain organizes touch infomation in a particu.pdfthere is no figure The brain organizes touch infomation in a particu.pdf
there is no figure The brain organizes touch infomation in a particu.pdfalankareyecare
 
There has been a great deal of ground subsidence in California�s Cen.pdf
There has been a great deal of ground subsidence in California�s Cen.pdfThere has been a great deal of ground subsidence in California�s Cen.pdf
There has been a great deal of ground subsidence in California�s Cen.pdfalankareyecare
 
The traditional role of data architects has not changed. They are tr.pdf
The traditional role of data architects has not changed. They are tr.pdfThe traditional role of data architects has not changed. They are tr.pdf
The traditional role of data architects has not changed. They are tr.pdfalankareyecare
 
There are various approaches in regards to how costs are allocated a.pdf
There are various approaches in regards to how costs are allocated a.pdfThere are various approaches in regards to how costs are allocated a.pdf
There are various approaches in regards to how costs are allocated a.pdfalankareyecare
 
There are two coins in the bag one coin is fair (shows T and H with.pdf
There are two coins in the bag one coin is fair (shows T and H with.pdfThere are two coins in the bag one coin is fair (shows T and H with.pdf
There are two coins in the bag one coin is fair (shows T and H with.pdfalankareyecare
 
The widespread flooding caused by Hurricane Harvey resulted in treme.pdf
The widespread flooding caused by Hurricane Harvey resulted in treme.pdfThe widespread flooding caused by Hurricane Harvey resulted in treme.pdf
The widespread flooding caused by Hurricane Harvey resulted in treme.pdfalankareyecare
 
There are 8 black balls and 8 red balls in an urn. If 5 balls are dr.pdf
There are 8 black balls and 8 red balls in an urn. If 5 balls are dr.pdfThere are 8 black balls and 8 red balls in an urn. If 5 balls are dr.pdf
There are 8 black balls and 8 red balls in an urn. If 5 balls are dr.pdfalankareyecare
 
The workers union at a certain university is quite strong. About 94.pdf
The workers union at a certain university is quite strong. About 94.pdfThe workers union at a certain university is quite strong. About 94.pdf
The workers union at a certain university is quite strong. About 94.pdfalankareyecare
 

Mais de alankareyecare (20)

Thomas Greenin karar verme becerilerini ve kiileraras becerilerini .pdf
Thomas Greenin karar verme becerilerini ve kiileraras becerilerini .pdfThomas Greenin karar verme becerilerini ve kiileraras becerilerini .pdf
Thomas Greenin karar verme becerilerini ve kiileraras becerilerini .pdf
 
Three radio buttons that lets you select the direction left or right.pdf
Three radio buttons that lets you select the direction left or right.pdfThree radio buttons that lets you select the direction left or right.pdf
Three radio buttons that lets you select the direction left or right.pdf
 
This weeks discussion topic is this Are zoning laws a form of taki.pdf
This weeks discussion topic is this Are zoning laws a form of taki.pdfThis weeks discussion topic is this Are zoning laws a form of taki.pdf
This weeks discussion topic is this Are zoning laws a form of taki.pdf
 
Though popular participation in colonial government was limited, not.pdf
Though popular participation in colonial government was limited, not.pdfThough popular participation in colonial government was limited, not.pdf
Though popular participation in colonial government was limited, not.pdf
 
This morning you are in Chris�s office. Chris says, �I have 20 proje.pdf
This morning you are in Chris�s office. Chris says, �I have 20 proje.pdfThis morning you are in Chris�s office. Chris says, �I have 20 proje.pdf
This morning you are in Chris�s office. Chris says, �I have 20 proje.pdf
 
This is under Human Resource Management Applications Cases, Exercis.pdf
This is under Human Resource Management Applications Cases, Exercis.pdfThis is under Human Resource Management Applications Cases, Exercis.pdf
This is under Human Resource Management Applications Cases, Exercis.pdf
 
This is an opportunity for you to share what you know about 401k pro.pdf
This is an opportunity for you to share what you know about 401k pro.pdfThis is an opportunity for you to share what you know about 401k pro.pdf
This is an opportunity for you to share what you know about 401k pro.pdf
 
This is an individual assignment. The word count should not exceed 1.pdf
This is an individual assignment. The word count should not exceed 1.pdfThis is an individual assignment. The word count should not exceed 1.pdf
This is an individual assignment. The word count should not exceed 1.pdf
 
this is all the information given 2. (4 PTS) Under the 1990 Farm Bi.pdf
this is all the information given  2. (4 PTS) Under the 1990 Farm Bi.pdfthis is all the information given  2. (4 PTS) Under the 1990 Farm Bi.pdf
this is all the information given 2. (4 PTS) Under the 1990 Farm Bi.pdf
 
This exercise refers to the experiment of tossing four coins. What i.pdf
This exercise refers to the experiment of tossing four coins. What i.pdfThis exercise refers to the experiment of tossing four coins. What i.pdf
This exercise refers to the experiment of tossing four coins. What i.pdf
 
The volume of air within stiff, cartilaginous conduits of a respirat.pdf
The volume of air within stiff, cartilaginous conduits of a respirat.pdfThe volume of air within stiff, cartilaginous conduits of a respirat.pdf
The volume of air within stiff, cartilaginous conduits of a respirat.pdf
 
There are several commonalities and differences between the role and.pdf
There are several commonalities and differences between the role and.pdfThere are several commonalities and differences between the role and.pdf
There are several commonalities and differences between the role and.pdf
 
there is no figure The brain organizes touch infomation in a particu.pdf
there is no figure The brain organizes touch infomation in a particu.pdfthere is no figure The brain organizes touch infomation in a particu.pdf
there is no figure The brain organizes touch infomation in a particu.pdf
 
There has been a great deal of ground subsidence in California�s Cen.pdf
There has been a great deal of ground subsidence in California�s Cen.pdfThere has been a great deal of ground subsidence in California�s Cen.pdf
There has been a great deal of ground subsidence in California�s Cen.pdf
 
The traditional role of data architects has not changed. They are tr.pdf
The traditional role of data architects has not changed. They are tr.pdfThe traditional role of data architects has not changed. They are tr.pdf
The traditional role of data architects has not changed. They are tr.pdf
 
There are various approaches in regards to how costs are allocated a.pdf
There are various approaches in regards to how costs are allocated a.pdfThere are various approaches in regards to how costs are allocated a.pdf
There are various approaches in regards to how costs are allocated a.pdf
 
There are two coins in the bag one coin is fair (shows T and H with.pdf
There are two coins in the bag one coin is fair (shows T and H with.pdfThere are two coins in the bag one coin is fair (shows T and H with.pdf
There are two coins in the bag one coin is fair (shows T and H with.pdf
 
The widespread flooding caused by Hurricane Harvey resulted in treme.pdf
The widespread flooding caused by Hurricane Harvey resulted in treme.pdfThe widespread flooding caused by Hurricane Harvey resulted in treme.pdf
The widespread flooding caused by Hurricane Harvey resulted in treme.pdf
 
There are 8 black balls and 8 red balls in an urn. If 5 balls are dr.pdf
There are 8 black balls and 8 red balls in an urn. If 5 balls are dr.pdfThere are 8 black balls and 8 red balls in an urn. If 5 balls are dr.pdf
There are 8 black balls and 8 red balls in an urn. If 5 balls are dr.pdf
 
The workers union at a certain university is quite strong. About 94.pdf
The workers union at a certain university is quite strong. About 94.pdfThe workers union at a certain university is quite strong. About 94.pdf
The workers union at a certain university is quite strong. About 94.pdf
 

Último

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Último (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

This question is about statistics and is related to the dataset call.pdf

  • 1. This question is about statistics and is related to the dataset called "Carseats", which can be obtained from the library called "ISLR". So you can simply use the following commands in R- language to view the data: install.packages("ISLR") library(ISLR) summary(Carseats) We now consider the k-nearest neighbour regression using Sales as response and Price as predictor. (a) For k=3 state how the estimate y is defined in the regression context. How does this estimate differ from that used in classification with k-nearest neighbours? Why should they differ? (b) For k=3, calculate the regression estimate and error and show suitable graphics. (Hint: you may use the code chunk below and note that the "error" is simply the "sum of squares of the predicted residuals", PRESS.) (c) Try writing a loop over k, using k=1,..., 21 and determine the k that results in the smallest error. Comment. Code Chunk for knn is the following: Carseats.knn <- knn.reg(train = Carseats$Price, y = Carseats$Sales, k=3) Carseats.knn Please show all your answer step by step, and show your code using R language please, thank you.