-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into debug-pr-preview
- Loading branch information
Showing
26 changed files
with
900 additions
and
500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,41 @@ | ||
# ✅ Quiz M4.02 | ||
|
||
```{admonition} Question | ||
If we fit a linear regression where `X` is a single column vector, how many | ||
parameters our model will be made of? | ||
- a) 1 | ||
- b) 2 | ||
- c) 3 | ||
Let us consider a pipeline that combines a polynomial feature extraction of | ||
degree 2 and a linear regression model. Let us assume that the linear regression | ||
coefficients are all non-zero and that the dataset contains a single feature. | ||
Is the prediction function of this pipeline a straight line? | ||
_Select a single answer_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
If we train a scikit-learn `LinearRegression` with `X` being a single column | ||
vector and `y` a vector, `coef_` and `intercept_` will be respectively: | ||
- a) an array of shape (1, 1) and a number | ||
- b) an array of shape (1,) and an array of shape (1,) | ||
- c) an array of shape (1, 1) and an array of shape (1,) | ||
- d) an array of shape (1,) and a number | ||
_Select a single answer_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
The decision boundaries of a logistic regression model: | ||
- a) split classes using only one of the input features | ||
- b) split classes using a combination of the input features | ||
- c) often have curved shapes | ||
- a) yes | ||
- b) no | ||
_Select a single answer_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
For a binary classification task, what is the shape of the array returned by the | ||
`predict_proba` method for 10 input samples? | ||
Fitting a linear regression where `X` has `n_features` columns and the target | ||
is a single continuous vector, what is the respective type/shape of `coef_` | ||
and `intercept_`? | ||
- a) (10,) | ||
- b) (10, 2) | ||
- c) (2, 10) | ||
- a) it is not possible to fit a linear regression in dimension higher than 2 | ||
- b) array of shape (`n_features`,) and a float | ||
- c) array of shape (1, `n_features`) and an array of shape (1,) | ||
_Select a single answer_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
In logistic regression's `predict_proba` method in scikit-learn, which of the | ||
following statements is true regarding the predicted probabilities? | ||
Combining (one or more) feature engineering transformers in a single pipeline: | ||
- a) The sum of probabilities across different classes for a given sample is always equal to 1.0. | ||
- b) The sum of probabilities across all samples for a given class is always equal to 1.0. | ||
- c) The sum of probabilities across all features for a given class is always equal to 1.0. | ||
- a) increases the expressivity of the model | ||
- b) ensures that models extrapolate accurately regardless of the distribution of the data | ||
- c) may require tuning additional hyperparameters | ||
- d) inherently prevents any underfitting | ||
_Select a single answer_ | ||
_Select all answers that apply_ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,103 @@ | ||
# ✅ Quiz M4.03 | ||
|
||
```{admonition} Question | ||
Which of the following estimators can solve linear regression problems? | ||
Let us consider a pipeline that combines a polynomial feature extraction of | ||
degree 2 and a linear regression model. Let us assume that the linear regression | ||
coefficients are all non-zero and that the dataset contains a single feature. | ||
Is the prediction function of this pipeline a straight line? | ||
- a) sklearn.linear_model.LinearRegression | ||
- b) sklearn.linear_model.LogisticRegression | ||
- c) sklearn.linear_model.Ridge | ||
- a) yes | ||
- b) no | ||
_Select all answers that apply_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
Regularization allows: | ||
- a) to create a model robust to outliers (samples that differ widely from | ||
other observations) | ||
- b) to reduce overfitting by forcing the weights to stay close to zero | ||
- c) to reduce underfitting by making the problem linearly separable | ||
_Select a single answer_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
Fitting a linear regression where `X` has `n_features` columns and the target | ||
is a single continuous vector, what is the respective type/shape of `coef_` | ||
and `intercept_`? | ||
A ridge model is: | ||
- a) it is not possible to fit a linear regression in dimension higher than 2 | ||
- b) array of shape (`n_features`,) and a float | ||
- c) array of shape (1, `n_features`) and an array of shape (1,) | ||
- a) the same as linear regression with penalized weights | ||
- b) the same as logistic regression with penalized weights | ||
- c) a linear model | ||
- d) a non linear model | ||
_Select a single answer_ | ||
_Select all answers that apply_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
Combining (one or more) feature engineering transformers in a single pipeline: | ||
Assume that a data scientist has prepared a train/test split and plans to use | ||
the test for the final evaluation of a `Ridge` model. The parameter `alpha` of | ||
the `Ridge` model: | ||
- a) increases the expressivity of the model | ||
- b) ensures that models extrapolate accurately regardless of its distribution | ||
- c) may require tuning additional hyperparameters | ||
- d) inherently prevents any underfitting | ||
- a) is internally tuned when calling `fit` on the train set | ||
- b) should be tuned by running cross-validation on a **train set** | ||
- c) should be tuned by running cross-validation on a **test set** | ||
- d) must be a positive number | ||
_Select all answers that apply_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
Scaling the data before fitting a model: | ||
- a) is often useful for regularized linear models | ||
- b) is always necessary for regularized linear models | ||
- c) may speed-up fitting | ||
- d) has no impact on the optimal choice of the value of a regularization parameter | ||
_Select all answers that apply_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
The effect of increasing the regularization strength in a ridge model is to: | ||
- a) shrink all weights towards zero | ||
- b) make all weights equal | ||
- c) set a subset of the weights to exactly zero | ||
- d) constrain all the weights to be positive | ||
_Select all answers that apply_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
The parameter `C` in a logistic regression is: | ||
- a) similar to the parameter `alpha` in a ridge regressor | ||
- b) similar to `1 / alpha` where `alpha` is the parameter of a ridge regressor | ||
- c) not controlling the regularization | ||
_Select a single answer_ | ||
``` | ||
|
||
+++ | ||
|
||
```{admonition} Question | ||
In logistic regression, increasing the regularization strength (by | ||
decreasing the value of `C`) makes the model: | ||
- a) more likely to overfit to the training data | ||
- b) more confident: the values returned by `predict_proba` are closer to 0 or 1 | ||
- c) less complex, potentially underfitting the training data | ||
_Select a single answer_ | ||
``` |
Oops, something went wrong.