Katkat

Evaluate OutlierHandler Class for Code Quality and Testing

Capital OneData Scientist · Onsite

Last updated

Evaluates code-review judgment for OutlierHandler and imputer preprocessing classes in ML pipelines. Strong answers explain fit-transform separation, leakage prevention, API quality, edge cases, and testing.

Scenario

Code-review of two Python preprocessing components: an OutlierHandler class and three Imputer classes

Question

Give a high-level summary of what the OutlierHandler class does. Why is it beneficial to separate fit and transform into two methods in this context? Point out any coding-style or maintainability issues you observe in the file (naming, docstrings, magic numbers, etc.). Write the single most critical unit test you would add for the OutlierHandler. For the three imputation classes, describe their overall purpose and identify at least two style problems (e.g., use of from numpy import *).

Hints

Relate your answers to the scikit-learn transformer API, unit-testing best practices, and PEP-8.