Tutorial
Hub
Atlas · 51 trails
My expedition
Trail Atlas
Swiss Index
← 03 Data Prep & Feature Engineering
Area 03 test · Core ML
Data Prep & Feature Engineering
20 questions · 70% to pass · no time limit. You see the right answers and why after you submit.
1
What should be your first step with a new dataset?
Train a baseline model
Explore shape, types, missing values and the target
Scale every column
Remove all outliers
2
Which column is target leakage for a churn model?
tenure_months
support_calls
refund_issued (set after a customer leaves)
plan
3
Why drop customer_id as a feature?
It is text
It is unique per row and carries no generalizable pattern
It has missing values
It is categorical
4
A right-skewed numeric column has missing values. Best simple fill?
mean
median
zero
maximum
5
When is a missing indicator most useful?
Values are missing completely at random
The fact of being missing relates to the outcome
The column has no missing values
Always instead of imputation
6
Q1 = 20, Q3 = 40. The IQR upper fence is…
60
70
80
50
7
A customer spends 100× the average and the value is real. Reasonable treatment?
Delete the row
Keep it, but clip or log-transform, or use a tree model
Replace it with the mean
Set it to missing
8
A 'region' column with north/south/east/west for logistic regression should be…
ordinal-encoded 0–3
one-hot encoded
dropped
standard-scaled
9
Ordinal encoding is appropriate for…
city names
t-shirt sizes small/medium/large
product ids
colours
10
What does OneHotEncoder(handle_unknown="ignore") do with a category never seen in training?
Raises an error
Encodes it as all zeros
Adds a new column
Maps it to the most frequent category
11
Which model does NOT need feature scaling?
k-nearest neighbours
logistic regression with regularization
random forest
neural network
12
After StandardScaler on training data, each column has…
min 0 and max 1
mean 0 and standard deviation 1
median 0 and IQR 1
values between −1 and 1
13
Why might min-max scaling be a poor choice with outliers?
It is slower
One extreme squashes all other values into a tiny range
It changes the order of values
It only works for categories
14
What is wrong with fitting a scaler on all rows and then splitting?
Nothing
Test-set statistics leak into training (contamination)
It makes training slower
It changes the target
15
The correct order is…
fit scaler → split → train
split → fit scaler on train → transform train and test
split → fit scaler on test → transform
transform → split → fit
16
Churn is 30% of rows. Why stratify the split?
To make training faster
To keep about 30% churn in both train and test
To remove outliers
To shuffle columns
17
You predict next month's sales from two years of daily data. How should you split?
Random 80/20
Train on earlier dates, test on the latest period
Stratify by weekday
Use only the test set
18
Why put preprocessing inside a scikit-learn Pipeline for cross-validation?
It looks tidier
Preprocessing is refitted inside each fold, so held-out rows never leak into fitting
It removes the need for a test set
It scales the target
19
Several rows belong to the same customer. Which splitter avoids that customer appearing in both train and test?
KFold
StratifiedKFold
GroupKFold
TimeSeriesSplit
20
In the lab, removing refund_issued drops the test AUC from about 0.94 to about 0.77. What does that mean?
The fix made the model worse
The 0.94 was inflated by leakage; 0.77 is the honest estimate
AUC is unreliable
You should keep the leaky column
0 of 20 answered
Submit answers