1
有沒有辦法控制插入符號中GA算法選擇的特徵的數量?我嘗試設置gafs_initial()中提到的變量參數,我相信這個參數是由gafs()繼承的,但我似乎沒有控制它的方法。R插入遺傳算法控制最終特徵的數量
ctrl <- gafsControl(functions = caretGA,
verbose = T,
allowParallel = T,
metric=c(internal='Rsquared',external='RMSE'),
maximize = c(internal = TRUE, external = FALSE))
ga <- gafs(x = x,
y = y,
iters = 25,
vars=5,
gafsControl = ctrl,
method = "lm")