Recall & Review
beginner
What is a custom transformer in machine learning?
A custom transformer is a user-made tool that changes data in a specific way before using it in a model. It helps prepare or clean data to make the model work better.
Click to reveal answer
beginner
Which two methods must a custom transformer implement in scikit-learn?
A custom transformer must implement
fit() to learn from data and transform() to change the data based on what it learned.Click to reveal answer
intermediate
Why use custom transformers instead of built-in ones?
Custom transformers let you handle special data or do unique changes that built-in transformers can't do. This makes your model better for your specific problem.Click to reveal answer
intermediate
How does a custom transformer fit into a machine learning pipeline?
It acts as a step that changes data before the model sees it. This keeps data preparation organized and repeatable for training and testing.
Click to reveal answer
beginner
What is the purpose of the
fit_transform() method in custom transformers?It combines
fit() and transform() in one step to learn from data and then immediately change it, saving time and code.Click to reveal answer
What method in a custom transformer changes the data?
✗ Incorrect
The transform() method changes the data based on what was learned in fit().
Why might you create a custom transformer?
✗ Incorrect
Custom transformers are made to do special data changes that built-in transformers can't do.
Which scikit-learn class is commonly extended to create a custom transformer?
✗ Incorrect
Extending BaseEstimator and TransformerMixin helps create custom transformers with standard methods.
What does the
fit() method do in a custom transformer?✗ Incorrect
fit() learns from the data to prepare for transformation.
Where in a machine learning workflow is a custom transformer used?
✗ Incorrect
Custom transformers prepare data before it goes into the model.
Explain how to create a custom transformer in scikit-learn and why it is useful.
Think about the methods needed and the role in data preparation.
You got /4 concepts.
Describe the role of custom transformers in a machine learning pipeline and how they improve model building.
Consider the flow of data from raw to model-ready.
You got /4 concepts.