library(datasets)
head(iris)
X <- as.matrix(subset(iris, iris$Species!="setosa")[, -5])
Y <- as.factor(ifelse(subset(iris, iris$Species!="setosa")[, 5]=='versicolor', 0, 1))
# Fit a bootstrap ranking LASSO (BRLasso) logistic regression model.
# The parameters of B and Boots in the following example are set as small values to
# reduce the running time, however the default values are proposed.
BRLasso.fit <- BRLasso(x=X, y=Y, B=2, Boots=5, seed=0123)
# Significant variables that are selected by the BRLasso model.
BRLasso.fit$var.selected
# Coefficients of the selected variables.
BRLasso.fit$var.coef
Run the code above in your browser using DataLab