Tutorial
Hub
Atlas · 51 trails
My expedition
Trail Atlas
Swiss Index
← 04 Supervised Learning with scikit-learn
Area 04 test · Core ML
Supervised Learning with scikit-learn
20 questions · 70% to pass · no time limit. You see the right answers and why after you submit.
1
Why train a baseline before any real model?
It is required by scikit-learn
It sets the minimum score a useful model must beat
It speeds up training
It removes outliers
2
70% of customers stay. A most-frequent baseline's accuracy is…
0.30
0.50
0.70
1.00
3
Linear regression chooses w and b to minimise…
the number of misclassified rows
the sum of squared residuals
the largest residual
the Gini impurity
4
Logistic regression outputs…
a real-valued prediction like a price
a probability between 0 and 1 for the positive class
a decision tree
cluster labels
5
In LogisticRegression, a smaller C means…
weaker regularization
stronger regularization
more trees
a higher threshold
6
Coefficients of a logistic regression can be compared as importances when…
features are standardized
features are unscaled
the model is a tree
there is no intercept
7
Gini impurity of a node with 25 churners and 75 stayers is…
0.25
0.375
0.5
0.75
8
A decision tree picks a split that…
has the most rows on the left
most reduces weighted impurity of the children
uses the alphabetically first feature
maximises the number of leaves
9
Train AUC 1.00, test AUC 0.59 for a tree. This is…
underfitting
overfitting
data leakage
a perfect model
10
Which change reduces a tree's overfitting?
max_depth=None
smaller min_samples_leaf
limiting max_depth or raising min_samples_leaf
more features
11
Do decision trees need feature scaling?
Yes, always
No — splits are unaffected by monotonic rescaling
Only for categorical features
Only when using Gini
12
A random forest reduces variance by…
training trees in sequence on residuals
averaging many trees trained on bootstrap samples with random feature subsets
using a single very deep tree
scaling the inputs
13
Gradient boosting builds trees…
independently in parallel
in sequence, each fitting the errors of the ensemble so far
only of depth 20+
without a loss function
14
Lowering the boosting learning rate usually requires…
fewer trees
more trees
no trees
deeper data
15
Why prefer permutation importance over impurity-based feature_importances_?
It is faster
It is measured on held-out data and is not biased toward high-cardinality features
It works only for linear models
It needs no fitted model
16
roc_auc_score should be given…
predict(X) labels
predict_proba(X)[:, 1] scores
the training labels twice
the feature matrix
17
In scikit-learn, parameters learned during fit are…
set in the constructor
stored in attributes ending with an underscore, e.g. coef_
the same as hyperparameters
only available for trees
18
Inside Pipeline([("pre", ...), ("clf", RandomForestClassifier())]), the grid key for max_depth is…
max_depth
clf.max_depth
clf__max_depth
RandomForestClassifier__max_depth
19
Why save the whole Pipeline with joblib, not just the classifier?
It's smaller
Serving must apply the exact same preprocessing that training used
joblib can't save classifiers
It improves accuracy
20
In the lab the forest's accuracy (0.710) is close to the baseline's (0.700) but its AUC is far higher (0.758 vs 0.500). Why?
AUC is broken
Accuracy at a 0.5 threshold is dominated by the majority class; AUC measures ranking across all thresholds
The forest is overfitting
The baseline is cheating
0 of 20 answered
Submit answers