Overfitting occurs when our machine learning model tries to cover all the data points or more than the required data points present in the given dataset.
- How to prevent overfitting in machine learning
- Cross-validation
Use your initial training data to generate multiple mini train-test splits. Use these splits to tune your model.
- Train with more data
It won't work every time, but training with more data can help algorithms detect the signal better.
- Remove features
For those that don't have built-in feature selection, you can manually improve their generalizability by removing irrelevant input features.
- Early stopping
Up until a certain number of iterations, new iterations improve the model. After that point, however, the model's ability to generalize can weaken as it begins to overfit the training data.