Week 8 — Predictive Modeling: Regression & Classification

Your launchpad. Specify the model, fit it, then judge it. Here is the path through it.

This is the table of contents for Week 8. The interactives below are self-paced — you drag sliders, toggle predictors, and read live output right in your browser. Walk the five core trainers in order; they build up gently from correlation. The Excel-OLS path is an optional companion. Then the deck, the Lab, and the Homework pull it together.

The AI writes the code. Your judgment is the work.

A model is just prediction = f(inputs) — you fit it, then you judge it. This week you meet two of them: OLS for a continuous answer (how many days a customer takes to pay) and logistic regression for a yes/no answer (does the invoice go bad). The Python that fits them is a few lines an AI will happily write for you. That is not where the points are.

The graded skill is specification — picking the right target and predictors, refusing a feature that leaks the future, spotting when two predictors are really the same thing — plus validation and interpreting the output in accounting terms. The trainers exist to build that judgment, on the Summit Gear customer data you will use all week.

The one idea to leave with — more predictors is not a better model. The centerpiece trainer makes multicollinearity visible: add a redundant predictor and watch a coefficient flip or explode while R-squared barely moves. Learn to read that, and you can defend a model spec to anyone.

Week 8 Interactives

Start at the top and work down. The sequence builds from the root idea — correlation — up to the multicollinearity centerpiece. Most trainers are anchored to the same Summit Gear customers table you fit models on this week.

  1. 1 Correlation The root idea the whole week grows from. Drag a strength slider and flip a sign to feel what the correlation coefficient r is — one number from -1 to +1 for how tightly two things move together — then read r off five real ski and Summit Gear pairs. The Excel tie-in is =CORREL, with a practice workbook to download. Why first: correlation → regression → logistic. Regression turns r into a predictive line; get r right and the next steps are extensions of it.
  2. 2 OLS: how and why What least squares actually does: the line that minimizes squared error. Toggle residuals, read a coefficient as "holding the others fixed, a one-unit rise in X moves predicted Y by b," and see predicted value, residual, and R-squared on Summit Gear days_to_pay. Builds on correlation: in a one-predictor fit the slope is r rescaled and R-squared equals r squared — the trendline from Week 5, now numeric and multi-variable.
  3. 3 Dummy variables & the base case Why a category cannot enter a regression as a raw number. Encode day-of-week two ways on ski-resort visits: as a single day_number (one meaningless slope, a straight line that misses the real shape) versus one-hot dummies with a base case (a coefficient per day, predictions that land). Then trigger the dummy-variable trap on purpose and watch the solve fail. Why it matters: most accounting predictors are categories — region, account type, weekday — and every one needs a base case.
  4. 4 Logistic regression A short on-ramp first — probability is a number 0 to 1, odds are p/(1-p) — then the sigmoid that squashes a linear score into a probability. Read a coefficient as direction of effect (and exp(coef) as an odds multiplier) on defaulted, then move a cutoff slider and read one confusion matrix. Evaluation proper is Week 9. Why it matters: some accounting questions are yes/no, so you need a model that outputs a probability, not a dollar amount.
  5. 5 Feature selection & multicollinearity Toggle predictors in and out of a live OLS on days_to_pay and watch the fitted coefficients, R-squared, adjusted R-squared, and a correlation heatmap move. Add a collinear predictor and see a coefficient blow up while R-squared sits still; a hot off-diagonal cell in the heatmap is the warning sign. Why last: it pulls everything together — correlation, fitting, and reading the output — into the single most important idea of the week. Slow down here.
OLS in Excel: the fast path The same OLS, done fast in Excel: =LINEST(...) and the Data Analysis ToolPak regression on the same Summit Gear data, reading the coefficient and R-squared output, and doing feature selection plus a multicollinearity check with a CORREL matrix. Excel bridge: Python is the spine, but a quick regression in a spreadsheet is a real, fast secondary path — not an afterthought. Pairs with trainer 2 (OLS).

Start at correlation and build up. Feature selection, the last of the five, is the one to slow down on — it pulls fitting, encoding, and reading the output together. The Excel path above is optional.

The deliverables

The trainers are practice. These three are the week itself — the lecture to watch, the Lab to build, and the Homework to submit.

Lecture
Week 8 deck
The interactive slides — trendline to model, OLS, the feature-selection centerpiece, the probability on-ramp, and logistic regression. Start here for the big picture.
Lab (graded)
Lab 8: specify and fit
Fit OLS for days_to_pay, run feature selection and drop a collinear predictor, fit logistic for defaulted, and write the one-paragraph spec. Opens as a Canvas New Quiz with a notebook deliverable.
Homework (graded)
Homework 8: read the output
Interpretation set: read an OLS coefficient table, judge a predictor set for multicollinearity, read a logistic odds ratio and predicted probability, and catch a look-ahead-bias mistake. Opens as a Canvas New Quiz.
How to use this page. Watch the deck for the map. Walk the five trainers top to bottom — they build up from correlation — spending the most time on the feature-selection centerpiece at the end. The Excel-OLS path is optional. Then do the Lab and the Homework, which is where the points are. Keep the AI tutor open the whole time, and remember the split: the AI writes the code, you specify, validate, and interpret.

Week 8 of ACCTG 5150, Accounting Analytics. The trainers compute everything in your browser (nothing leaves your machine).