Recall & Review
beginner
What are interaction features in data science?
Interaction features are new variables created by combining two or more existing features to capture relationships between them that might affect the target variable.
Click to reveal answer
beginner
Why do we create interaction features?
We create interaction features to help models learn complex relationships between variables that single features alone might miss, improving prediction accuracy.
Click to reveal answer
beginner
How can you create an interaction feature between two numeric columns in Python using pandas?
You can multiply the two columns to create an interaction feature. For example: df['interaction'] = df['feature1'] * df['feature2']
Click to reveal answer
intermediate
What is a simple example of an interaction feature involving categorical variables?
You can combine two categorical variables by concatenating their values as strings, like df['interaction'] = df['cat1'] + '_' + df['cat2'], to capture combined categories.
Click to reveal answer
intermediate
What should you be careful about when creating many interaction features?
Creating too many interaction features can lead to overfitting and increase model complexity, so it's important to select meaningful interactions and possibly use feature selection.
Click to reveal answer
What does an interaction feature represent?
✗ Incorrect
Interaction features combine existing features to capture relationships that affect the target variable.
Which operation is commonly used to create interaction features between numeric columns?
✗ Incorrect
Multiplying numeric columns is a common way to create interaction features.
How can you create an interaction feature from two categorical columns in pandas?
✗ Incorrect
Concatenating string values from categorical columns creates combined category features.
What is a risk of creating many interaction features?
✗ Incorrect
Too many interaction features can cause overfitting and make the model more complex.
Which of these is NOT a reason to create interaction features?
✗ Incorrect
Creating interaction features usually increases dataset size, not reduces it.
Explain what interaction features are and why they are useful in data science.
Think about how combining features can reveal new patterns.
You got /4 concepts.
Describe how to create interaction features for numeric and categorical data using pandas.
Consider simple operations like multiplication and string joining.
You got /4 concepts.