1. Overview: Stochastic Methods for Data Analysis#

This chapter is adapted from AM207 (Harvard, Fall 2021). Watch the recorded lecture.

Hide code cell content

from IPython.display import HTML

1.1. What is this book about?#

How Do We Model Patterns in Data?#

This is a scatter plot of home prices vs square footage of some homes in southern California.

../_images/fig32.jpg

Can you see any patterns or trends?

We see that as square footage increases, so does price.

../_images/fig32.jpg

But what is a precise, mathematical description of this relationship?

What is a Model?#

Building a model to capture a hypothesized relationship means we predict the value of one group of attributes using another group.

This prediction problem is called regression, the attribute we are trying to predict (e.g.price) is called the outcome or the target, denoted by \(y\).

The group of attributes (e.g. square footage) we use to make the prediction is called the covariates, denoted by \(x\).

A regression model is a mathematical function, \(f(x)\), that predicts the target. We denote our prediction by \(\hat{y} = f(x)\).

We conjectured that the model for this data is a line: \(\hat{y} = f(x) = w_1x + w_0\).

../_images/fig33.jpg

But which line fits the data best?

A Notion of Error#

An absolute residual is the absolute difference between the actual price of a home and the price predicted by the line for a given square footage:

\[ \mathtt{Residual}_n = y_n - \hat{y}_n \]
../_images/fig34.jpg

How do we quantify the overall error?#

  1. (Max absolute deviation) Count only the biggest “error”

    \[ \max_n |y_n - \hat{y}_n| \]
  2. (Sum of absolute deviations) Add up all the “errors”

    \[ \sum_n |y_n - \hat{y}_n| \]
  3. (Sum of squared errors) Add up the squares of the “errors”

    \[ \sum_n |y_n - \hat{y}_n|^2 \]
  4. (Mean squared errors) We can also average the squared “errors”.

    \[ \frac{1}{N}\sum_{n=1}^N |y_n - \hat{y}_n|^2 \]

Again, \(y_n\) is the observed target, \(\hat{y}_n\) is the predicted target.

Model Fitting#

Question: What do we mean by choosing “best” line, \(\hat{y} = w_1x + w_0\)?

The model fitting process:

  1. Choose an overall error metric. This metric is called the loss function or training objective:

    \[ \mathcal{L}(w_1, w_0) = \frac{1}{N}\sum_{n=1}^N |y_n - (w_1x_n + w_0)|^2, \quad\quad \text{(Mean Squared Error Loss)} \]
  2. Set up the problem of finding coefficients or parameters, \(w_0, w_1\), such that the loss function is minimized:

    \[ \underset{w_0, w_1}{\mathrm{argmin}}\mathcal{L}(w_1, w_0) = \underset{w_0, w_1}{\mathrm{argmin}}\frac{1}{N}\sum_{n=1}^N |y_n - (w_1x_n + w_0)|^2 \]
  3. Choose a method of minimizing the loss function.

Note: For linear regression, we can minimize \(\mathcal{L}\) analytically. We cannot do this for every model!

What is a Statistical Model?#

Perhaps our choice of an overall error can be less arbitrary if we explain how, we believe, the residual arise.

Belief: The theoretical relationship between price and square footage (\(x\)) is given by \(f(x)\). But, in real-life, due to unpredictable circumstances observed prices (\(y\)) differ from \(f(x)\) by some random amount, \(\epsilon\), called noise:

\[ y = f(x) + \epsilon, \quad \epsilon \sim p(\epsilon) \]

A statistical model is one that explicitly accounts for uncertainty or randomness.

A Statistical Model for Regression#

Let us assume that (1) the underlying relationship between price and square footage \(x\) is given by \(f(x) = w_1x + w_0\); (2) that the observed price \(y\) deviates from \(f(x)\) by a random amount that is independent from \(x\) and is distributed as \(\mathcal{N}(0, 1)\):

\[ y = f(x) + \epsilon, \quad \epsilon \overset{\text{iid}}{\sim} \mathcal{N}(0, 1) \]

Note that \(y\) is now a random variable with distribution \(\mathcal{N}(f(x), 1)\), denoted by \(p(y|x, w_1, w_0)\).

How Do We Quantify Fitness?#

Given our statistical model, a natural way for quantifying how well \(f(x) = w_1x + w_0\) fits the data is by checking how likely our choice of \(w_0\) and \(w_1\) makes the observed data, i.e. compute

\[ \mathcal{L}(w_1, w_0) = \prod_{n=1}^N p(y_n|x_n, w_1, w_0). \]

The function \(\mathcal{L}(w_1, w_0)\) is called the likelihood function.

Exercise: suppose we have two models, \(f(x) = 3x + 2\) and \(f(x) = 10 - x\). Suppose that \(\mathcal{L}(w_1=3, w_0=2) = 10.2\) and \(\mathcal{L}(w_1=-1, w_0=10) = 0.002\). Which model is a better fit for the data and why?

Model Fitting#

Question: What do we mean by choosing “best” line, \(\hat{y} = f(x) = w_1x + w_0\)?

The model fitting process:

  1. Choose a method of estimation for statistical models. For example, set up the problem of finding coefficients or parameters, \(w_0, w_1\), such that the likelihood of the data is maximized:

    \[ \mathrm{argmax}_{w_0, w_1}\mathcal{L}(w_1, w_0) = \mathrm{argmax}_{w_0, w_1}\prod_{n=1}^N p(y_n|x_n, w_1, w_0) \]
  2. Choose a method of computing the estimate. For example, choose a way to maximize the likelihood.

Maximum Likelihood and Minimum Mean Square Error#

Given our statistical model

\[ y = f(x) + \epsilon, \quad \epsilon \overset{\text{iid}}{\sim} \mathcal{N}(0, 1) \]

Maximizing the likelihood is equivalent to minimizing the mean squared error:

\[ \mathrm{argmax}_{w_0, w_1}\prod_{n=1}^N p(y_n|x_n, w_1, w_0) \equiv \mathrm{argmin}_{w_0, w_1}\frac{1}{N}\sum_{i=1}^N |y_i - (w_1x_1 + w_0)|^2 \]

Hint: note that

\[\prod_{n=1}^Np(y_n|x_n, w_1, w_0) = \frac{1}{\sqrt{2\pi 1}^N} \exp\left\{-\frac{\sum_{i=1}^N(y_n - (w_1x_n + w_0))^2}{2 * 1} \right\}\]

and that

\[\log p(y|x, w_1, w_0) = N\log\left(\frac{1}{\sqrt{2\pi 1}}\right) - \frac{\sum_{i=1}^N(y_n - (w_1x_n + w_0))^2}{2 * 1} \]

Model Evaluation#

After fitting the model (finding coefficients that maximizes the likelihood or that minimizes the loss function), we need to check the error or residuals of the model. Why?

../_images/fig36.jpg

Working with statistical models gives us an advantage in model evaluation, can you see why?

Model Interpretation#

In addition to evaluating our model on training and testing data, we must also examine the coefficients themselves. Why?

../_images/fig35.jpg

What is a Bayesian Model?#

In addition to a statistical model that explains trends \(f(x)\) and observation noise \(\epsilon\), we also want to incorporate our prior beliefs about the model. Finally, we want to obtain a measure of uncertainty for our parameter estimates as well as our predictions.

Our Bayesian model for linear regression:

\[\begin{split}\begin{aligned} y &= w_1x + w_0 +\epsilon\\ \epsilon &\overset{\text{iid}}{\sim} \mathcal{N}(0, 1)\\ w_1 &\sim p(w_1)\\ w_0 &\sim p(w_0)\\ \end{aligned}\end{split}\]

where the prior \(p(w_i)\) may express that we want \(w_i\) to be non-negative and not too large.

Model Inference#

How do we “learn” the parameters in a Bayesian model?

Bayes’ Rule gives us a way to obtain a distribution over \(w_1, w_0\) given the data \((x_1, y_1), \ldots, (x_N, y_N)\):

\[ p(w_1, w_0 | x_1, \ldots, x_N, y_1, \ldots, y_N) \propto \underbrace{\left(\prod_{n=1}^N p(y_n|x_n, w_1, w_0)\right)}_{\text{How well params fit the data}} \underbrace{p(w_1)p(w_0)}_{\text{How well the params fit priors}} \]

The distribution \(p(w_1, w_0 | x_1, \ldots, x_N, y_1, \ldots, y_N)\) is called the posterior and gives the likelihood of a pair of parameters \(w_1, w_0\) given the observed data.

We see that the likelihood score of the parameters under the posterior is influence both by how well the parameters fit the data and how well the parameters fit our prior beliefs.

Bayesian Linear Regression#

When we choose normal priors for the parameters in a linear regression model, for example,

\[\begin{split}\begin{aligned} y &= w_1x + w_0 + \epsilon\\ \epsilon &\overset{\text{iid}}{\sim} \mathcal{N}(0, 1)\\ w_1 &\sim \mathcal{N}(0, 0.5)\\ w_0 &\sim \mathcal{N}(0, 1)\\ \end{aligned}\end{split}\]

The posterior \(p(w_1, w_0 | x_1, \ldots, x_N, y_1, \ldots, y_N)\) is again a (multivariate) normal distribution, \(\mathcal{N}(\mu, \Sigma)\), and we can derive closed form solutions for \(\mu\) and \(\Sigma\).

Why is this observation important?

Bayesian versus Frequentist Uncertainty#

The main advantage of the Bayesian approach is that rather than obtaining a single “best” estimate of the model parameters, the posterior gives us a distribution over a set of plausible model parameters (with some models being more likely than others).

The spread of this distribution over plausible models naturally gives us a way to quantify our uncertainty over which is the “best” model. When the spread is wide (when many very different models are equally very likely), our uncertainty is high. When the spread is narrow (when all likely models look very similar), our uncertainty is low.

We can also obtain a sense of uncertainty over models using the non-Bayesian probabilistic model. Typically, we randomly sample sets of training data point from the training data, on each set, we compute the MLE of the model parameters. This process is called bootstrapping.

In the problem set at the end of this chapter you will compare the uncertainties from the posteriors of Bayesian models with those from bootstrapping maximum likelihood models.

Model Evaluation#

With a Bayesian model we get a distribution \(p(w_1, w_0| \text{Data})\) over likely functions rather than a single function \(f(x) = w_1x + w_0\). How then do we evaluate the “error” of model?

In the Maximum Likelihood model, we can explicitly check the correctness of our assumptions by checking the distribution of the residuals. How do we criticize a Bayesian model?

Why is This Hard?#

  1. Stating that our goal is to maximize likelihood or minimize MSE is easy. Finding the optimal parameters is often very hard (especially if \(f(x)\) is not linear, but rather, a complex function represented by a neural network).

  2. If we choose more “interesting” or “expressive” priors, or if we choose more complex \(f(x)\), then it is often the case that the posterior cannot be computed in closed form.

Both model fitting and inference requires sophisticated algorithms derived from deep theoretical understanding of the models.

Is Accuracy Enough?#

We mentioned that we can get predictive uncertainty from maximum likelihood models by bootstrapping and that Bayesian models naturally give us a sense of predictive uncertainty. These are useful properties that are important for real-life applications.

When machine learning models are applied to safety-critical, risk-averse domains such as precision health care, financial and criminal justice systems, reliable measurements of a model’s predictive uncertainty may be as crucial as correctness of its predictions.

../_images/health.jpg

What Kinds of Predictive Uncertainty Do We Want?#

Predictive uncertainty helps us quantify risk in down-stream tasks:

../_images/dosage.png

We also care about the source of uncertainty:

../_images/dosage2.png

What information about the data/model do we want our uncertainties to capture?

Epistemic Uncertainty asks which function fits our data. Epistemic uncertainty arises due to small number of samples across all scenarios. This can be reduced by more samples!

Aleatoric Uncertainty: asks what is the level of randomness that underlies the data generation process. This is irreducible.

../_images/uncertainty.png

So Now You Have Predictive Uncertainties, What Are You Gonna Do With Them?#

In Efficient Out-of-Distribution Detection in Digital Pathology Using Multi-Head Convolutional Neural Networks (Linmans et al, Medical Imaging with Deep Learning 2020), the authors train an uncertainty-aware neural network model to detect breast cancer metastasis.

The epistemic uncertainty is used during test time to detect new types of breast tissue images that were not included in the training data. Classification of these novel types of images can be deferred to a human.

Unfamiliar types were caught at test time with AUC of .98.

../_images/BreastPathQ.png

How Do We Explain Decisions of Machine Learning Models?#

In order for human decision makers to interact with machine learning models meaningfully, we need these models to be interpretable. But explanation complex models is difficult.

../_images/slide14.png

How Do You Communicate ML Predictions, And Does It Matter?#

In An explainable deep-learning algorithm for the detection of acute intracranial haemorrhage from small datasets (Lee et al, Nature Biomedical Engineering, 2019), the authors build a neural network model to detect acute intracranial haemorrhage (ICH) and classifies five ICH subtypes.

Model classifications are explained by highlighting the pixels that contributed the most to the decision. The highlighted regions tends to overlapped with ‘bleeding points’ annotated by neuroradiologists on the images.

../_images/shap.png

What Interactions Do We Need to Think About When We Design ML Models?#

We tend to think of modeling as a purely mathematical or engineering feat, but in many cases the model has a complex interaction with a human decision maker.

We also tend to think of the tech and the user as a closed system. but your tech is actually one cog in a complex social-technical system, your intended use is just one actor in a web of stakeholders.

We not only need to worry about the performance of the model, we also need to worry about the performance the combined system of Human + AI.

../_images/slide13.png

The Promises of Human + AI Systems#

In Consistent Estimators for Learning to Defer to an Expert (Mozannar et al, International Conference on Machine Learning, 2020), the authors trains a model that decides when (and how) to classify an input and when to defer the decision to an human expert.

The joint Human + AI system can be superior to both components.

../_images/human%2Bai2.png

The Perils of Human + AI Systems#

In How machine-learning recommendations influence clinician treatment selections: the example of antidepressant selection (Jacobs et al, Translational Psychiatry, 2021), the authors found that clinicians interacting with incorrect recommendations paired with simple explanations experienced significant reduction in treatment selection accuracy.

../_images/reliance.png

Incorrect ML recommendations may adversely impact clinician treatment selections and that explanations are insufficient for addressing overreliance on imperfect ML algorithms.

The Potential Social Benefits of Machine Learning#

Artificial intelligence or machine learning models are becoming increasingly ubiquitous in modern life. These models have already made meaningful impact on many of the most pressing problems we face today.

../_images/benifits.jpeg

The Negative Social Impacts of Machine Learning#

../_images/risks.jpeg

Why Is This Happening?#

Bias in tech is not an algorithmic or math problem; it is a people problem, it is about neglecting the human dimension and inextricably linked with diversity & representation in the ways we approach problem solving.

../_images/gaps.jpeg

Alternative Problem Solving Frameworks for Machine Learning#

Machine learning is making a movement away from traditional design frameworks and problem solving methodologies.

../_images/participate.jpeg

Machine Learning: Much More Than Accuracy#

Machine learning is much more than engineering for abstract performance metrics. Increasingly the field is grappling with the role digital technology is playing in our entire socio-technical system.

Machine learning and data science are interdisciplinary fields that require people with diverse skill-sets/backgrounds to work closely and cooperatively.

There is also increasing calls for machine learning/data science researchers to engage meaningfully with social, economic, political, cultural and ethical impacts of their work when embedded in complex human institutions.

../_images/slide19.png

1.2. Summary#

  1. (Fitting Probabilistic Models) Given a probabilistic model with parameters \(\theta\), i.e. a model that explicitly accounts for the noise in the data. We learn \(\theta\) that maximizes the likelihood of the observed data.

    • Sanity Check: What is the noise model for the binomial model of coin tosses?

  2. (Maximizing the Likelihood) Maximizing the likelihood over \(\theta\) is an optimization problem. In an optimization problem, we by convention turn every maximization problem (e.g. maximize \(g(\theta)\)) into a minimization problem (e.g. minimize \(-g(\theta)\)) and then:

    • if there are no constraints, we identify the stationary points of the objective function and verify that the objective function is convex. In this case, the stationary points are local min, and every local min is a global min.

    • if there are constraints, we identify the stationary points of the Lagrangian and verify that the objective function is convex and the equality constraints are affine. In this case, every stationary point is a global min.

  3. (Why MLE) Why should we learn \(\theta\) to maximize the likelihood? What is the philosophical basis for performing MLE?

  4. (What Are Desirable Properties of Estimators) If we have a method to produce an estimate \(\widehat{\theta}\) of the true model parameters \(\theta\), what properties would we want from our estimate?

    • (Consistency) What is consistency and why do we, as practitioners, care?

    • (Unbiasedness) What is unbiasedness and why do we, as practitioners, care?

    • (Minimum Variance) What is minimum variance and why do we, as practitioners, care?

  5. (Why Not MLE) Which properties does MLE have? And which ones does it lack? What does this mean for practitioners using MLE - what do we need to watch out for?

  6. (Uncertainty) We said that maximize the likelihood gives us one “best” estimate of the model parameters. But how can we get uncertainty on our estimates (e.g. what is bootstrapping)?

1.3. Exercises#

These problems were originally assigned as homework. Data files are in the book’s data/ folder. Worked solutions, where available, are collapsed beneath the questions they answer; try each problem before expanding them.

Problem Set: Review of Statistical Modeling and Scientific Computing#

Hide code cell content

### Import basic libraries
import numpy as np
import pandas as pd
import sklearn as sk
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
%matplotlib inline

Exercise: Part I: Maximum Likelihood Estimators for Linear Regression

 

In this problem, you are given a dataset with a single predictor \(X\) representing patient age (in years) and a single outcome \(y\) representing diastolic blood pressure (in mm Hg), and your task is to fit a linear model to the data. The fitted model will be deployed in a hospital setting, where the model predictions will inform patient treatment.

The dataset is saved as HW0_data.csv in CSV (Comma Separated Values) format and can be read using the .read_csv() function from the pandas library.

Assume that the outcome \(y\) can be modeled by the following process:

\[\begin{aligned} y &= f(x) + \epsilon = w_1x + w_0 + \epsilon, \quad \epsilon \sim \mathcal{N}(0, 0.5) \end{aligned}\]

where \(w_1\) and \(w_0\), the parameters of the function \(f\), are unknown constants.

  1. (Model Building) Write the analytical expression for the likelihood function \(p(y|x, w_1, w_0)\), for a single observation \((x, y)\). Write the analytical expression for the likelihood function \(\prod_{n=1}^N p(y_n|x_n, w_1, w_0)\) for an entire dataset of \(N\) number of observations.

    Hint: for a given \(x\) and fixed parameters, what is the distribution of \(y\)?

  1. (Defining a Learning Objective) The Maximum Likelihood Estimators (MLE) of \(w_1\) and \(w_0\) are defined as

    \[\begin{aligned} w^{\text{MLE}}_1, w^{\text{MLE}}_0 = \underset{w_1, w_0}{\mathrm{argmax}}\; \prod_{n=1}^N p(y_n|x_n, w_1, w_0) \end{aligned}\]

    Show that finding \(w_1\) and \(w_0\) that maximizes the likelihood is equivalent to finding parameters that minimize the Mean Squared Error (MSE) of your model.

    Hint: show that maximizing the log likelihood is equivalent to minimizing the MSE.

  1. (Model Fitting) Analytically derive the formulae for MLE of \(w_1\) and \(w_0\). Describe what information you would need in order prove that the parameters you derived maximizes the likelihood (or minimizes the MSE)?

    Optional but Useful: express your derivation of the MLE in matrix notation (i.e. perform matrix calculus).

    Hint: this part requires multivariate calculus.

  1. (Model Evaluation) Using the LinearRegression class from sklearn.linear_model, fit a linear regression model to the dataset in HW0_data.csv. When you call the .fit() function of LinearRegression, the default is to find parameters that minimize MSE.

    Visualize the linear function you fitted as well as the data in one plot. Visualize a histogram of the residuals.

    Interpret the clinical meaning of the parameters \(w_0, w_1\).

    Using the plots and your interpretation of the model parameters, argue for whether or not your model is appropriate for the data.

    Hint: look at the assumptions you’ve made in your modeling process, which assumptions are supported by the data, which are contradicted by the data?

Exercise: Part II: Bayesian Linear Regression

 

In this problem, your task is to perform Bayesian linear regression on the dataset in HW0_data.csv.

Assume that the outcome \(y\) can be modeled by the following process:

\[\begin{split}\begin{aligned} y &= f(x) + \epsilon = w_1x + w_0 + \epsilon, \quad \epsilon \sim \mathcal{N}(0, 0.5)\\ w_0 &\sim \mathcal{N}(0, 1)\\ w_1 &\sim \mathcal{N}(0, 0.5) \end{aligned}\end{split}\]

In this model, we assume the same likelihood as in Part I, but we also include priors for \(w_0\) and \(w_1\): \(p(w_0) = \mathcal{N}(0, 1)\), \(p(w_1) = \mathcal{N}(0, 0.5)\)

  1. (Inference) Analytically derive the joint posterior distribution over the parameters. That is, analytically compute

    \[\begin{split}\begin{aligned} p(w_1, w_0 | y_1, \ldots y_n, x_1, \ldots, x_n) = \frac{\left(\prod_{n=1}^Np(y_n|x_n, w_1, w_0)\right)p(w_1)p(w_0)}{\prod_{n=1}^Np(y_n|x_n)}.\\ \end{aligned}\end{split}\]


    Hint: The posterior of a model with a Gaussian (or normal) likelihood and Gaussian priors is yet again Gaussian. This derivation is included in many machine learning textbooks like Machine Learning: a Probabilistic Perspective by Murphy or Pattern Recognition and Machine Learning by Bishop. This derivation also appears online in many course notes - you are welcomed to use any and all available resources.

  1. (Model Interpretation) Visualize the joint posterior over the parameters, \(p(w_1, w_0 | y, x)\) for the dataset in HW0_data.csv (you may use a scatter plot of samples drawn from the posterior or a contour map/heat map of the pdf). In separate plots, visualize the marginal posterior distribution over each parameter,

    \[\begin{split}\begin{aligned} p(w_1 | y_1, \ldots y_n, x_1, \ldots, x_n) &= \int_{w_0} p(w_1, w_0 | y_1, \ldots y_n, x_1, \ldots, x_n) dw_0\\ p(w_0 | y_1, \ldots y_n, x_1, \ldots, x_n) &= \int_{w_0} p(w_1, w_0 | y_1, \ldots y_n, x_1, \ldots, x_n) dw_1\\ \end{aligned}\end{split}\]

    Is the information contained in the joint posterior \(p(w_1, w_0 | y_1, \ldots y_n, x_1, \ldots, x_n)\) equivalent to the information contained in the two marginals \(p(w_1 | y_1, \ldots y_n, x_1, \ldots, x_n), p(w_0 | y_1, \ldots y_n, x_1, \ldots, x_n)\)? That is, what does each distribution tell you?

    Compute the variance of the marginal posterior distributions \(p(w_i | y_1, \ldots y_n, x_1, \ldots, x_n)\) empirically using samples from \(p(w_i | y_1, \ldots y_n, x_1, \ldots, x_n)\). What do the width of these intervals tell you about your confidence in the model’s estimation of the parameters?

    Hint: it is not necessary to analytically derive the marginals \(p(w_i | y_1, \ldots y_n, x_1, \ldots, x_n)\). Recall that you can perform marginalization of a variable by sampling from the joint distribution and disregarding that variable.

  1. (Prediction) In Bayesian linear regression, we obtain a distribution over possible parameters given the data, \(p(w_1, w_0 | y_1, \ldots y_n, x_1, \ldots, x_n)\), rather than a single point-estimate of the ‘best’ parameters. This means that when we predict an outcome for, say, \(x=2\) we get a distribution over possible values of \(y\) rather than a single \(y\). The distribution over the predicted \(y\) for a given \(x\) is called the posterior predictive, and is denoted \(p(y|x)\).

    Visualize the 95% posterior predictive interval (this is the interval that includes 95% of the posterior predictive values) for the training data – this is usually visualized as a shaded tube containing the 95% of the posterior predictive values for each test \(x\)-value.

    What does the 95% posterior predictive interval tell you about the model’s uncertainty in its predictions?

Exercise: Part III: Broader Impact Analysis

You’ve now modeled the same set of data using non-Bayesian and Bayesian regression models. In both paradigms it’s possible to identify a ‘best’ set of model parameters (in the non-Bayesian approach, we compute the MLE; in the Bayesian approach, we can compute the mean or mode of the posterior). For the Bayesian model, we also quantified our uncertainty in the model parameters as well as our uncertainty in the model’s predictions. So which model, if any, should we deploy in real life?

Starting in 2020, major machine learning conferences are beginning to ask authors as well as reviewers to explicitly consider the broader impact of new machine learning methods. To properly evaluate the potential good or harm that a piece of technology (AI or not) can do to the general public, we need to be aware that no technology is deployed in ideal conditions or in perfectly neutral contexts. In order to assess the potential broader impact of technology, we need to analyze the social systems/institutions of which these technologies will become a part.

To help you analyze the broader impact of your technology, begin by considering the following questions:

I. Identify the relevant socio-technical systems

  • In what social, political, economic system could the tech be deployed?

  • How would the tech be used in these systems (what role will it take in the decision making processes)?

II. Identify the stakeholders

  • Who are the users?

  • Who are the affected communities (are these the users)?

    Hint: users are typically decision makers who will use the technology as decision aids (e.g. doctors), whereas affected communities may be folks who are impacted by these decisions but who are not represented in the decision making process (e.g. patients).

III. What types of harm can this tech do?

  • What kinds of failures can this tech have?

  • What kinds of direct harm can these failures cause?

  • What kinds of harm can the socio-technical system cause?

    Hint: many technical innovations have niche applications, they may sit in a long chain of decision making in a complex system. As such, it may seem, at first glance, that these technologies have no immediate real-life impact. In these cases, it’s helpful to think about the impact of the entire system and then think about how the proposed innovations aid, hamper or change the goals or outcomes of this system.

IV. What types of good can this tech do?

  • What kinds of needs do these users/communities have?

  • What kinds of constraints do these users/communities have?

  1. (Impact) Analyze the broader impact of these two models. Specifically, focus on anticipating ways these models can interact with other components of the decision systems in which they will be deployed, identifying end-users, affected communities as well as anticipating the effects (positive and negative) on affected communities (in particular, does the model have the same effect on all subpopulations in the affected communities?).

  1. (Mitigation) Which model, if any, would you recommend to deploy? Why?

    What information should the ML designer/engineer disclose to the end-users to mitigate potential negative impacts?

1.4. Further Reading#

Preparatory Readings

Linear Regression

Bayesian Linear Regression