Critique and Test Python Preprocessing Utilities Effectively
Capital OneData Scientist · Technical ScreenLast updated
This question evaluates a candidate's ability to review and critique Python preprocessing utilities, covering competencies in software design patterns (fit/transform separation), coding style and import hygiene, and unit-test specification for data-science pipelines.
Scenario
Code review of Python preprocessing utilities (OutlierHandler and three Imputer classes)
Question
Summarize, at a high level, what the OutlierHandler class accomplishes. Why is keeping fit and transform as separate methods advantageous? Identify and critique any coding-style or import problems found in the three Imputer classes. Hand-write one critical unit test you would add for OutlierHandler.
Hints
Think scikit-learn patterns, PEP-8, avoiding "from numpy import *", assert expected vs. actual.
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.