Normalize targets for multitask regression
StripeMachine Learning Engineer · Technical ScreenLast updated
This question evaluates proficiency in multitask regression, preprocessing, and loss engineering within the Machine Learning domain, focusing on handling heterogeneous target distributions, sign-constrained labels, normalization, balanced loss combination, and mapping predictions back to original units at inference.
You are training one machine learning model with a shared representation and two regression heads. Each example has two continuous labels:
- Target A is always non-positive, such as a loss or negative value.
- Target B is always non-negative, such as revenue or a positive value.
The absolute ranges of the two targets are very different. For example, Target A may range from -10,000 to 0, while Target B may range from 0 to 50.
Design the preprocessing and training objective for learning both regression tasks at the same time. Explain how you would handle the negative target, normalize the two targets, combine the losses, and convert predictions back to the original units at inference time. Discuss common pitfalls.
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.