Data Preprocessing, Feature Engineering, Analysis and Visualisation
Free NVIDIA Generative AI & LLMs (NCA-GENL) practice — 6 questions on Data Preprocessing, Feature Engineering, Analysis and Visualisation, with explanations. No sign-up.
Full 12-question mixed test →
Question 1 of 6 · Data Preprocessing, Feature Engineering, Analysis and Visualisation
A data scientist is analyzing a dataset with 50,000 rows where the target variable 'customer_churn' is imbalanced (5% positive class). After applying SMOTE to balance the classes, the validation accuracy increased from 85% to 92%, but the production model shows significantly worse precision on the minority class. What is the MOST likely cause and appropriate solution?
Data leakage is the most critical issue. When SMOTE is applied before train/test split, synthetic samples in training data may be created using information from test samples, leading to artificially inflated validation metrics that don't translate to production. SMOTE must always be applied only to training data after splitting to prevent leakage.
Question 2 of 6 · Data Preprocessing, Feature Engineering, Analysis and Visualisation
A team is building features for a time-series forecasting model predicting hourly energy consumption. They create a feature 'rolling_mean_24h' using a 24-hour rolling average of consumption. During backtesting on historical data from 2024-2025, the model achieves 98% accuracy, but in production (real-time inference), accuracy drops to 72%. Which implementation error is MOST likely responsible?
The dramatic accuracy drop from backtesting to production is a classic symptom of forward-looking bias (data leakage in time series). When calculating rolling statistics on historical data without proper shifting, the feature at time t includes information from time t+1, t+2, etc. In production, future data isn't available, causing the performance gap. Using .shift(1) or equivalent ensures each rolling feature uses only data available at prediction time.
Question 3 of 6 · Data Preprocessing, Feature Engineering, Analysis and Visualisation
A dataset contains a 'transaction_amount' feature with extreme outliers (99th percentile = $500, max = $2.5M). A data scientist needs to prepare this feature for a gradient boosting model. After comparing four preprocessing approaches on validation data, which approach should be PREFERRED based on typical gradient boosting behavior and robustness requirements?
Providing multiple representations allows tree-based models like gradient boosting to automatically learn the most useful representation for different regions of the data. The original amount preserves true values, log transformation handles magnitude scaling, and the binary flag captures a threshold effect. Gradient boosting models handle mixed-scale features well and benefit from this flexibility. This approach is robust and commonly used in practice for features with complex distributions.
Question 4 of 6 · Data Preprocessing, Feature Engineering, Analysis and Visualisation
A visualization dashboard displays model prediction confidence scores for 10,000 daily transactions. The data science team receives complaints that users cannot identify which predictions need manual review. The current chart shows all 10,000 points as a scatter plot with confidence on the y-axis. Which visualization modification would BEST support the business requirement of identifying review-worthy predictions?
This solution directly addresses the business need: identifying specific transactions for review. The histogram with color-coded thresholds provides quick visual assessment of confidence distribution, while the filtered table enables actionable review by showing specific transaction IDs that need attention. This combines analytical visualization with operational utility, making it actionable not just informative.
Question 5 of 6 · Data Preprocessing, Feature Engineering, Analysis and Visualisation
A feature engineering pipeline creates interaction terms between numerical features 'age' (range: 18-85) and 'income' (range: $15K-$500K) resulting in 'age_x_income' (range: 270K-42.5M). During model training with L2 regularization (alpha=0.01), the coefficient for 'age_x_income' is near zero while individual 'age' and 'income' coefficients are significant. What is the MOST appropriate action?
L2 regularization penalizes coefficients based on their squared magnitude. When features have vastly different scales, regularization disproportionately affects features with larger numerical ranges because their coefficients would naturally be smaller (a coefficient of 0.00001 for 'age_x_income' might represent the same predictive contribution as a coefficient of 0.1 for 'age'). The squared penalty amplifies this disparity. StandardScaler equalizes feature scales so regularization applies fairly across all features, allowing 'age_x_income' to demonstrate its true predictive value.
Question 6 of 6 · Data Preprocessing, Feature Engineering, Analysis and Visualisation
A data analysis reveals that a categorical feature 'product_category' with 150 unique values has a correlation coefficient of 0.89 with the target variable after applying target encoding (mean target value per category). The model validation AUC is 0.94, but when deployed to production with new data from different regions, AUC drops to 0.68. What is the PRIMARY issue and correct remediation?
The symptom—good validation performance but poor production performance across different regions—strongly indicates data leakage. When target encoding is applied before splitting, test set categories are encoded using statistics that include test set target values. This artificially inflates validation performance. In production with truly unseen data, this leaked information isn't available, causing the performance drop. Correct implementation computes encoding statistics only from training data and applies those statistics to validation/test/production data.
Ready for the real thing?
The full course: two full-length practice tests, video lessons for every exam domain, hands-on labs and detailed explanations.
$54.99$17.99 with code FREETEST33 — valid through August 23.