2012-06-16 3 views
3

R 패키지 캐럿을 사용 중이며 병렬 처리가 작동하지 않습니다. 나는 맥북 프로 사용하고캐럿의 병렬 처리가 R 2.13.0에서 작동하지 않습니다.

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

,는 2.3GHz 인텔 코어 i5 및 Mac OS X와 ​​2011 년 초 모델 : 나는 다음과 같은 오류가

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") 

: 나는 train 함수에서 예제를 실행하려고하면 10.6.8.

R 세션 정보 :

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

내가이 문제를 해결하기 위해 할 수있는 뭔가가 있나요?

+0

방법'와 다른 데이터에'train'를 사용할 때 무작위 같은 오류 메시지가 무엇입니까 = "gbm"'. 나는'svmLinear, svmPoly, svmRadial, svmRadialCost, rda'와 같은 에러를 보지 못했습니다. – djhurio

답변

2
  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() 코드를 파헤쳐 야합니다.

+1

R 2.15.0으로 업그레이드 한 후에 작동합니다. –

1

적어도 2.14.0에이 문제를 재현 할 수 없습니다 (아래 참조).

캐럿 코드에는 순차 및 병렬 처리에 대한 다른 버전이 없으므로 문제가 확실하지 않습니다. 순차 버전이 작동합니까? 다른 모델은 어떻습니까? 신선한 세션에서 시도해도 될까요?

더 나은 결과를 얻으려면 패키지 관리자에게 직접 전자 메일로 보내고 싶지 않은 경우가 있습니다.

> library(caret) 

< -snip->

> library(mlbench) 
> data(BostonHousing) 
> 
> library(doMC) 

< -snip->

> 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") 
Warning message: 
In glmboost.matrix(x = c(0.00632, 0.02731, 0.02729, 0.03237, 0.06905, : 
    model with centered covariates does not contain intercept 
> usingMC 
506 samples 
13 predictors 

No pre-processing 
Resampling: Bootstrap (25 reps) 

Summary of sample sizes: 506, 506, 506, 506, 506, 506, ... 

Resampling results across tuning parameters: 

    mstop RMSE Rsquared RMSE SD Rsquared SD 
    50  5.44 0.663  0.484 0.0661  
    100 5.33 0.675  0.518 0.0669  
    150 5.27 0.681  0.526 0.0661  

Tuning parameter 'prune' was held constant at a value 
of 'no' 
RMSE was used to select the optimal model using 
the smallest value. 
The final values used for the model were mstop = 150 
and prune = no. 
> sessionInfo() 
R version 2.14.0 (2011-10-31) 
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) 

locale: 
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 

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

other attached packages: 
[1] mboost_2.1-1 doMC_1.2.5  multicore_0.1-7 
[4] iterators_1.0.5 mlbench_2.1-0 caret_5.15-023 
[7] foreach_1.4.0 cluster_1.14.1 reshape_0.8.4 
[10] plyr_1.7.1  lattice_0.20-0 

loaded via a namespace (and not attached): 
[1] codetools_0.2-8 compiler_2.14.0 grid_2.14.0  
[4] Matrix_1.0-3  splines_2.14.0 survival_2.36-10 
[7] tools_2.14.0 
+1

이 버그는 아주 이상합니다. 오늘 OpenStack 클러스터에서 실행되는 캐럿과 정확히 똑같은 문제가 발생했습니다. 그러나 나는'registerDoMC()'를 주석 처리했을 때 코드가 성공적으로 실행되었음을 재검토했다. –

관련 문제