5 b] Explain selecting an algorithm in wrapper method.
In the wrapper method for feature selection, selecting an algorithm involves using a search process to evaluate different subsets of features, often by training and testing a model to determine which subset yields the best performance. There are three common strategies within the wrapper method:
1. Forward Selection:
- Process: Start with no features and progressively add one feature at a time. After each addition, the model is evaluated based on a selection criterion (e.g., accuracy, AIC, BIC, etc.).
- How It Works:
- Begin with an empty model.
- Test all possible single-feature models and select the best one.
- Add the chosen feature and test models with an additional feature.
- Continue adding features until the selection criterion no longer improves.
2. Backward Elimination:
- Process: Start with all features and iteratively remove the least significant feature one at a time. The model is re-evaluated after each removal.
- How It Works:
- Begin with a model that includes all features.
- Remove one feature and test the model.
- Continue removing features that most improve the selection criterion.
- Stop when removing any more features worsens the model’s performance.
3. Combined Approach:
- Process: This is a hybrid method that combines forward selection and backward elimination, focusing on minimizing redundancy while maximizing relevance.
- How It Works:
- Start with the best-performing feature.
- Add a few more highly ranked features.
- Periodically eliminate features that worsen the performance, while continuing to add relevant ones.
- The process stops when the balance between redundancy and relevance is optimized.
This approach allows you to choose the best algorithm by exhaustively or greedily searching through feature subsets, but it can be computationally expensive compared to simpler filter methods.