Skip to main content
Workforce LibreTexts

12.7: Detailed Figure Captions - Chapter 12

  • Page ID
    60922
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\ket}[1]{\left| #1 \right>}\)
    \(\newcommand{\bra}[1]{\left< #1 \right|}\)
    \(\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| \left. #2 \vphantom{#1} \right>}\)
    \(\newcommand{\braopket}[3]{\left< #1 \vphantom{#2}\vphantom{#3} \right| #2 \vphantom{#1}\vphantom{#3} \left| #3 \vphantom{#1}\vphantom{#2} \right>}\)
    \(\newcommand{\qmvec}[1]{\mathbf{\vec{#1}}}\)
    \(\newcommand{\op}[1]{\hat{\mathbf{#1}}}\)
    \(\newcommand{\expect}[1]{\langle #1 \rangle}\)
    \(\newcommand{\dfn}[1]{\emph{\textbf{#1}}}\)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Programming-Based Analytics Tools -- Figure Specifications

    Overview

    • Chapter: 12 -- Programming-Based Analytics Tools

    • Total Figures Proposed: 8

    • Figure Types Used: Architecture Diagram, Comparison Table, Flowchart, Conceptual Illustration, Infographic


    Figure 12.1.1

    Title: Python Data Analytics Ecosystem

    Detailed Caption: Three horizontal layers stack from bottom to top like building blocks against a white background, each filled in a distinct color: a navy base layer labeled "NumPy" with the subtitle "Array Computing & Numerical Operations," a teal middle layer labeled "pandas" with the subtitle "DataFrames, Data Cleaning & Transformation," and a warm-gold top layer labeled "scikit-learn" with the subtitle "Machine Learning: Classification, Regression, Clustering." Small upward arrows between each pair of layers indicate the direction of dependency, a vertical label on the left margin reads "Python Data Analytics Stack," and a thin bar below NumPy identifies the "Python Standard Library" as the foundation underlying the entire column. By rendering the three libraries as physically stacked blocks rather than a flat list, the figure makes the dependency hierarchy tangible: pandas could not exist without NumPy's array substrate, and scikit-learn in turn builds on the DataFrame structures that pandas provides — a relationship that plain text enumeration of the libraries systematically obscures.


    Figure 12.1.2

    Title: Jupyter Notebook Architecture

    Detailed Caption: Three main components are arranged left to right and connected by bidirectional labeled arrows against a white background. On the left, a navy rounded rectangle labeled "Browser / Notebook UI" carries icons suggesting code cells and markdown text; at center, a teal rounded rectangle labeled "Jupyter Server (Hub)" acts as the routing layer; and on the right, three stacked warm-gold rounded rectangles represent a "Python Kernel," an "R Kernel," and "Other Kernels." The arrows between the Browser and the Server are labeled "HTTP / WebSocket," while those between the Server and the Kernels are labeled "ZeroMQ Messages," and a note beneath the diagram reads "Code execution happens in the kernel; results are sent back to the browser." By naming the communication protocols at each link, the figure demystifies what actually happens when a user presses Shift+Enter: the browser sends a message over WebSocket to the server, which forwards it via ZeroMQ to the appropriate kernel, and the kernel's output travels the same path in reverse — establishing that the notebook interface students see and the computation engine that executes their code are deliberately separate, testable components.


    Figure 12.2.1

    Title: The Tidyverse Ecosystem in R

    Detailed Caption: A large central hexagon in navy labeled "tidyverse" anchors the diagram, surrounded by eight smaller hexagons arranged in a ring and each connected to the center by a thin line. The surrounding hexagons are labeled, with brief subtitles, as: "dplyr — Data Manipulation," "ggplot2 — Visualization," "tidyr — Data Reshaping," "readr — Data Import," "purrr — Functional Programming," "tibble — Modern Data Frames," "stringr — String Operations," and "forcats — Factor Handling." Wrangling-oriented packages (dplyr, tidyr, readr, tibble) are rendered in teal, ggplot2 in warm gold, and the remaining packages in a muted complementary tone. By mapping all eight packages in a single hub-and-spoke layout rather than listing them in prose, the figure communicates the tidyverse's essential design claim: these are not eight independent tools but a coordinated ecosystem built around a shared grammar and pipe-friendly function signature, so that fluency in one package accelerates fluency in all the others.


    Figure 12.2.2

    Title: R Markdown Reproducible Report Workflow

    Detailed Caption: A left-to-right flowchart on a white background traces the R Markdown rendering pipeline through four stages. The first box, in navy, shows a document icon labeled ".Rmd File" with three sub-labels inside — "Markdown Text," "R Code Chunks," and "YAML Header" — and a small circular annotation reads "Code + Narrative in one file." An arrow labeled "knit" points right to a teal box labeled "knitr" with the subtitle "Executes code, captures output," and a second arrow labeled ".md file" continues to a second teal box labeled "pandoc" with the subtitle "Universal document converter." Three arrows fan outward from the pandoc box to three warm-gold output icons labeled "HTML Report," "PDF Document," and "Word Document." By labeling the intermediate ".md file" arrow, the figure reveals that the pipeline has two distinct conversion steps — knitr turning executable code into static text, and pandoc translating that text into whichever final format the author requested — clarifying why the same source file can produce three entirely different output formats without the author changing a single line of narrative or code.


    Figure 12.3.1

    Title: SQL Query Building Blocks -- Joins, CTEs, and Window Functions

    Detailed Caption: A white background is divided into three clearly labeled horizontal panels. Panel 1, "JOINs," shows two small tables side by side — Table A in navy (columns: id, name) and Table B in teal (columns: id, amount) — with arrows connecting matching id rows downward into a merged result table that combines all columns, making the equality-match logic of a JOIN visible. Panel 2, "Common Table Expressions (CTEs)," places a teal box labeled "WITH top_regions AS (...)" at the top with a downward arrow into a larger "Main Query" box, showing that the CTE behaves exactly like a named temporary table the main query can reference by name. Panel 3, "Window Functions," depicts a single table whose rows are grouped by dotted-line partition outlines, with a new rightmost column labeled "RANK()" populated with rank numbers that restart at 1 inside each partition. By juxtaposing all three concepts in one figure, the panel arrangement communicates a key structural point: JOINs combine columns across tables, CTEs give a result-set a reusable name within a single query, and window functions add new computed columns to existing rows without collapsing them — three distinct mechanisms that together cover the majority of non-trivial SQL analytics patterns.


    Figure 12.3.2

    Title: SQL Query Performance Optimization Strategies

    Detailed Caption: A two-column, three-row grid of rounded rectangles sits beneath a bold navy title "SQL Query Performance Optimization" on a white background. Each of the six tiles contains a small line icon on the left, a bold label, and a one-line description: a magnifying-glass icon for "Create Indexes — Speed up WHERE, JOIN, ORDER BY lookups"; a column icon for "Avoid SELECT * — Fetch only needed columns to reduce I/O"; a funnel icon for "Filter Early — Apply WHERE clauses and LIMIT before joins"; an arrows icon for "Optimize Join Order — Join smaller or pre-filtered tables first"; a clipboard icon for "Use EXPLAIN — Inspect query plans to find bottlenecks"; and a layers icon for "Denormalize When Needed — Use summary tables or materialized views." Labels are rendered in navy, icons in teal, and borders and accent lines in warm gold. The deliberate ordering of the six items traces an analyst's optimization sequence: structural changes first (indexes, column selection), query-logic changes next (early filtering, join order), diagnostic tools third (EXPLAIN), and architectural concessions last (denormalization) — making the infographic not merely a checklist but a prioritized workflow for approaching a slow query.


    Figure 12.4.1

    Title: Integrated Analytics Workflow -- SQL, Python, and R Pipeline

    Detailed Caption: A four-stage left-to-right pipeline on a white background moves data from source to output. Stage 1 is a navy cylinder icon labeled "Relational Database" with a code-snippet label below it reading "SQL: SELECT, JOIN, WHERE." An arrow points right to Stage 2, a teal rounded rectangle labeled "Python" with three sub-labels: "pandas: clean & merge," "NumPy: compute," and "scikit-learn: model." An arrow continues right to Stage 3, a warm-gold rounded rectangle labeled "R" with sub-labels "dplyr: wrangle," "ggplot2: visualize," and "lm(): model." A final arrow reaches Stage 4, a document icon labeled "Report / Dashboard" with sub-labels "R Markdown," "Jupyter Notebook," and "BI Tool." Below the main pipeline, small bidirectional arrows between the Python and R stages are labeled "reticulate / rpy2," and bidirectional arrows between Python and the Database stage are labeled "SQLAlchemy / pandas.read_sql." By naming the interoperability libraries (reticulate, rpy2, SQLAlchemy) on the connector lines rather than in the body text, the figure answers the practical question students most often ask when first told the tools can communicate: the mechanism is an explicit library call, not automatic, and knowing the library name is the entry point for learning how to wire the pipeline themselves.


    Figure 12.4.2

    Title: Python, R, and SQL Comparison for Analytics

    Detailed Caption: A three-column comparison table occupies the full width of the figure, with column headers "Python," "R," and "SQL" displayed in rounded rectangles carrying subtle tints of navy, teal, and warm gold respectively. Seven row headers run down the left margin in bold — Primary Strength, Key Libraries/Features, Data Structure, Visualization, Modeling, Scalability, and Pipeline Role — and the cells beneath each column header populate those rows with concise one-line phrases: Python reads "General-purpose scripting + ML / NumPy, pandas, scikit-learn / DataFrame, ndarray / Matplotlib, Seaborn, Plotly / scikit-learn, TensorFlow, PyTorch / PySpark, Dask / Transformation & ML"; R reads "Statistical analysis + reporting / dplyr, ggplot2, tidyr, caret / data.frame, tibble / ggplot2 (Grammar of Graphics) / lm, glm, caret, randomForest / Moderate (in-memory) / Analysis & Visualization"; and SQL reads "Data retrieval + set operations / JOINs, CTEs, Window Functions / Tables & Views / Limited (via BI tools) / Limited (some DB-native ML) / Excellent (database engine) / Data Ingestion & Aggregation." Rows alternate between white and light gray backgrounds to aid horizontal scanning. By aligning all three tools across the same seven dimensions in a single canvas, the table exposes the chapter's organizing argument: the tools are not competitors but specialists — SQL is strongest at set-based retrieval from disk, Python at programmatic transformation and machine learning, and R at statistical modeling and publication-quality visualization — and the most capable real-world analytics pipelines route each task to the tool designed for it.


    This page titled 12.7: Detailed Figure Captions - Chapter 12 was last modified on Thu, 17 Sep 2026 02:38:28 GMT and is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Felix Amoruwa.

    • Was this article helpful?