Auto fuel economy
Fuel consumption and engine characteristics for a few hundred cars - the worked example behind simple and polynomial regression.
CSVISLR2 R package (James, Witten, Hastie & Tibshirani)Open on ISLR2 R package (James, Witten, Hastie & Tibshirani) ↗
Gas mileage in miles per gallon alongside horsepower, weight, displacement, and other engine characteristics. An Introduction to Statistical Learning uses it throughout its regression chapters: the mpg-against-horsepower scatter is visibly curved, which is exactly why a straight-line fit underperforms a quadratic one, and why the bias-variance discussion needs a real dataset rather than a contrived one.
Key columns
Representative fields, refer to the source for the full, authoritative schema.
| Column | Type | Description |
|---|---|---|
| mpg | number | Fuel consumption in miles per gallon - the usual response variable. |
| horsepower | number | Engine horsepower; its relationship to mpg is clearly non-linear. |
| weight | number | Vehicle weight in pounds. |
| displacement | number | Engine displacement in cubic inches. |
| cylinders | integer | Number of cylinders. |
| year | integer | Model year. |
License: Distributed with the book’s companion R package; see the source page for terms.