gpt4 book ai didi

r - 插入符号中的并行处理不适用于 R 2.13.0

转载 作者:行者123 更新时间:2023-12-04 10:38:31 25 4
gpt4 key购买 nike

我正在使用 R 包 caret 并且并行处理不起作用。如果我尝试从 train 函数运行示例:

library(mlbench)
data(BostonHousing)

library(doMC)
registerDoMC(2)

## NOTE: don't run models form RWeka when using
### multicore. The session will crash.

## The code for train() does not change:
set.seed(1)
usingMC <- train(medv ~ .,
data = BostonHousing,
"glmboost")

我收到以下错误:

Error in names(resamples) <- gsub("^\\.", "", names(resamples)) : 
attempt to set an attribute on NULL

我使用的是 MacBook Pro,2011 年初机型,配备 2.3GHz Intel Core i5 和 Mac OS X 10.6.8。

R session 信息:

R version 2.13.0 (2011-04-13) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

attached base packages: [1] stats graphics grDevices utils
datasets methods base

other attached packages: [1] caret_5.13-20 cluster_1.14.2 reshape_0.8.4 plyr_1.7.1 lattice_0.19-33 mlbench_2.1-0
doMC_1.2.3 multicore_0.1-7 [9] foreach_1.3.2 codetools_0.2-8 iterators_1.0.5

loaded via a namespace (and not attached): [1] compiler_2.13.0 grid_2.13.0 rpart_3.1-51 tools_2.13.0

我能做些什么来解决这个问题吗?

最佳答案

  1. 可能很难找到可以重现您的错误的人:有了

    > sessionInfo ()
    R version 2.15.0 (2012-03-30)
    Platform: x86_64-pc-linux-gnu (64-bit)

    [...剪断...]

    other attached packages:
    [1] mboost_2.1-2 caret_5.15-023 cluster_1.14.2 reshape_0.8.4
    [5] plyr_1.7.1 lattice_0.20-6 doMC_1.2.5 multicore_0.1-7
    [9] iterators_1.0.6 foreach_1.4.0 mlbench_2.1-0

    loaded via a namespace (and not attached):
    [1] codetools_0.2-8 compiler_2.15.0 grid_2.15.0 Matrix_1.0-6
    [5] splines_2.15.0 survival_2.36-14 tools_2.15.0

    有效。

  2. 这意味着您可能需要深入研究代码:traceback ()debug () 应该会有所帮助。

关于r - 插入符号中的并行处理不适用于 R 2.13.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11059925/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com