liveBook · Manning

Box-and-whisker plot

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A graphical summary of a numeric distribution using quartiles, a median, and potential outliers.

A box-and-whisker plot, or boxplot, summarizes a numeric distribution with its first quartile, median, third quartile, whiskers, and separate outlier points. It helps inspect data quality and compare numeric features during exploratory analysis. section 2.4.2

Read a boxplot by checking:

  • The box boundaries, which mark Q1 and Q3, with the median inside the box. section 2.4.2
  • The whiskers, which extend to the farthest points allowed by the stated IQR rule. section 2.4.2
  • Separate points beyond the whiskers, which reveal the presence and number of potential outliers. section 2.4.2
  • Standardized values when comparing features measured in different units. section 2.4.2

Auto MPG numeric features

Standardize mpg, displacement, horsepower, weight, and acceleration, then draw boxplots together. The resulting chart supports inspection of unusually distributed values and possible collection or aggregation errors. section 2.4.2

standardized = ((data[numeric_feats] - data[numeric_feats].mean()) 
               / data[numeric_feats].std())
standardized.boxplot(column=numeric_feats, figsize= (12, 4))

A pandas listing shows how to standardize selected numeric features and render their boxplots together. section 2.4.2

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Explains quartiles, median, whiskers, IQR boundaries, outliers, and standardization, but does not develop statistical derivations.
Examples
Uses standardized Auto MPG features including mpg, displacement, horsepower, weight, and acceleration.
What it assumes
Assumes familiarity with numeric features and basic distributions while defining quartiles, median, IQR, and outliers.
What you can do after
Diagnose potential collection or aggregation errors by spotting unusual distributions and outlying observations.
How it connects
Connects boxplots with numeric features, histograms, quartiles, median, outliers, standardization, and exploratory data analysis.

Also explained in

Compare how 6 books explain box-and-whisker plot →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.