plot.randomforest.r

来自「是基于linux系统的C++程序」· R 代码 · 共 24 行

R
24
字号
plot.randomForest <- function(x, type="l", main=deparse(substitute(x)), ...) {  if(x$type == "unsupervised")    stop("No plot for unsupervised randomForest.")  test <- !(is.null(x$test$mse) || is.null(x$test$err.rate))  if(x$type == "regression") {    err <- x$mse    if(test) err <- cbind(err, x$test$mse)  } else {    err <- x$err.rate    if(test) err <- cbind(err, x$test$err.rate)  }  if(test) {    colnames(err) <- c("OOB", "Test")    matplot(1:x$ntree, err, type = type, xlab="trees", ylab="Error",            main=main, ...)  } else {    matplot(1:x$ntree, err, type = type, xlab="trees", ylab="Error",            main=main, ...)  }  invisible(err)}  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?