Skip to content

Commit 3cfb6fc

Browse files
committed
Update quizzes
1 parent f51c4e6 commit 3cfb6fc

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

jupyter-book/predictive_modeling_pipeline/03_categorical_pipeline_quiz_m1_03.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ _Select all answers that apply_
1313
+++
1414

1515
```{admonition} Question
16-
Ordinal variables are:
16+
An ordinal variable:
1717
18-
- a) categorical variables with a large number of possible categories
19-
- b) typically represented by integers or string labels
20-
- c) categorical variables with a meaningful order
18+
- a) is a categorical variable with a large number of different categories;
19+
- b) can be represented by integers or string labels;
20+
- c) is a categorical variable with a meaningful order.
2121
2222
_Select all answers that apply_
2323
```
2424

2525
+++
2626

2727
```{admonition} Question
28-
One-hot encoding will:
28+
One-hot encoding:
2929
30-
- a) encode a single string-encoded column into a single integer coded column
31-
- b) transform a numerical variable into a categorical variable
32-
- c) create one additional column for each possible category
33-
- d) transform string variable onto numerical representation
30+
- a) encodes each column with string-labeled values into a single integer-coded column
31+
- b) transforms a numerical variable into a categorical variable
32+
- c) creates one additional column for each possible category
33+
- d) transforms string-labeled variables using a numerical representation
3434
3535
_Select all answers that apply_
3636
```

jupyter-book/trees/trees_quiz_m5_03.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ _Select a single answer_
1414
+++
1515

1616
```{admonition} Question
17-
Decision trees are capable of:
17+
Decision tree regressors can predict:
1818
19-
- a) interpolating and extrapolating
20-
- b) only interpolating
21-
- c) only extrapolating
19+
- a) any values, including values larger or smaller than those observed in `y_train`;
20+
- b) only values in the range from `np.min(y_train)` to `np.max(y_train)`.
2221
2322
_Select a single answer_
2423
```

jupyter-book/trees/trees_wrap_up_quiz.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ and evaluate them by 10-fold cross-validation.
3737

3838
Thus, use `sklearn.linear_model.LinearRegression` and
3939
`sklearn.tree.DecisionTreeRegressor` to create the models. Use the default
40-
parameters for both models.
40+
parameters for the linear regression and set `random_state=0` for the decision
41+
tree.
4142

4243
Be aware that a linear model requires to scale numerical features.
4344
Please use `sklearn.preprocessing.StandardScaler` so that your
@@ -108,8 +109,8 @@ columns. For the sake of simplicity, we will assume the following:
108109

109110
- categorical columns can be selected if they have an `object` data type;
110111
- use an `OrdinalEncoder` to encode the categorical columns;
111-
- numerical columns can be selected if they do not have an `object` data type.
112-
It will be the complement of the numerical columns.
112+
- numerical columns should correspond to the `numerical_features` as defined above.
113+
This is a subset of the features that are not an `object` data type.
113114

114115
In addition, set the `max_depth` of the decision tree to `7` (fixed, no need
115116
to tune it with a grid-search).

jupyter-book/tuning/parameter_tuning_wrap_up_quiz.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ Which of the following statements hold:
163163
164164
- a) Looking at the individual cross-validation scores, the best ranked model using a
165165
`StandardScaler` is substantially better (at least 7 of the cross-validations scores are better)
166-
than using any other processor
167-
- b) Using any of the preprocessors has always a better ranking than using no processor, irrespective
166+
than using any other preprocessor
167+
- b) Using any of the preprocessors has always a better ranking than using no preprocessor, irrespective
168168
of the value `of n_neighbors`
169169
- c) Looking at the individual cross-validation scores, the model with `n_neighbors=5` and
170170
`StandardScaler` is substantially better (at least 7 of the cross-validations scores are better)
@@ -202,10 +202,10 @@ Explore the set of best parameters that the different grid search models found
202202
in each fold of the outer cross-validation. Remember that you can access them
203203
with the `best_params_` attribute of the estimator. Select all the statements that are true.
204204
205-
- a) The tuned number of nearest neighbors is stable across all folds
206-
- b) The tuned number of nearest neighbors changes often across all folds
207-
- c) The optimal scaler is stable across all folds
208-
- d) The optimal scaler changes often across all folds
205+
- a) The tuned number of nearest neighbors is stable across folds
206+
- b) The tuned number of nearest neighbors changes often across folds
207+
- c) The optimal scaler is stable across folds
208+
- d) The optimal scaler changes often across folds
209209
210210
_Select all answers that apply_
211211

0 commit comments

Comments
 (0)