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 Bolasso logistic regression model
# The BM parameter in the following example is set as small value to reduce
# the running time, however the default value is proposed
Bolasso.fit <- Bolasso(x=X, y=Y, BM=5, seed=0123)
# Significant variables that are selected by the Bolasso model
Bolasso.fit$var.selected
Run the code above in your browser using DataLab