Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HELP WITH PYTHON CODING For this assignment, you will be using the data set car _ data.csv . This data set is a modified

PLEASE HELP WITH PYTHON CODING
For this assignment, you will be using the data set car_data.csv. This data set is a modified version of the data
There are two columns in this data set.
One is the weight of the vehicle in pounds, and the other is the highway miles per gallon.
Make a scatterplot of the highway miles per gallon (y-axis) versus the weight (x-axis).
Based on your plot, what is the general trend of how highway miles per gallon varies with the weight?
If you were to build a linear model using this data to predict highway miles per gallon from weight, would you
expect the slope to be positive or negative? Explain.
If the slope of a linear model predicting highway miles per gallon from the weight, interpret the meaning of the
slope being -0.05.
Write code to add a line to the graph you made in problem (1). Adjust the slope and y-intercept of this line
until you think you have found the line that best fits the data. Record the slope and y-intercept.
Use Python to find the best-fit line. The Scikit-learn package is a good choice to use for this.
Find the root mean squared error (RMSE) of the prediction line you found in problem (4) and the actual best-fit
line found in problem (5). How do these compare?
Use the best-fit line in problem (5) to predict the highway mpg of a car that weighs 3200 pounds.
Provided below is the data for the 'car_data.csv' and I need to know how to import it and read it as well with pd.read.csv('car_data.csv')
weight hwy_mpg
254827
254827
282326
233730
282425
284425
295425
308620
305322
239529
271028
276528
305525
323022
338022
350520
148853
187443
190943
187641
187638
212830
196738
198938
198938
219130
253530
281124
171354
181938
183742
194034
195634
201034
202434
223633
228933
230433
237233
246528
229331
233729
187443
190943
273429
406619
406619
395017
189031
190038
190538
194538
195038
238023
238023
238523
250023
238532
241032
238532
241032
244342
242532
267027
270039
351525
375025
349525
377025
374018
368518
390016
371516
291024
191841
194438
200438
214530
237030
232832
283324
292124
292624
236532
240532
240330
240330
188937
201750
191837
193837
202437
195137
202837
197137
203737
200837
232434
230234
309522
329622
306025
307125
313923
313925
302024
319733
323024
343025
307524
325233
328524
348525
307524
325233
313024
191841
212830
196738
198938
219138
253530
281824
277827
275625
275625
280025
336628
257931
246031
265828
269528
270728
275828
280826
284726
205036
212031
224031
214537
219033
234032
238525
251029
229032
245531
242029
265023
198539
204038
201538
228037
229032
311032
208137
210937
227536
227547
209447
212234
214034
216934
220434
226529
230029

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions