Feature engineering for numerical and categorical variables: Practice Questions — Data Manipulation and Preparation (NVIDIA-Certified Associate: Accelerated Data Science)
Practice Questions: Feature Engineering for Numerical and Categorical Variables Feature engineering is a critical skill tested in the...
Practice Questions: Feature Engineering for Numerical and Categorical Variables
Feature engineering is a critical skill tested in the NVIDIA-Certified Associate: Accelerated Data Science exam, especially for numerical and categorical variables. Below are multiple-choice questions designed to help you prepare effectively.
Which technique is most appropriate for converting a categorical variable with no intrinsic order into a format suitable for machine learning models?
- A) Label Encoding
- B) One-Hot Encoding
- C) Min-Max Scaling
- D) Principal Component Analysis (PCA)
Correct Answer: B) One-Hot Encoding
Explanation: One-Hot Encoding creates binary columns for each category, preserving the nominal nature without implying order, unlike Label Encoding which assigns arbitrary numeric values.
When dealing with a numerical feature that has a highly skewed distribution, which transformation is commonly applied to improve model performance?
- A) Logarithmic Transformation
- B) One-Hot Encoding
- C) Label Encoding
- D) Synthetic Minority Over-sampling Technique (SMOTE)
Correct Answer: A) Logarithmic Transformation
Explanation: Log transformation reduces skewness by compressing large values, making the distribution more normal-like, which benefits many algorithms.
Which method is best suited for encoding an ordinal categorical variable, such as education level (e.g., High School, Bachelor, Master, PhD)?
- A) One-Hot Encoding
- B) Label Encoding
- C) Binning
- D) Min-Max Scaling
Correct Answer: B) Label Encoding
Explanation: Label Encoding assigns integer values that reflect the order inherent in ordinal variables, preserving their ranking.
In the context of GPU-accelerated data science, which library is optimized for efficient feature engineering on large datasets with categorical variables?
- A) pandas
- B) cuDF
- C) NumPy
- D) Matplotlib
Correct Answer: B) cuDF
Explanation: cuDF is a GPU-accelerated DataFrame library designed to handle large-scale data manipulation and feature engineering efficiently on NVIDIA GPUs.
Which feature engineering technique helps reduce dimensionality when dealing with high-cardinality categorical variables?
- A) Frequency Encoding
- B) One-Hot Encoding
- C) Label Encoding
- D) Synthetic Data Generation
Correct Answer: A) Frequency Encoding
Explanation: Frequency Encoding replaces categories with their frequency counts, reducing the number of features compared to One-Hot Encoding, which can create many sparse columns.
What is the primary purpose of binning numerical variables during feature engineering?
- A) To convert numerical data into categorical data
- B) To increase the number of features
- C) To normalize the data
- D) To generate synthetic samples
Correct Answer: A) To convert numerical data into categorical data
Explanation: Binning groups continuous numerical values into discrete intervals, which can help capture nonlinear relationships and reduce noise.
Which technique is effective for handling missing values in categorical variables before feature encoding?
- A) Imputing with the mode
- B) Dropping the entire feature
- C) Logarithmic Transformation
- D) Min-Max Scaling
Correct Answer: A) Imputing with the mode
Explanation: Imputing missing categorical data with the mode (most frequent category) maintains data integrity and prepares the feature for encoding.
Why is feature scaling generally not applied to categorical variables?
- A) Because categorical variables have no numeric meaning
- B) Because scaling is computationally expensive
- C) Because it improves model accuracy
- D) Because it reduces dimensionality
Correct Answer: A) Because categorical variables have no numeric meaning
Explanation: Scaling applies to numerical features to normalize ranges; categorical variables represent discrete classes without inherent numeric scale, so scaling is inappropriate.
More in this topic
Ready to test your knowledge?
Put what you've learned into practice with a quick quiz and track your progress.
Test your knowledge →