Fuel Consumption Prediction

Yasmine

June 2025

Slide 1 — Title

Fuel Consumption Prediction

A Shiny application developed to estimate a vehicle’s MPG (miles per gallon) based on its weight and number of cylinders.
Dataset used: mtcars.

Slide 2 — The Problem

Why this application?

Slide 3 — The Solution

An interactive Shiny application

Slide 4 — R Code Example

Here is an example prediction based on the model used:

# Load data
data(mtcars)

# Create the linear model
model <- lm(mpg ~ wt + cyl, data = mtcars)

# Prediction for a 3-ton, 6-cylinder vehicle
predict(model, data.frame(wt = 3, cyl = 6))
##        1 
## 21.06658