Overfitting is a type of modeling error that results in the failure to predict future observations effectively or fit additional data in the existing model. It occurs when a function is too closely fit a limited set of data points and usually ends with more parameters than the data can accommodate. It is common for huge data sets to have some anomalies, so when this data is used for any kind of modeling, it can result in inaccuracies in the analysis.
Overfitting can be prevented by following a few methods namely-