# NOT RUN {
library("mlr3")
task = tsk("spam")
opb = po("classweights")
# task weights
task$weights
# double the instances in the minority class (spam)
opb$param_set$values$minor_weight = 2
result = opb$train(list(task))[[1L]]
result$weights
# }
Run the code above in your browser using DataLab