CASE STUDY 01 · END-TO-END MACHINE LEARNING

Core ML Logistic Regression + Pipeline

Student Placement Outcome Modeling

Develop a reproducible classification workflow using synthetic records, a protected test set, an honest baseline and validation-based threshold selection.

01 · PROBLEM FRAMING

Predict a label only after defining its purpose

The educational task estimates whether a synthetic student record receives a placement outcome. The model is intended to demonstrate classification—not to approve, reject or rank real students. Its target is binary: placed or not placed. Its features describe academic and preparation measures available before the outcome.

Responsible-use boundary: Historical placement labels reflect opportunity, company criteria and institutional processes—not ability alone. A real model could reproduce past inequality. Use this project for learning and student-support research only, never as an employment decision-maker.

Prediction unit

One synthetic student record.

Positive class

A placement outcome is recorded.

Model output

Probability plus a chosen threshold.

02 · DATA DESIGN

Synthetic data makes the teaching assumptions visible

The program generates 900 reproducible rows using a fixed random seed. Features are CGPA, aptitude, coding, communication, projects, internships and backlogs. A hidden probabilistic formula produces labels, then 3% missing values are added to aptitude and coding so the pipeline must impute them.

FeatureType/rangeAvailabilityReason included
CGPAContinuous, 4.5–10Before placementAcademic record
Aptitude/coding/communicationScores, boundedBefore outcomePreparation measures
Projects/internships/backlogsCountsBefore outcomeExperience and academic state

Because the dataset is synthetic, its coefficients and accuracy do not describe a real college. Its advantage is instructional control: learners know how the target was generated and can test whether the workflow recovers useful signal.

03 · SPLITTING & LEAKAGE

The test set must remain untouched until the final audit

The full data is split into 60% training, 20% validation and 20% testing using stratification. Training estimates model parameters. Validation compares thresholds. Testing is opened once to estimate final generalization.

  1. Split development data from the final test set.
  2. Split development into training and validation.
  3. Fit median values, scaling statistics and model coefficients using training only.
  4. Select the threshold using validation predictions.
  5. Evaluate the chosen workflow once on test data.
Leakage examples: Including offer status, final company name or a post-placement survey directly reveals the target. Fitting imputation or scaling on all rows also lets test distribution influence training. A scikit-learn Pipeline prevents that preprocessing leakage.
04 · MODEL PIPELINE

Preprocessing and prediction form one fitted object

numeric features
  → median imputation
  → standard scaling
  → class-balanced logistic regression
  → probability

Logistic regression is selected because it produces probabilities and supports coefficient inspection. Standardization puts features on comparable scales. Class weights reduce the tendency to ignore the less frequent positive class. This does not guarantee fairness or calibration; it only changes the loss contribution of the classes.

A most-frequent DummyClassifier is the baseline. It can achieve seemingly respectable accuracy by predicting the majority class while producing zero recall for placed students. A model is useful only when it improves the metrics connected to the task.

05 · METRICS & THRESHOLD

A probability becomes a class only after a decision rule

MetricQuestion answeredFailure if used alone
AccuracyWhat fraction is correct?Can hide minority-class failure
PrecisionOf predicted positives, how many are positive?Can improve by predicting very few positives
RecallOf actual positives, how many are found?Can improve with many false alarms
F1What is the harmonic balance?Ignores true negatives
ROC-AUCHow well are classes ranked across thresholds?Does not select an operating threshold

The program tests thresholds from 0.25 through 0.70 on validation data, requires recall of at least 0.70 when possible and chooses the best F1 among acceptable candidates. The test set is not used for that decision.

06 · COMPLETE IMPLEMENTATION

Reproducible Python program

programs/placement-outcome-model.py
Loading source…

Install packages from programs/requirements.txt. The program generates its own data, so no external file is needed. Each run uses the same random state, making the split, fitted model and printed results reproducible for discussion.

07 · INTERACTIVE TRACING

Trace one leakage-safe experiment

  1. Create data.
  2. Protect test data.
  3. Build development splits.
  4. Train pipeline.
  5. Compare thresholds.
  6. Freeze threshold.
  7. Final evaluation.
  8. Interpret cautiously.
Current state

Press Next to begin.

08 · TEST & ERROR ANALYSIS

Test the workflow, not only the function calls

Reproducibility
Run twice and confirm label rate, selected threshold and metrics remain identical.
Pipeline isolation
Confirm imputer medians and scaler statistics are fitted only from training rows.
Baseline challenge
Verify the majority baseline has zero positive recall, showing why accuracy alone is inadequate.
Threshold rule
Recalculate each validation row and verify the selected threshold obeys the recall constraint and tie-break.
Feature removal
Remove one feature, rerun the complete experiment and report whether the change exceeds normal split variation.
09 · LIMITATIONS & NEXT STEPS

A demonstration model is not a deployable decision system

  • Synthetic relationships are chosen by the programmer and cannot establish real-world validity.
  • Coefficients are associations conditional on the included features; they do not prove causation.
  • A real dataset may shift across batches, programs, companies and economic periods.
  • Probability calibration, subgroup error analysis and privacy review are not optional in deployment.
  • Training-support use still requires consent, access control, appeal and human review.

A responsible next experiment would define a support-only outcome, collect documented consented data, establish a temporal test split, audit missingness, compare calibrated models and monitor drift after deployment.

10 · PRACTICE

Check the experimental reasoning

Which split should choose the classification threshold?

Why train a DummyClassifier?

Extensions

  1. Add calibrated probabilities and compare reliability diagrams.
  2. Compare logistic regression with a pruned decision tree.
  3. Replace random split with a semester-based temporal split.
  4. Create a model card containing intended use, metrics and limitations.
11 · INTERVIEW PREPARATION

Defend every experimental choice

Why is preprocessing inside a Pipeline?

Cross-validation or fitting applies each transformation using training data only, preventing information from validation or test rows entering learned preprocessing statistics.

Why can high accuracy be misleading?

When one class dominates, predicting only that class can be accurate while failing every minority example. The printed baseline demonstrates this directly.

Can coefficients identify what causes placement?

No. They describe adjusted associations in this synthetic model. Confounding, feature correlation, selection processes and the generated label mechanism prevent causal claims.

What would change for production?

Data contracts, temporal validation, calibration, fairness and privacy review, versioned artifacts, monitored serving, drift alerts, rollback and human oversight are required.

12 · KEY TAKEAWAY

The experimental boundary is part of the model

A classifier is not just an algorithm. Data timing, leakage control, baseline comparison, threshold policy, error costs and responsible-use limits determine whether its evaluation deserves trust.