what is overfitting 
overfitting is a modeling error in statistics that occurs when a function is too closely aligned to a limited set of data points as a result the model is useful in reference only to its initial data set and not to any other data sets overfitting the model generally takes the form of making an overly complex model to explain idiosyncrasies in the data under study in reality the data often studied has some degree of error or random noise within it thus attempting to make the model conform too closely to slightly inaccurate data can infect the model with substantial errors and reduce its predictive power understanding overfittingfor instance a common problem is using computer algorithms to search extensive databases of historical market data in order to find patterns given enough study it is often possible to develop elaborate theorems that appear to predict returns in the stock market with close accuracy however when applied to data outside of the sample such theorems may likely prove to be merely the overfitting of a model to what were in reality just chance occurrences in all cases it is important to test a model against data that is outside of the sample used to develop it 