Recall & Review
beginner
What is a Feature Union in machine learning?
Feature Union is a technique that combines multiple feature extraction processes into one. It joins different sets of features side by side to create a bigger feature set for a model.
Click to reveal answer
beginner
Why use Feature Union instead of just one feature extractor?
Using Feature Union lets you combine different types of features that capture different information. This can help the model learn better by having more diverse data.
Click to reveal answer
intermediate
How does Feature Union work internally?
Feature Union runs each feature extractor separately on the input data, then stacks their outputs horizontally (side by side) to form one combined feature matrix.
Click to reveal answer
intermediate
Give a simple example of using Feature Union in Python with scikit-learn.
You can combine a text vectorizer and a numeric scaler like this: FeatureUnion([('text', CountVectorizer()), ('num', StandardScaler())]). This creates features from text and numbers together.
Click to reveal answer
intermediate
What is the difference between Feature Union and Pipeline in scikit-learn?
Feature Union combines features from parallel transformers side by side. Pipeline applies transformers sequentially, one after another, transforming data step by step.
Click to reveal answer
What does Feature Union do with the outputs of multiple feature extractors?
✗ Incorrect
Feature Union stacks outputs horizontally, combining features side by side.
Which scikit-learn class is used to perform Feature Union?
✗ Incorrect
FeatureUnion is the class designed to combine multiple feature extractors.
Feature Union is most useful when:
✗ Incorrect
Feature Union helps combine different feature sets extracted in parallel.
What is the main difference between Feature Union and Pipeline?
✗ Incorrect
Feature Union merges features horizontally; Pipeline chains transformations vertically.
If you want to combine text features and numeric features for a model, which technique is best?
✗ Incorrect
Feature Union allows combining different feature types into one feature set.
Explain in your own words what Feature Union is and why it is useful in machine learning.
Think about how combining different views of data can help a model.
You got /4 concepts.
Describe the difference between Feature Union and Pipeline in scikit-learn.
Consider how data flows through each.
You got /4 concepts.