Build an end-to-end ML classification pipeline
NextdoorMachine Learning Engineer · Technical ScreenLast updated
This question evaluates a candidate's competency in building end-to-end tabular classification pipelines, including data loading and splitting, missing-value handling, categorical encoding, feature scaling, model training and comparison, hyperparameter tuning, metric-based evaluation, model persistence, and batch inference.
Given a tabular dataset in a CSV file, implement an end-to-end pipeline to perform a classification task. Requirements: (
- load the data; (
- create stratified train/validation/test splits; (
- handle missing values and encode categorical features; (
- standardize numeric features; (
- train a simple baseline (e.g., logistic regression) and at least one stronger model (e.g., gradient boosting or a small neural network); (
- tune key hyperparameters with cross-validation; (
- report accuracy, precision, recall, and ROC-AUC on validation and test; (
- persist the trained model and preprocessing steps; (
- implement batch inference via a predict(input_csv_path, output_csv_path) function or CLI. If using a neural network, write a correct training loop with optimizer initialization, forward pass, loss computation, backward pass, and an explicit optimizer step. Briefly explain design choices and how you would productionize this pipeline.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.