How do you define the search space when selecting between fundamentally different model types in a single pipeline?
Quick Overview
Asks how to define one hyperparameter search space that chooses among very different model types, such as an SVM, boosted trees and an MLP, in a single pipeline. Tests conditional search spaces, library support, optimizer choice and fair comparison across model families.
How do you define the search space when selecting between fundamentally different model types in a single pipeline?
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Other
How do you define the search space when selecting between fundamentally different model types in a single pipeline?
For example, one hyperparameter search should choose among logistic regression, an SVM, gradient-boosted trees and an MLP, and tune whichever model it picks.
```hint Look at which parameters exist
Some hyperparameters only make sense for one model, and some only for one setting of another hyperparameter. Think about a structure that encodes those dependencies.
```
```hint Think about the optimizer and the budget
Ask how a Bayesian optimizer models a space where the set of active dimensions changes from trial to trial, and how a fixed number of trials spreads across model families of very different sizes.
```
### What a Strong Answer Covers
- How the space is structured so each model's hyperparameters appear only when that model is chosen, including nested conditions inside one model.
- How preprocessing steps depend on the model choice.
- How at least one common library expresses such a space.
- Which search algorithms cope with conditional dimensions, and why some do not.
- How to keep the comparison between model families fair.
### Follow-up Questions
- The best cross-validation score from 300 trials across four model families is reported as the expected production performance. What is wrong with that, and how do you fix it?
- How would you split a trial budget between an MLP branch with eight hyperparameters and a logistic regression branch with one?
- Why does a standard Gaussian-process optimizer struggle with this space, and how do TPE and SMAC avoid the problem?
- When would you skip the joint search and tune each model family separately?
Overview: Asks how to define one hyperparameter search space that chooses among very different model types, such as an SVM, boosted trees and an MLP, in a single pipeline. Tests conditional search spaces, library support, optimizer choice and fair comparison across model families.
How do you define the search space when selecting between fundamentally different model types in a single pipeline?
For example, one hyperparameter search should choose among logistic regression, an SVM, gradient-boosted trees and an MLP, and tune whichever model it picks.
What a Strong Answer Covers Guidance
How the space is structured so each model's hyperparameters appear only when that model is chosen, including nested conditions inside one model.
How preprocessing steps depend on the model choice.
How at least one common library expresses such a space.
Which search algorithms cope with conditional dimensions, and why some do not.
How to keep the comparison between model families fair.
Follow-up Questions Guidance
The best cross-validation score from 300 trials across four model families is reported as the expected production performance. What is wrong with that, and how do you fix it?
How would you split a trial budget between an MLP branch with eight hyperparameters and a logistic regression branch with one?
Why does a standard Gaussian-process optimizer struggle with this space, and how do TPE and SMAC avoid the problem?
When would you skip the joint search and tune each model family separately?