1

# When Do We Stop Training?

Unsolved
###### Neural Networks

Difficulty: 3 | Problem written by zeyad_omar
##### Problem reported in interviews at

In ML, the model may overfit, or memorize the training data. One of  the solutions to this problem is early stopping regularization where there is a point in the learning process at which the overfitting problem appears.

How do we know that overfitting is going to appear ?

The answer is by testing the model on unseen validation data. If the validation accuracy is increasing then no overfitting is occuring but if starts to decrease, then overfitting has occured.

In this problem, you are given a 1D vector that contains the validation accuracy of the model, and you are asked to return the index at which the validation accuracy begin to decrease (as it would be an indication that we are overfitting).

NOTE: It is acceptable to have some accuracy fluctuations, so you are given a threshold value, below which we do not consider overfitting to have happened.

##### Sample Input:
<class 'list'>
accuracy: [50, 51.2, 55, 57.9, 70, 71, 40]
<class 'int'>
threshold: 5

##### Expected Output:
<class 'int'>
5

MLPro Premium also allows you to access all our high quality MCQs which are not available on the free tier.

Not able to solve a problem? MLPro premium brings you access to solutions for all problems available on MLPro

Have an issue, the MLPro support team is available 24X7 to Premium users.