# NOT RUN {
data(motors)
table(motors$condition)
## 1 2 3 4
## 83 67 70 60
## Let us consider the first three variables as predictors
data <- motors[, 1:3]
grouping = motors$condition
##
## Lower values of the amplitudes are expected to be
## related to higher levels of damage severity, so
## we can consider the following monotone constraints
monotone_constraints = rep(-1, 3)
set.seed(7964)
values <- runif(dim(data)[1])
trainsubset <- values < 0.2
obj <- amilb(data[trainsubset, ], grouping[trainsubset],
data[-trainsubset, ], 100, monotone_constraints)
## Apparent error
obj$apparent
## 4.761905
## Error rate
100*mean(obj$class != grouping[-trainsubset])
## 15.41219
# }
Run the code above in your browser using DataLab