CM
2025-02-27
mtcars
dataset.# Sample R code to show the model and prediction
model <- lm(mpg ~ cyl + hp + wt, data = mtcars)
new_data <- data.frame(cyl = 6, hp = 150, wt = 3)
prediction <- predict(model, new_data)
prediction
1
20.89545
The model predicts the MPG based on user input.
Thank you!