Suffolk University • Sawyer Business School

From Data to Decisions: Your First Predictive Model

What predictive analytics is, why every business question about the future is a prediction problem — and a churn model you build yourself before 7:30

Session 1 of 13 · Mon Sep 14
Module: Foundations
150 Minutes
Mondays 5:00 PM
Hands-On Learning
01 // LEARNING OBJECTIVES

What You'll Learn Today

By the end of tonight you'll have both the concept and the working code — every objective maps to a cell you run yourself.

01

Locate Prediction on the Analytics Map

Descriptive tells you what happened. Predictive tells you what will happen next — and to whom. Prescriptive decides what to do about it. This course lives in the middle, and feeds the third.

02

Walk the Prediction Lifecycle

Business question → data → features → model → evaluation → decision → monitoring. You'll learn the loop tonight and repeat it thirteen times, on thirteen datasets, until it's reflex.

03

Build a Churn Model in Twelve Lines

The IBM Telco dataset: 7,043 customers, 20 columns, one question — who leaves next month? pandas to load, scikit-learn to fit, a held-out test set to keep you honest.

04

Discover Why Accuracy Lies

A model that predicts 'nobody churns' is 73% accurate on this data. Yours must beat that — and you'll learn the first three questions to ask of any accuracy number.

02 // SESSION AGENDA

Today's Journey

A business question, a dataset, a model — and the judgment to evaluate it.

5:00 PM - 5:20 PM

Welcome & The Course Ahead

20 minutes

Introductions, what predictive analytics is, and the semester arc: data and features, regression, classification and decisions, trees and gradient boosting, evaluation and trust, unsupervised learning, forecasting, neural networks and LLM features, and finally shipping a model.

  • Every session: a business question → a dataset → a model you build → an evaluation you can defend → a decision
  • Grading: labs 15% · homework 25% · midterm model competition 20% · final prediction story 40%
5:20 PM - 5:40 PM

The Prediction Lifecycle

20 minutes

From CRISP-DM to the modern ML loop. The step business people skip is framing: what exactly is being predicted, for whom, how far ahead, and what decision changes if the prediction is right?

  • Netflix, Capital One, and your local hospital all run the same seven-step loop — only the data changes
  • Prediction unit, horizon, and decision: write these three down before you touch a keyboard
5:40 PM - 6:05 PM

Meet the Data: Telco Customer Churn

25 minutes

7,043 customers of a telecom company. Tenure, contract type, monthly charges, internet service, tech support — and a Churn column that says whether they left last month. Ten minutes of pandas to know it before we model it.

  • 26.5% of customers churned — that number is your first baseline
  • Month-to-month contracts churn at 43%; two-year contracts at 3%. The signal is already visible
6:05 PM - 6:15 PM

Break

10 minutes

Stretch, coffee, meet a future competition teammate.

6:15 PM - 6:45 PM

Your First Model, Live

30 minutes

Split the data, fit a logistic regression on a handful of features, predict on the customers the model has never seen. Twelve lines of Python, and a probability of churn for every customer.

  • train_test_split with stratify=y — the single most important line in the notebook
  • fit on train, predict on test, never the other way around: the discipline that separates analysts from fortune-tellers
6:45 PM - 7:15 PM

Why Accuracy Lies

30 minutes

Our model scores 79% accuracy. The 'nobody churns' model scores 73%. Is 80 good? We open the confusion matrix and discover the model catches only half of the churners — and that a retention offer costs $50 while a lost customer costs $1,500.

  • Three questions for any accuracy: compared with what baseline? on which data? at what cost per mistake?
  • Preview of Session 5: the same model, a different threshold, $200K more profit
7:15 PM - 7:30 PM

Wrap-Up & Before Next Session

15 minutes

The pattern you'll use all semester: load → split → fit → predict → evaluate → decide. Nothing to submit this week: run tonight's notebook end to end and try Exercise 1, so that Session 2 — and Homework #1, which opens there — start from code you have already touched.

  • Next week: the data itself — joins, groupbys, missing values, and the leak that ruins models
  • Start thinking about a prediction problem from your own work — HW1 asks for it, and it may become your final project
FEATURED VIDEO

StatQuest — Bias and Variance

Seven minutes, one picture you will never forget. The overfitting explorer, explained by the man with the ukulele.

03 // INTERACTIVE RESOURCES

Tools & Learning Materials

Notebooks, readings, explorers, and the stories behind the methods.

Hands-On

Session 1 Notebook — Your First Predictive Model (Telco Churn)

The notebook we build in class: load the Telco data, explore churn rates by contract, split, fit a logistic regression, and read the confusion matrix. Runs free in your browser — no installation.

Open in Colab
Play

The Overfitting Explorer — Bias, Variance, and Noise

Drag the model-complexity slider and watch training error fall while test error turns back up. Add noise, resample the data, and see why a model that fits everything predicts nothing.

Open the explorer
Slides

Session 1 Slides — From Data to Decisions

The deck from class: the analytics map, the prediction lifecycle, the Telco data, the twelve-line model, and why accuracy lies. Arrow keys to navigate, F for fullscreen.

Open slides
Data

Telco Customer Churn — the dataset

IBM's sample telecom dataset: 7,043 customers, 20 features, 26.5% churn. Hosted in the course repository so every notebook can load it from a URL with no login.

View the data
Interactive

MLU-Explain — The Bias–Variance Tradeoff

Amazon Machine Learning University's interactive essay: drag the model complexity and watch bias and variance trade places. The companion to our Overfitting Explorer, with the math when you want it.

Open the explainer
Interactive

MLU-Explain — Train, Test, and Validation Sets

Why we hold data out, what the three splits are for, and the mistake of tuning on the test set — as a scrollable visual story.

Open the explainer
Reading

ISLP, Chapter 2 — Statistical Learning

The free textbook chapter that defines the whole field in 40 pages: what we mean by 'learning', prediction versus inference, the bias–variance trade-off, and why a test set is not optional.

Read Chapter 2 (free PDF)
Reading

Géron, Hands-On ML (3rd ed.), Chapter 1 — The Machine Learning Landscape

The best-selling practitioner's book, chapter 1: types of learning, the main challenges (bad data, overfitting, underfitting), and testing and validating. All notebooks are free on GitHub.

Open the notebooks
Story

Story: How Netflix Turned Prediction Into $1B a Year

Netflix estimates its recommendation system saves over $1 billion a year in reduced churn. The whole business case for predictive analytics in one sentence — and the churn problem you just modeled, at scale.

Read the research page
Video

StatQuest — Machine Learning Fundamentals: Bias and Variance

Seven minutes, one picture you will never forget. Watch before Session 2 if the overfitting explorer felt like magic.

Watch on YouTube
Refresher

Refresher: Introducing scikit-learn (ISOM 730 notebook)

Prof. Arslan's earlier notebook on the scikit-learn estimator API — choose a model, set hyperparameters, arrange X and y, fit, predict. If tonight's twelve lines went fast, this is the slow version. Hosted in the course repo — opens in Colab with one click.

Open in Colab
Refresher

Refresher: Müller & Guido, Ch. 2 — Supervised Learning (official notebook)

The gentlest complete tour of the classifiers you will meet all semester, each with its decision boundary drawn. Older scikit-learn, timeless ideas; the header explains what has changed.

Open in Colab
Review

Python foundations — the two decks from class (variables & expressions, conditionals)

What we covered from Python for Everybody chapters 2 and 3, what you should now be able to do, each idea on the churn problem, and the slides embedded. Lab 0 (the self-checking Python Foundations Check) opens in Session 2.

Explore now
04 // HANDS-ON ACTIVITIES

Learning by Doing

Open the notebook and build it with us.

Activity 1

Your First Predictive Model: Who Churns Next Month?

A telecom company has 7,043 customers and knows which ones left last month. Build a model that scores every customer's probability of leaving — then judge it honestly against the do-nothing baseline.

1

Frame the prediction

Unit: one customer. Target: Churn (Yes/No). Horizon: next month. Decision: who gets a retention offer. Write these four down at the top of the notebook — they're the contract with the business.

2

Look before you model

Churn rate overall (26.5%), then by contract type, by tenure bucket, by internet service. If a chart shows no signal, no model will find it either.

3

Split, fit, predict

Hold out 20% with stratify=y. Fit a logistic regression on tenure, monthly charges, and contract type. Predict probabilities for the held-out customers.

4

Judge it honestly

Accuracy versus the 73% baseline, then the confusion matrix: how many churners did we catch, how many loyal customers did we bother? Sketch what a $50 offer and a $1,500 lost customer do to the answer.

python
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, confusion_matrix

url = 'https://raw.githubusercontent.com/harslan/isom-835/master/public/data/telco_churn.csv'
df = pd.read_csv(url)

X = pd.get_dummies(df[['tenure', 'MonthlyCharges', 'Contract']], drop_first=True)
y = (df['Churn'] == 'Yes').astype(int)

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, stratify=y, random_state=835)

model = LogisticRegression(max_iter=1000).fit(X_train, y_train)
pred = model.predict(X_test)

print(f'Baseline (nobody churns): {1 - y_test.mean():.1%}')
print(f'Model accuracy:           {accuracy_score(y_test, pred):.1%}')
print(confusion_matrix(y_test, pred))

Notice what the split gives you that a spreadsheet cannot: an honest score. The model never saw the 1,409 test customers, so its 79% is a forecast of how it will do on next month's customers — not a memory of last month's. And notice what accuracy hides: the bottom-left cell of that matrix is churners we missed, each one worth $1,500. Session 6 is about that cell.

05 // KEY TAKEAWAYS

What to Remember

Predictive analytics sits between describing the past and prescribing the future: descriptive → predictive → prescriptive. A prediction is only valuable when a decision changes because of it.

The loop is always the same: frame → data → features → model → evaluate → decide → monitor. The framing step (unit, target, horizon, decision) is the one business people skip and the one that matters most.

Accuracy lies. Always ask: compared with what baseline, on which held-out data, and at what cost per mistake? A 'nobody churns' model is 73% accurate and worth nothing.

06 // HOMEWORK

Before Next Session

Complete these before next Monday — they are the practice that makes the next session land.

Before Session 2 (nothing to submit) Open the Session 1 notebook in Colab, run every cell, and try Exercise 1: add three features of your choice and see whether accuracy and the confusion matrix improve. There is no submission — Homework #1 opens in Session 2 and is due Mon Oct 5, and it starts from exactly this notebook. Meanwhile, keep an eye out for a prediction problem from your own work or life; HW1 asks you to frame one.
07 // PRACTICE

Test Yourself

Exam-style questions for the ideas in this session — The Prediction Lifecycle. Every wrong answer names the misconception behind it.

Q01 Four analytics projects on the roadmap. Only one of them predicts. Q02 Unit, target, horizon, decision — the framing step everyone skips. Q03 A model beats "predict the majority" by two points. Is that a win? Q04 Train error falls, test error rises. Name the disease. Q05 Why the single most important line in the notebook is the split. Q06 Stratify or not? A 1% fraud rate makes the answer obvious — once you see it.

All of Foundations →

Coming Next

Session 2: Data Wrangling & EDA for Prediction

Real data arrives in five tables, three date formats, and a thousand missing values. pandas joins, groupbys, and datetime features on the Olist e-commerce dataset — and how to spot the leak that makes a model look brilliant and ship useless.

pandasEDAData Leakage