bootstrap aggregating, also called bagging, is a machine learning ensemble meta-algorithm designed to improve the stability and accuracy of machine learning algorithms used in statistical classification and regression. it also reduces variance and helps to avoid overfitting. although it is usually applied to decision tree methods, it can be used with any type of method. bagging is a special case of the model averaging approach. ==description of the technique== given a standard training set d of size n, bagging generates m new training sets d_i, each of size nâ², by sampling from d uniformly and with replacement. by sampling with replacement, some observations may be repeated in each d_i. if nâ²=n, then for large n the set d_i is expected to have the fraction (1 - 1/e) (â63.2%) of the unique examples of d, the rest being duplicates.aslam, javed a.; popa, raluca a.; and rivest, ronald l. (2007); on estimating the size and confidence of a statistical audit, proceedings of the electronic voting technology workshop (evt '07), boston, ma, august 6, 2007. more generally, when drawing with replacement nâ² values out of a set of n (different and equally likely), the expected number of unique draws is n(1 - e^{-n'/n}). this kind of sample is known as a bootstrap sample. the m models are fitted using the above m bootstrap samples and combined by averaging the output (for regression) or voting (for classification). bagging leads to "improvements for unstable procedures" (breiman, 1996), which include, for example, artificial neural networks, classification and regression trees, and subset selection in linear regression (breiman, 1994). an interesting application of bagging showing improvement in preimage learning is provided here.sahu, a., runger, g., apley, d., image denoising with a multi-phase kernel principal component approach and an ensemble version, ieee applied imagery pattern recognition workshop, pp.1-7, 2011.shinde, amit, anshuman sahu, daniel apley, and george runger. "preimages for variation patterns from kernel pca and bagging." iie transactions, vol.46, iss.5, 2014 on the other hand, it can mildly degrade the performance of stable methods such as k-nearest neighbors (breiman, 1996). == example: ozone data ==  to illustrate the basic principles of bagging, below is an analysis on the relationship between ozone and temperature (data from rousseeuw and leroy (1986), available at classic data sets, ana
Computational_statistics Ensemble_learning Machine_learning_algorithms