Open zhengxingSong opened 1 month ago
I have an svm-rfe model with a random number seed, but the results are inconsistent after each optimization. How can I modify the code to make my analysis repeatable? This is my code.
set.seed(1234) task <- TaskClassif$new(id = "predict", backend = data, target = "group", positive = "1") optimizer <- fs("rfecv", n_features = 1, feature_number = 1, recursive = TRUE) learner <- lrn("classif.svm", type = "C-classification", kernel = "linear", predict_type = "prob") instance <- fsi( task = task, learner = learner, resampling = rsmp("cv", folds = 10), measures = msr("classif.acc"), terminator = trm("none"), callbacks = clbk("mlr3fselect.svm_rfe") ) optimizer$optimize(instance)
Thanks!
Hmm, this should work. Can you post a complete example that allows to reproduce the problem please?
I have an svm-rfe model with a random number seed, but the results are inconsistent after each optimization. How can I modify the code to make my analysis repeatable? This is my code.
Thanks!