The model is trained using the following R code. fit <- lm(mpg ~ wt + hp, data = mtcars) coef(fit)
##5. Conclusion The Car MPG Predictor allows users to: Adjust inputs interactively Instantly view predicted MPG Understand the impact of weight and horsepower
summary(mtcars[, c("mpg", "wt", "hp")])
## mpg wt hp
## Min. :10.40 Min. :1.513 Min. : 52.0
## 1st Qu.:15.43 1st Qu.:2.581 1st Qu.: 96.5
## Median :19.20 Median :3.325 Median :123.0
## Mean :20.09 Mean :3.217 Mean :146.7
## 3rd Qu.:22.80 3rd Qu.:3.610 3rd Qu.:180.0
## Max. :33.90 Max. :5.424 Max. :335.0
fit <- lm(mpg ~ wt + hp, data = mtcars)
coef(fit)
## (Intercept) wt hp
## 37.22727012 -3.87783074 -0.03177295