Section 5 Model Tuning Flashcards

(28 cards)

1
Q

Define a model/classifier

A

We generally defined a model (or classifier) as a function used to relate the target variable y to the input variables X

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are hyperparameters in general in a model (lamda)

A

Any parameter you cannot estimate from data but it has an impact on predictive performance of your model.
Can be used to control the complexity of a model or the optimization algorithm.
They are employed in the training process to estimate the parameters.
Can be set manually for a specific predictive problem.
Their selection can be related to a model selection procedure (tuning).
Cannot be learned during the training process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What form can hyperparameters take

A

Characteristics of the loss function used for training and learning
Variables inherent to the algorithm and/or optimization method implemented for training
Variables relating to the complexity of the model.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What do the model parameters w do (so we can differentiate from hyperparameters)

A

Characterise the specifics of a certain model and are required for predictions.
Are learned (estimated) during the training process - minimise the loss function
Cannot be set manually.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain model training

A

Process of using the training data to estimate/learn the parameters w by minimising the training loss for fixed values of the hyperparameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain model testing

A

Process of evaluating the predictive performance of the model on the out of sample data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do the hyperparameter relate to model complexity

A

Hyperparameters (lamda) control the complexity of the model and its ability to fit the training data by means of the optimisation procedure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define the complexity of a model and what are the consequences with high and low complexity

A

Complexity refers to the flexibility of a model to fit a variety of functions and a model can be made arbitrarily complex.
Models with low complexity may be too simple and not able to fit well the training set.
Models with high complexity will fit the training data perfectly, but will generalise poorly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why is training performance unreliable?

A

The training performance is an optimistic estimate of a model’s performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Comparing training and out of sample data where is a model optimised

A

there’s a gap between training and out-of-sample loss and predictive performance. The gap is dependent on the hyperparameters and is most important.
Underfitting or overfitting data will increase the gap, an optimally tuned model will minimise this gap.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does underfitting and overfitting mean

A

Underfitting: model does not obtain a sufficiently low loss value on the training data, not sufficiently good predictive performance on the training data. This will lead to large bias and a poor predictive performance on the test data.
Overfitting: model learns patterns which are specific to the training data and not general to the underlying data generating process. This corresponds to a gap between training and test error too large, and poor generalisation ability of the model.0 bias, but large variance in predictions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain tuning

A

Tuning is the act of trying to minimise the gap between training data and out of sample data loss functions and accuracy. Its the process of using validation data to select the optimal hyperparameter values mapping to maximum validation predictive performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain bias

A

The error introduced by approximating the data generating process by a simpler model is denoted bias.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain variance

A

The variance of a model is proportional to the flexibility of a model, the more flexible, the more variance.Its the model’s stability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the expected generalisation error

A

Expected generalisation error=Variance of model + Bias of model ^2 + Variance of the error terms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the optimal complexity in a model

A

The optimal complexity is the complexity level which balances bias and variance.

17
Q

How can we consider different hyperparameter values in a model

A

Hyperparameters λ specify/affect the characteristics of a model, we can consider two (or more) versions of a model with the same structural form f(·) but different hyperparameter values. Tuning means using validation data to select the optimal values

18
Q

How is cross valdiation applied in model tuning

A

We can use cross-validation to compare models with different hyperparameters, i.e. we can use cross-validation to select the optimal λ and hence the best support vector machine classifier to use.

19
Q

If training and validation procedure is implemented in a resampling framework how are optimal hyperparameters determined?

A

The one maximising the average predictive performance over the replicates.

20
Q

How do we assess generalised predictive performance after tuning

A

Once the model has been tuned, one needs to assess its generalised predictive performance using separate test data.

21
Q

What comes first model tuning or selection?

A

Model tuning can be implemented in conjunction with model selection, whereby different types of models are compared also across different instances: comparing models and tuning happen at the same time.

22
Q

Give examples of hyperparameters in logistic regression

A

The step size η of the gradient descent algorithm is a hyperparameter that controls the optimization process (no need to worry about that).
The classification threshold τ is a hyperparameter that controls the classification of the data points where tuning is done with respect to predictive performance and model purpose.

23
Q

Give examples of hyperparameters in SVM classifier

A

In a support vector machine classifier, the hyperparameters of the kernel function control the complexity of the model.
Gaussian Radial Basis Function kernel (GRBF) – σ scaling coefficient
Also the cost is a hyperparameter which controls complexity.

24
Q

Give an example of a hyperparameter for classification trees

A

For classification trees the problem of defining a tree T can be formulated as a loss minimization problem where Lambda hyperparameter controls its complexity

25
Give an example of a hyperparameter for random forests
For Random forests (and bagging): The number of variables considered for a split has an effect on the predictive performance. More numbers of variables - more complex the ensemble is.
26
Name four things you should do in order to tune an dcompare approriately multiple classifiers using a cross validation method
Split the data into the training set and validation set - optionally can also split into three to give yourself a test set to assess predictive performance. Train the models on the training data and assess predictive performance compared to the validation data. Ensure when comparing across models that the training data and validation data come from the same splits Select the best classifier and hyperparameters for the model according to the average validation accuracy Replicate this procedure multiple times if using k fold cross validation or hold out sample cross-validation
27
Given a collection of competing classifiers and some data, does the use of a validation set to select the best one in the collection guarantee that the selected one will always provide the best predictive performance on future unseen observations?
No why: Could have overfitting Other classifiers may have higher variability hence could have test data performance overlap The validation set may not be fully representative of variability in the real-world data May be better models out there
28
Is classifier M2 to be preferred to classifier M1 if training and validation on different splits?
We cannot compare accurately as they are not trained and validated on the same splits of the data Necessary always to train competitive models and calculate validation performance ont he same splits of the data Otherwise can have issue of is difference in performance due to variations int he data splits or actual classifiers ability.