【问题标题】:Error: 'glmnet_softmax' is not an exported object from 'namespace:glmnet'错误:“glmnet_softmax”不是从“命名空间:glmnet”导出的对象
【发布时间】:2019-12-19 00:46:08
【问题描述】:

我正在尝试使用本教程https://github.com/wvictor14/planet#infer-ethnicity 并收到以下错误消息,即使使用提供的测试数据也是如此:

pl_infer_ethnicity(pl_betas)
[1] "1860 of 1860 predictors present."
Loading required package: Matrix
Error: 'glmnet_softmax' is not an exported object from 'namespace:glmnet'

我尝试重新安装单个软件包并在新版本或 R 中运行并得到相同的错误。我相信这与 glmnet 中最近更新发布的其他错误有关。有什么解决办法吗?

sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] Matrix_1.2-18 planet_0.1.0 

loaded via a namespace (and not attached):
 [1] lattice_0.20-38  codetools_0.2-16 glmnet_3.0-2     foreach_1.4.7   
 [5] crayon_1.3.4     grid_3.6.2       magrittr_1.5     pillar_1.4.2    
 [9] rlang_0.4.2      remotes_2.1.0    iterators_1.0.12 tools_3.6.2     
[13] compiler_3.6.2   pkgconfig_2.0.3  shape_1.4.4      tibble_2.1.3    

【问题讨论】:

    标签: r glmnet


    【解决方案1】:

    我不知道为什么它会首先起作用; glmnetNEWS file 并没有以任何方式说明 glmnet_softmax(例如,它确实说“glmnet_softmax 不再导出”或类似的东西。 ..)

    无论如何,这是glmnet 包中的非导出函数。教程代码中引用here

    如果您可以将该行代码更改为引用glmnet:::glmnet_softmax(即三个冒号而不是两个),那就足够了(::: 允许您访问非导出函数)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-23
      • 1970-01-01
      相关资源
      最近更新 更多