PayPal Interview Question | Overfitting

Question

In the case of machine learning, what is the meaning of “Overfitting”? How will you avoid it?

solved 0
Dhruv2301 55 years 1 Answer 711 views Great Grand Master 0

Answer ( 1 )

  1. Overfitting occurs when our model becomes complex and it tries to learn the noise and the extreme details hence failing to generalise the new data.
    To prevent overfitting we can use L1 or L2 regularization, dropout and early stopping
    L1 regularization adds a penalty to minimize the absolute value of wights while L2 regularization adds penalty ti minimize the square of weights.
    If we are using a neural network to train, we can use dropout where certain number of neurons will be deactivated while training the model.
    We can also use early stopping where the training of the model is stopped after a certain point so that our model does not become more complex and it can generalize the test data.
    We can also reduce the complexity of the model by using less hidden layers, less number of neurons in the hidden layers, using simple model like linear regression instead of random forest so as to prevent overfitting

    Best answer

Leave an answer

Browse
Browse