Feature Subset Optimization I: Search Space Modeling and Feasibility Checks

Intermediate Combinatorial Search in DS
Created by Pavel · 12.03.2026 at 07:54 UTC · 1 completed

Case setup:
A classifier has n candidate features. Each feature can be included or excluded, so the exact subset-search space is 2^n.

Why modeling comes first:
- estimate combinatorial cost before training,
- identify when brute force is impossible,
- decide between exact, heuristic, or hybrid search.

Examples:
- n=12 -> 4096 subsets,
- n=25 -> 33,554,432 subsets.

Practical constraints to include in model:
- max training time,
- max number of selected features,
- fairness and interpretability constraints,
- minimum acceptable validation score.

Edge cases:
- objective computed on unstable split,
- data leakage during feature selection,
- compute budget underestimated by per-subset CV cost.

University approvals: 0
Tasks
Question 1

For binary include/exclude feature decisions, what is the exact number of candidate subsets?

Hint

Each feature has 2 independent states.

Question 2

Code task: implement subset_space_size(n_features).

def subset_space_size(n_features):
    # TODO

Submission format: submit the full function snippet shown above with # TODO replaced.

Hint

Use exponentiation with base 2.

Starter code is prefilled; replace TODO blocks with your solution.
2 test cases will be used for grading
Run checks runtime behavior only. Final correctness is evaluated when you submit.
Question 3

If each subset evaluation takes 0.2 seconds, approximately how long is exhaustive search for 4096 subsets?

Hint

Compute 4096 * 0.2 seconds, then convert.

Question 4

Code task: estimate exhaustive runtime in seconds.

def exhaustive_runtime_seconds(n_features, eval_time_seconds):
    # TODO

Submission format: submit a full function definition def exhaustive_runtime_seconds(...): ....

Hint

Multiply subset count by per-subset evaluation time.

Starter code is prefilled; replace TODO blocks with your solution.
2 test cases will be used for grading
Run checks runtime behavior only. Final correctness is evaluated when you submit.
Card Info
  • Topic: Combinatorial Search in DS
  • Difficulty: Intermediate
  • Completed: 1 users
Creator
Pavel
Pavel