What is overfitting and underfitting?

Answer

Overfitting occurs when a model learns the training data too well, including noise and random fluctuations, resulting in high training accuracy but poor generalization to new data. Underfitting occurs when a model is too simple to capture the underlying patterns, performing poorly on both training and test data. Overfitting is combated with regularization, more data, dropout, or simpler models. Underfitting is fixed by increasing model complexity, training longer, or adding more features.