The Datasets
Eight datasets carry the course. Each one loads with the snippet below in any Colab notebook, and each comes with the trap that catches first-time modelers.
The course's home dataset. Clean enough to model in twelve lines, rich enough for feature engineering, and the one we use to turn scores into a retention decision.
Gotcha: TotalCharges is read as text — 11 blank strings for brand-new customers. Coerce with pd.to_numeric(errors='coerce').
URL = 'https://raw.githubusercontent.com/harslan/isom-835/master/public/data/telco_churn.csv' df = pd.read_csv(URL) df['TotalCharges'] = pd.to_numeric(df['TotalCharges'], errors='coerce') y = (df['Churn'] == 'Yes').astype(int)
Hotel Booking Demand
The midterm competition dataset and the tree/boosting workhorse. Big enough that early stopping and GroupKFold matter.
Gotcha: reservation_status and reservation_status_date ARE the outcome. assigned_room_type is known only at check-in. Drop all three.
URL = 'https://raw.githubusercontent.com/harslan/isom-835/master/public/data/hotel_bookings.csv' df = pd.read_csv(URL) LEAKS = ['reservation_status', 'reservation_status_date', 'assigned_room_type'] X, y = df.drop(columns=['is_canceled'] + LEAKS), df['is_canceled']
The regression classic: skewed target, mixed types, many categoricals. Ridge and lasso shine; a permanent Kaggle leaderboard to check yourself against.
Gotcha: Model log1p(price) and expm1 the predictions before reporting errors in dollars.
from sklearn.datasets import fetch_openml
ames = fetch_openml('house_prices', as_frame=True)
X, y = ames.data.drop(columns=['Id']), ames.target Default of Credit Card Clients (Taiwan)
Credit risk with a real base rate and a cost matrix that makes the threshold discussion concrete. Payment-status codes reward feature engineering.
Gotcha: OpenML column names are x1…x23; map them to the UCI documentation. Payment status columns work better as categories than as numbers.
from sklearn.datasets import fetch_openml credit = fetch_openml(data_id=42477, as_frame=True) X, y = credit.data, (credit.target == '1').astype(int)
Ten categorical columns make it the encoder playground — and it contains the most famous leak in tabular ML.
Gotcha: duration (V12) is call length, known only after the call. Drop it, or your model is a fortune-teller.
from sklearn.datasets import fetch_openml
bank = fetch_openml('bank-marketing', version=1, as_frame=True)
X = bank.data.drop(columns=['V12']) # V12 = duration: leakage
y = (bank.target == '2').astype(int) Online Retail II
A million real transactions collapse into RFM profiles — the segmentation dataset.
Gotcha: Invoices starting with C are cancellations; drop them and rows without a Customer ID. The zip contains one xlsx with two sheets.
import io, zipfile, urllib.request
z = zipfile.ZipFile(io.BytesIO(urllib.request.urlopen('https://archive.ics.uci.edu/static/public/502/online+retail+ii.zip').read()))
sheets = pd.read_excel(io.BytesIO(z.read([n for n in z.namelist() if n.endswith('.xlsx')][0])), sheet_name=None)
tx = pd.concat(sheets.values(), ignore_index=True) Bike Sharing (Capital Bikeshare, hourly)
Strong daily and weekly seasonality, weather covariates, holidays — everything a forecasting lesson needs.
Gotcha: Some hours are missing; call asfreq('h') and interpolate before building lags. Never split randomly.
import io, zipfile, urllib.request
z = zipfile.ZipFile(io.BytesIO(urllib.request.urlopen('https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip').read()))
bike = pd.read_csv(io.BytesIO(z.read('hour.csv'))) Amazon Polarity (reviews)
Text as features three ways: TF-IDF, sentence embeddings, zero-shot LLM labels.
Gotcha: Needs the datasets library (pip install datasets). Fallback in the notebook: sklearn's 20 newsgroups.
from datasets import load_dataset
ds = load_dataset('fancyzhx/amazon_polarity', split='train[:5000]')
texts, labels = ds['content'], ds['label'] Eight more that work well
Public, well documented, and business-shaped. Frame the decision first — a Kaggle metric is not a deliverable.