{ "cells": [ { "cell_type": "markdown", "id": "c4ca6ffb-2811-4a8e-a7b0-7cb8a655d805", "metadata": {}, "source": [ "\"Dal\n", "\n", "\n", "# CSCI 1109 - Practical Data Science \n", "## Assignment 3 - Vectors, Uncertainty, and Visualization\n", "\n", "**Due:** 25 February, 19h AT \n", "\n", "**Your name:** \\[ENTER YOUR NAME HERE\\] \n", "**Your Banner ID:** \\[ENTER YOUR BANNER ID HERE\\] \n", "**Your NetID:** \\[ENTER YOUR NETID HERE\\]\n", "\n", "**Submission format:** This Jupyter notebook (`.ipynb`) \n", "\n", "\n", "> **Instructions for students**\n", "> - Work in this notebook and submit the completed `.ipynb` file. \n", "> - Run **`Kernel → Restart & Run All`** before submitting to make sure everything runs from a clean state.\n", ">" ] }, { "cell_type": "markdown", "id": "7084dbf4", "metadata": {}, "source": [ "### Overview\n", "\n", "In this assignment you will connect three themes from the middle of the course:\n", "\n", "- representing data as **vectors and matrices** (NumPy),\n", "- using **descriptive statistics and bootstrapping** to reason about uncertainty,\n", "- and building clear, honest **visualizations** with Matplotlib and Seaborn.\n", "\n", "You will work with a real dataset of restaurant tips and build up from low-level\n", "array operations to polished figures and a short written narrative for a\n", "non-technical audience.\n", "\n", "The workload is designed to be comparable to the other programming assignments in the course\n", "if you start early and use the in-class lab time effectively.\n", "\n", "### Learning goals\n", "\n", "By the end of this assignment, you should be able to:\n", "\n", "- move fluently between pandas DataFrames and NumPy arrays;\n", "- express simple models and aggregations as vector / matrix operations;\n", "- compute and interpret basic descriptive statistics and quantiles;\n", "- use **bootstrapping** to build an empirical sampling distribution and confidence interval;\n", "- create multi-panel Matplotlib figures and higher-level Seaborn plots;\n", "- explain and defend design choices in a short written narrative.\n" ] }, { "cell_type": "markdown", "id": "7dbeb3f3", "metadata": {}, "source": [ "### How to use this notebook\n", "\n", "- Work in your own copy of this notebook (download from the course website or clone from the repo).\n", "- Run cells **top to bottom**, and do not delete or reorder existing cells.\n", "- Wherever you see `# YOUR CODE HERE`:\n", " - replace it with your own code,\n", " - remove or comment out the `raise NotImplementedError()` line.\n", "- For short-answer questions, replace `YOUR ANSWER HERE` with a few clear sentences in **this** notebook.\n", "\n", "You are encouraged to:\n", "\n", "- use the in-class lab time associated with Assignment 3 modules (NumPy, linear algebra,\n", " descriptive statistics, visualization) to get started;\n", "- refer back to relevant module notebooks (e.g., 1109-M20, M21, M22, M23, M27, M28, M29, M30)\n", " when you get stuck.\n", "\n", "Please see the course syllabus and Brightspace for:\n", "\n", "- the official **late policy**,\n", "- expectations around **collaboration** and **use of AI tools**,\n", "- and how this assignment fits into the overall course grade.\n" ] }, { "cell_type": "markdown", "id": "d9eb08b9", "metadata": {}, "source": [ "### Assessment\n", "\n", "***!This cell is completed only by your marker!***\n", "\n", "| # | Section | Mark | Out of | Comments |\n", "|----|------------------------------------------------------|------|--------|----------|\n", "| 1 | Part 0 — Setup & first look at the data | | /4 | |\n", "| 2 | Part 1 — Vectors, matrices, and simple scores | | /8 | |\n", "| 3 | Part 2 — Descriptive statistics & distributions | | /10 | |\n", "| 4 | Part 3 — Sampling, bootstrapping & uncertainty | | /10 | |\n", "| 5 | Part 4 — Visualization design & narrative | | /8 | |\n", "| 6 | Part 5 — Conceptual reflections | | /5 | |\n", "| | **Total** | | **/45**| |\n" ] }, { "cell_type": "markdown", "id": "e89102a7", "metadata": {}, "source": [ "## Part 0 — Setup & first look at the data *(~4 marks)*\n", "\n", "In this part you will:\n", "\n", "- set up your Python environment for the rest of the assignment,\n", "- load the restaurant tips dataset into a pandas DataFrame,\n", "- perform a quick, careful first look at the structure and basic sanity of the data.\n", "\n", "We will use the classic `tips` dataset from the Seaborn library, which records restaurant bills and tips.\n", "Each row corresponds to a single table.\n" ] }, { "cell_type": "markdown", "id": "366c7eaf", "metadata": {}, "source": [ "#### Q0.1 — Imports and random number generator\n", "\n", "Fill in the cell below so that:\n", "\n", "- the common libraries we will use are imported with standard aliases;\n", "- a global random number generator `rng` is created with seed `1109`.\n", "\n", "You **must** use this `rng` object for any random sampling you do later in the assignment.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "b6dc8a8e", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "\n", "# Ensure plots appear inline in most notebook environments\n", "%matplotlib inline\n", "\n", "# YOUR CODE HERE: create a global random number generator with seed 1109\n", "rng = None # replace this line\n", "\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "c7df3d6c", "metadata": {}, "source": [ "#### Q0.2 — Loading the `tips` dataset\n", "\n", "Complete the function below so that it:\n", "\n", "- loads the Seaborn `tips` dataset into a `pandas.DataFrame`,\n", "- returns the DataFrame unchanged.\n", "\n", "Then:\n", "\n", "1. Call the function to create a variable `tips`.\n", "2. Print the shape of the DataFrame.\n", "3. Display the first 5 rows.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "2c9b7582", "metadata": {}, "outputs": [], "source": [ "def load_tips_dataset():\n", " \"\"\"Load and return the Seaborn `tips` dataset as a pandas DataFrame.\n", "\n", " Returns\n", " -------\n", " df : pandas.DataFrame\n", " The full tips dataset.\n", " \"\"\"\n", " # YOUR CODE HERE\n", " raise NotImplementedError()\n", "\n", "\n", "# YOUR CODE HERE: use your function to create `tips`, then print basic info\n", "tips = None # replace with a call to your function\n", "\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "3d2ec684", "metadata": {}, "source": [ "#### Q0.3 — Basic sanity checks\n", "\n", "Using the `tips` DataFrame:\n", "\n", "1. Use `.info()` to check dtypes and missing values.\n", "2. Compute the number of unique values for each column (e.g., using `.nunique()`).\n", "3. In **1–3 sentences**, describe what **one row** represents and list **three** columns\n", " that seem especially important for understanding tipping behaviour.\n", "\n", "Write your **short answer in words** in the Markdown cell that follows.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "d6f2c4fc", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: run basic sanity checks on the DataFrame\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "6b210573", "metadata": {}, "source": [ "*Q0.3 — Your answer (replace this text with your own explanation).*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "d1c26f00", "metadata": {}, "source": [ "## Part 1 — Vectors, matrices, and simple scores *(~8 marks)*\n", "\n", "In this part you will practice expressing simple computations using NumPy vectors and matrices.\n", "\n", "We will focus on a small set of numeric columns from `tips`:\n", "\n", "- `total_bill` — total bill in dollars.\n", "- `tip` — tip amount in dollars.\n", "- `size` — number of people at the table.\n", "\n", "We'll treat each row as a vector in \\(\\mathbb{R}^3\\) and build a very simple linear model of a\n", "\"table score\" that combines these features.\n" ] }, { "cell_type": "markdown", "id": "d661967b", "metadata": {}, "source": [ "#### Q1.1 — Building a design matrix\n", "\n", "1. Create a NumPy array `X` with shape `(n_tables, 3)` containing the columns\n", " `total_bill`, `tip`, and `size`, in that order.\n", "2. Confirm the shape of `X` and print the first 3 rows.\n", "3. Create a length-3 weight vector `w` (as a 1D NumPy array) with **placeholder values** for now.\n", "\n", "Use only vectorized operations and DataFrame access patterns; do **not** loop over rows.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "9159e61d", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: build X and an initial weight vector w\n", "X = None\n", "w = None\n", "\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "3f440353", "metadata": {}, "source": [ "#### Q1.2 — A simple linear \"table score\"\n", "\n", "Suppose we want to define a quick-and-dirty \"table score\" of the form\n", "\n", "\\[\n", "s = 0.7 \\cdot \\text{total\\_bill} + 2.5 \\cdot \\text{tip} - 1.0 \\cdot \\text{size}.\n", "\\]\n", "\n", "1. Set `w` to the corresponding weight vector.\n", "2. Use **matrix / vector operations** (no Python loops) to compute a NumPy array `scores`\n", " of shape `(n_tables,)` containing the score for each row.\n", "3. Print the minimum, maximum, and mean of `scores`.\n", "\n", "Hint: Think about whether you want `w` as shape `(3,)`, `(3, 1)`, or `(1, 3)`, and how this\n", "interacts with the shape of `X`.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "a1f7cac9", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: set w correctly and compute scores\n", "scores = None\n", "\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "09b8b6d8", "metadata": {}, "source": [ "#### Q1.3 — Comparing vectorized vs loop-based approaches\n", "\n", "1. Implement a **loop-based** version of the score computation in a function\n", " `compute_scores_loop(X, w)` that returns a 1D NumPy array of scores.\n", "2. Implement a **vectorized** version `compute_scores_vectorized(X, w)` using a single\n", " matrix / vector operation (plus maybe a reshape).\n", "3. Check that the two functions return arrays that are numerically identical\n", " (e.g., using `np.allclose`).\n", "4. In 2–3 sentences, explain **why** you would usually prefer the vectorized version in data science code.\n", "\n", "Write your explanation in the Markdown cell that follows.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "ed80f6f6", "metadata": {}, "outputs": [], "source": [ "def compute_scores_loop(X, w):\n", " \"\"\"Compute table scores using an explicit Python loop.\n", "\n", " Parameters\n", " ----------\n", " X : np.ndarray, shape (n, 3)\n", " w : np.ndarray, shape (3,)\n", "\n", " Returns\n", " -------\n", " scores : np.ndarray, shape (n,)\n", " \"\"\"\n", " # YOUR CODE HERE\n", " raise NotImplementedError()\n", "\n", "\n", "def compute_scores_vectorized(X, w):\n", " \"\"\"Compute table scores using vectorized NumPy operations only.\"\"\"\n", " # YOUR CODE HERE\n", " raise NotImplementedError()\n", "\n", "\n", "# YOUR CODE HERE: compare the two implementations\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "fbf43ca8", "metadata": {}, "source": [ "*Q1.3 — Your explanation.*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "d94b9e82", "metadata": {}, "source": [ "## Part 2 — Descriptive statistics & distributions *(~10 marks)*\n", "\n", "In this part you will move from individual tables to summaries and distributions.\n", "\n", "We'll look at:\n", "\n", "- per-day summaries of bills and tips,\n", "- the distribution of the tip percentage,\n", "- and how different summaries highlight different aspects of the data.\n" ] }, { "cell_type": "markdown", "id": "b8165bcc", "metadata": {}, "source": [ "#### Q2.1 — Per-day summaries\n", "\n", "Create a new DataFrame `by_day` that groups `tips` by `day` and computes, for each day of the week:\n", "\n", "- the mean and median of `total_bill`,\n", "- the mean and median of `tip`,\n", "- the mean of `size`.\n", "\n", "Use the pandas **groupby** API and give the resulting columns sensible names\n", "(e.g., `total_bill_mean`, `total_bill_median`, ...).\n", "\n", "Display `by_day` sorted in a sensible way (e.g., by day order or by mean total bill).\n" ] }, { "cell_type": "code", "execution_count": null, "id": "514a4c9d", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: build the by_day summary DataFrame\n", "by_day = None\n", "\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "d5752772", "metadata": {}, "source": [ "#### Q2.2 — Tip percentage and its distribution\n", "\n", "1. Add a new column `tip_pct` to `tips` defined as `tip / total_bill`.\n", "2. Use Matplotlib (optionally with Seaborn) to create **one figure** that shows:\n", " - a histogram of `tip_pct`,\n", " - and a smooth density estimate (e.g., Seaborn's `kdeplot`) on the same axes.\n", "\n", "Make sure to:\n", "\n", "- label the axes clearly,\n", "- choose a sensible range of bins,\n", "- and give the plot a short, informative title.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "db742545", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: create tip_pct and plot its distribution\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "581f7b0c", "metadata": {}, "source": [ "#### Q2.3 — Quantiles and potential outliers\n", "\n", "1. Compute the 5th, 25th, 50th, 75th, and 95th percentiles of `tip_pct`.\n", "2. Compute the interquartile range (IQR) and use the **1.5 × IQR rule** to identify\n", " tip percentages that are unusually high or low.\n", "3. How many rows (if any) fall above the upper fence? Below the lower fence?\n", "\n", "In 2–4 sentences, comment on whether you think these \"outliers\" are genuinely strange behaviour\n", "or just the natural tail of the distribution in this context.\n", "\n", "Write your explanation in the Markdown cell that follows.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "64bce476", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: compute quantiles, IQR, and counts of potential outliers\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "b82e28e5", "metadata": {}, "source": [ "*Q2.3 — Your discussion of potential outliers.*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "1a4e4d3d", "metadata": {}, "source": [ "## Part 3 — Sampling, bootstrapping & uncertainty *(~10 marks)*\n", "\n", "In this part you will use **bootstrapping** to quantify how uncertain you should be\n", "about the *average* tip percentage.\n", "\n", "Rather than relying on a formula, you will:\n", "\n", "- repeatedly resample from the observed data,\n", "- compute a mean tip percentage for each resample,\n", "- and use the resulting distribution to build an empirical confidence interval.\n" ] }, { "cell_type": "markdown", "id": "b1e2a6fe", "metadata": {}, "source": [ "#### Q3.1 — A bootstrap function for the mean\n", "\n", "Implement the function `bootstrap_mean_tip_pct` below so that it:\n", "\n", "1. Takes a 1D NumPy array or pandas Series `tip_pct_values`.\n", "2. Uses the global `rng` to draw `n_boot` bootstrap resamples **with replacement**,\n", " each of the same size as the original data.\n", "3. Returns a NumPy array of length `n_boot` containing the mean tip percentage from each resample.\n", "\n", "Use efficient NumPy operations where possible (avoid very slow pure-Python loops over rows).\n" ] }, { "cell_type": "code", "execution_count": null, "id": "9218e263", "metadata": {}, "outputs": [], "source": [ "def bootstrap_mean_tip_pct(tip_pct_values, n_boot=2000):\n", " \"\"\"Return bootstrap sample means for the tip percentage.\n", "\n", " Parameters\n", " ----------\n", " tip_pct_values : array-like, shape (n,)\n", " Observed tip percentage values.\n", " n_boot : int\n", " Number of bootstrap resamples to draw.\n", "\n", " Returns\n", " -------\n", " boot_means : np.ndarray, shape (n_boot,)\n", " Mean tip percentage for each bootstrap resample.\n", " \"\"\"\n", " # YOUR CODE HERE\n", " raise NotImplementedError()\n", "\n", "\n", "# YOUR CODE HERE: call your function to generate bootstrap means\n", "boot_means = None\n", "\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "af0a0677", "metadata": {}, "source": [ "#### Q3.2 — A 95% bootstrap confidence interval\n", "\n", "Using your `boot_means` from Q3.1:\n", "\n", "1. Compute the 2.5th and 97.5th percentiles of the bootstrap distribution to form\n", " an approximate 95% **percentile confidence interval** for the mean tip percentage.\n", "2. Store these values in a tuple `ci_95 = (lower, upper)` and print it neatly.\n", "\n", "In 2–3 sentences, explain (in plain language) how to interpret this interval for someone\n", "who has never taken a statistics course.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "863168c4", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: compute a 95% percentile confidence interval\n", "ci_95 = None\n", "\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "f0a1bc6e", "metadata": {}, "source": [ "*Q3.2 — Your plain-language interpretation of the confidence interval.*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "0d0ae230", "metadata": {}, "source": [ "#### Q3.3 — Visualizing the bootstrap distribution\n", "\n", "Create a Matplotlib figure that shows a **histogram** of `boot_means` and:\n", "\n", "- marks the observed sample mean tip percentage with a vertical line,\n", "- marks the lower and upper bounds of your 95% confidence interval with different vertical lines,\n", "- includes a clear legend and axis labels.\n", "\n", "In 2–3 sentences, comment on the **shape** and **spread** of the bootstrap distribution.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "0c0b3538", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: visualize the bootstrap sampling distribution\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "25937dcb", "metadata": {}, "source": [ "*Q3.3 — Your comments on the bootstrap distribution.*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "b7f02d43", "metadata": {}, "source": [ "#### Q3.4 — How does sample size affect uncertainty?\n", "\n", "To explore the effect of sample size:\n", "\n", "1. Draw a **random subsample** of 40 rows from `tips` (without replacement) and compute a 95% bootstrap\n", " confidence interval for the mean tip percentage using only this subsample.\n", "2. Draw a **larger subsample** of 200 rows (or the full dataset if it has fewer than 200 rows)\n", " and compute another 95% bootstrap confidence interval.\n", "3. Compare the widths of the two intervals.\n", "\n", "In 3–4 sentences, explain what you observe and how it relates to the ideas in the\n", "sampling & bootstrapping lecture.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "b5b64c15", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: compare bootstrap intervals for different sample sizes\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "0be7f791", "metadata": {}, "source": [ "*Q3.4 — Your explanation of the effect of sample size.*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "53fcbb15", "metadata": {}, "source": [ "## Part 4 — Visualization design & narrative *(~8 marks)*\n", "\n", "Now that you have a sense of the basic patterns and uncertainty in the data,\n", "you will focus on **visualization choices** and telling a short, clear story.\n", "\n", "You should draw on ideas from the visualization modules:\n", "\n", "- avoiding common perception pitfalls (e.g., junk charts, misleading axes),\n", "- choosing appropriate encodings for the message,\n", "- and using annotation and layout to guide the reader.\n" ] }, { "cell_type": "markdown", "id": "9427a807", "metadata": {}, "source": [ "#### Q4.1 — A clean scatterplot with a trend line\n", "\n", "Create a figure that shows the relationship between `total_bill` and `tip`:\n", "\n", "- Use a scatter plot where each point is a table.\n", "- Encode at least one **categorical** variable (e.g., `time` or `smoker`) using colour or marker style.\n", "- Add a simple linear trend line (e.g., using Seaborn's `regplot` or by computing predictions yourself).\n", "- Make sure the axes, title, and legend are clear and not redundant.\n", "\n", "Your goal is to make it easy for a viewer to see **roughly how tips scale with the bill**\n", "and whether this differs across groups.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "88f0035b", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: create the scatterplot with a trend line\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "b77512ae", "metadata": {}, "source": [ "#### Q4.2 — A multi-panel figure for a non-technical audience\n", "\n", "Design a **2×2 grid** of subplots that together tell a concise story about tipping behaviour.\n", "For example, your four panels might show:\n", "\n", "- the distribution of `tip_pct`,\n", "- `tip_pct` by `day`,\n", "- how `tip_pct` varies with `size`,\n", "- and a comparison of tipping patterns for lunch vs dinner.\n", "\n", "Requirements:\n", "\n", "- Use Matplotlib's **subplot** or **subplots** API to control layout.\n", "- Use at least one Seaborn plotting function in at least two of the panels.\n", "- Add **brief annotations** or subtitles so that each panel has a clear purpose.\n", "- Pay attention to consistent scales and readable text size.\n", "\n", "After you create the figure, check that it would still be understandable if printed in grayscale.\n", "If not, adjust your design.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "b1e79588", "metadata": {}, "outputs": [], "source": [ "# YOUR CODE HERE: create a 2×2 multi-panel figure\n", "raise NotImplementedError()\n" ] }, { "cell_type": "markdown", "id": "9f6926be", "metadata": {}, "source": [ "#### Q4.3 — Short narrative (150–250 words)\n", "\n", "Imagine you are writing to a restaurant manager who has **no statistics background**.\n", "Write **150–250 words** that:\n", "\n", "- explain the most important patterns you see in tipping behaviour,\n", "- refer explicitly to one or two of your figures from Q4.1 and Q4.2,\n", "- and suggest **one concrete action** the manager might take (e.g., adjusting staffing,\n", " highlighting certain menu items, revising tip suggestions).\n", "\n", "Focus on being clear, honest, and specific rather than sounding \"fancy\".\n" ] }, { "cell_type": "markdown", "id": "277cab18", "metadata": {}, "source": [ "*Q4.3 — Your narrative for the restaurant manager.*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "fb367bc9", "metadata": {}, "source": [ "## Part 5 — Conceptual reflections *(~5 marks)*\n", "\n", "Answer the following short conceptual questions in your own words.\n", "You do **not** need to include formulas, but you should use correct terminology.\n" ] }, { "cell_type": "markdown", "id": "3f33f5a1", "metadata": {}, "source": [ "#### Q5.1 — Bootstrapping vs formulas\n", "\n", "In 3–5 sentences, compare **bootstrapping** to using an analytic formula for a confidence interval.\n", "\n", "- When is bootstrapping especially useful?\n", "- What is one limitation or risk of bootstrapping that you should keep in mind?\n" ] }, { "cell_type": "markdown", "id": "b1f9eba9", "metadata": {}, "source": [ "*Q5.1 — Your answer.*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "5f645306", "metadata": {}, "source": [ "#### Q5.2 — Visualization pitfalls\n", "\n", "Choose one of your own plots from this assignment and:\n", "\n", "1. Identify a potential **perception pitfall** (for example: overuse of colour, clutter, misleading aspect ratio, or hard-to-compare areas).\n", "2. Describe **how you mitigated** this pitfall, or what you would change if you had more time.\n", "\n", "Answer in 3–5 sentences.\n" ] }, { "cell_type": "markdown", "id": "fce71c06", "metadata": {}, "source": [ "*Q5.2 — Your answer.*\n", "\n", "YOUR ANSWER HERE\n" ] }, { "cell_type": "markdown", "id": "5b495763", "metadata": {}, "source": [ "#### Q5.3 — Vectors & matrices in data science\n", "\n", "In 3–5 sentences, explain how thinking in terms of **vectors** and **matrices** helped you\n", "(or could help you) structure your code and reasoning in this assignment.\n", "\n", "You can refer back to your work in Parts 1 and 3.\n" ] }, { "cell_type": "markdown", "id": "71c151c3", "metadata": {}, "source": [ "*Q5.3 — Your answer.*\n", "\n", "YOUR ANSWER HERE\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" } }, "nbformat": 4, "nbformat_minor": 5 }