Package Leaps for Regression Feature Selection

This package's manual is available athttp://cran.r-project.org/web/packages/leaps/leaps.pdf.

The package is intended to use an exhaustive search for the best subsets of the variables in x for predicting y in linear regression, using an efficient branch-and-bound algorithm.

An example can be found as below library('leaps') data(swiss) a<-regsubsets(Fertility~.,nbest=3,data=swiss) par(mfrow=c(1,2)) plot(a) plot(a,scale="r2") The output summary of a is : Subset selection object Call: regsubsets.formula(Fertility ~ ., nbest = 3, data = swiss) 5 Variables (and intercept) Forced in Forced out Agriculture         FALSE      FALSE Examination         FALSE      FALSE Education           FALSE      FALSE Catholic            FALSE      FALSE Infant.Mortality    FALSE      FALSE 3 subsets of each size up to 5 Selection Algorithm: exhaustive We could also compute the coefficient of a to intercept using cov(a,1:3), which gives us: 1 (Intercept)  Education 79.6100585 -0.8623503  2 (Intercept) Examination 86.818529  -1.011317  3 (Intercept)    Catholic 64.4282621  0.1388857 The plotting result is shown in the right