PythonTutorials.net
Toggle Menu
Home
Online Python Compiler
Tutorials
Django
Flask
Scikit-Learn
NumPy
NLTK
Pillow
Blog
All Posts
Feature Engineering in Scikit-Learn
Test your ability to preprocess,scale,and select relevant features for ML models.
1. Which Scikit-Learn transformer is used for one-hot encoding categorical features?
LabelEncoder
OneHotEncoder
StandardScaler
SimpleImputer
2. Which of the following are valid imputation transformers in Scikit-Learn?
SimpleImputer
KNNImputer
RobustScaler
IterativeImputer
3. StandardScaler is appropriate for features with outliers, as it is robust to extreme values.
True
False
4. Name the Scikit-Learn class that chains multiple transformers into a single object (full name)
5. What does the MinMaxScaler transformer do?
Scales features to have zero mean and unit variance
Scales features to a specified range (default [0,1])
Encodes categorical variables into integers
Imputes missing values with the median
6. Select all Scikit-Learn classes that can be used for scaling numerical features.
StandardScaler
MinMaxScaler
RobustScaler
OneHotEncoder
7. The fit() method of a transformer learns parameters from the training data, while transform() applies those parameters to new data.
True
False
8. What is the abbreviation for the technique that replaces missing values with the most frequent value in a column? (abbrev.)
9. Which class in Scikit-Learn allows applying different transformers to different columns of a DataFrame?
Pipeline
ColumnTransformer
FeatureUnion
StandardScaler
10. Name the Scikit-Learn transformer that scales features using median and IQR to be robust against outliers (full name)
Reset
Answered 0 of 0 — 0 correct