다음 caretFuncs
과 같은 것을 사용할 수 있습니다 .
myRFE <- caretFuncs
myRFE$summary <- twoClassSummary (default is defaultSummary)
rctrl <- rfeControl(method='repeatedcv', repeats=5, number=10,
functions=myRFE)
tctrl <- trainControl(method = "cv",
classProbs = TRUE,
summaryFunction = twoClassSummary)
rfeObj = rfe(x,y,sizes=seq(1,ncol(x),2),
rfeControl=rctrl,
# to be passed to train()
method='rf',
importance=T, # do not forget this
ntree=1000,
metric = "ROC",
tuneLength = 10,
# mtry=c(1,3,5,50),
# specify the exact mtry, or tuneLength
# can auto truncate the grid to minimal sizes (with or without warning)
# p <- ncol(x) ... if (mtry < 1 || mtry > p) warning("invalid try: reset to within valid range") try <- max(1, min(p, round(try)))
trControl=tctrl)
또한 valSelRF
패키지를 확인할 수 있습니다 . regularized random forest
여기에 언급 된 것과 어떻게 다른지 확실하지 않습니다 .