简体   繁体   English

mlr3 distrcompose cdf:下标越界

[英]mlr3 distrcompose cdf: subscript out of bounds

R version used: 3.6.3, mlr3 version: 0.4.0-9000, mlr3proba version: 0.1.6.9000, mlr3pipelines version: 0.1.2 and xgboost version: 0.90.0.2 (as stated on Rstudio package manager) R version used: 3.6.3, mlr3 version: 0.4.0-9000, mlr3proba version: 0.1.6.9000, mlr3pipelines version: 0.1.2 and xgboost version: 0.90.0.2 (as stated on Rstudio package manager)

I have deployed the following graph pipeline:我已经部署了以下图形管道:

imputePipe = PipeOpImputeMean$new(id = "imputemean", param_vals = list())
survXGPipe = mlr_pipeops$get("learner",lrn("surv.xgboost"))

graphXG= Graph$new()$
  add_pipeop(imputePipe)$
  add_pipeop(po("learner", lrn("surv.kaplan")))$
  add_pipeop(survXGPipe)$
  add_pipeop(po("distrcompose"))$
  add_edge("imputemean","surv.kaplan")$
  add_edge("imputemean","surv.xgboost")$
  add_edge("surv.kaplan","distrcompose", dst_channel = "base")$
  add_edge("surv.xgboost","distrcompose", dst_channel = "pred")

Unfortunately upon executing the following commands:不幸的是,在执行以下命令时:

lrnXG = GraphLearner$new(graphXG)
trainResults = glrnXG$train(trainVerTask, row_ids = trainDataInd)
predictionResults = glrnXG$predict(trainVerTask, row_ids = verDataInd)

When the predict function is called the following error is returned:当调用 predict function 时返回以下错误:

Error in cdf[i, ] : subscript out of bounds

This error seems to be specific to the distrcompose function since I tried implementing simple graphs using only surv.xgboost, surv.kaplan and it does not show up.此错误似乎特定于 distrcompose function,因为我尝试仅使用 surv.xgboost、surv.kaplan 实现简单图形,但它没有出现。

It also seems to be data inspecific since I tried changing the input data and as long as distrcompose is used the same error is returned.它似乎也是数据不明确的,因为我尝试更改输入数据并且只要使用 distrcompose 就会返回相同的错误。 Please let me know if you would like me to provide any further information concernign the matter, thank you in advance for your time.如果您希望我提供有关此事的任何进一步信息,请告诉我,提前感谢您的时间。

Please use the following code to reproduce the error:请使用以下代码重现错误:

library(mlr3)
library(mlr3pipelines)
library(mlr3proba)
library(mlr3learners)
task = tgen("simsurv")$generate(1000)
imputePipe = PipeOpImputeMean$new(id = "imputemean", param_vals = list())
survXGPipe = mlr_pipeops$get("learner",lrn("surv.xgboost"))

graphXG= Graph$new()$
  add_pipeop(imputePipe)$
  add_pipeop(po("learner", lrn("surv.kaplan")))$
  add_pipeop(survXGPipe)$
  add_pipeop(po("distrcompose"))$
  add_edge("imputemean","surv.kaplan")$
  add_edge("imputemean","surv.xgboost")$
  add_edge("surv.kaplan","distrcompose", dst_channel = "base")$
  add_edge("surv.xgboost","distrcompose", dst_channel = "pred")

lrnXG = GraphLearner$new(graphXG)
trainResults = lrnXG$train(task, row_ids = 1:900)
lrnXG$predict(task, row_ids = 901:1000)

The problem lies in distr6 here, please install the latest versions of distr6 (1.4.2) and mlr3proba (0.2.0) from CRAN and then try again.问题出在 distr6 这里,请从 CRAN 安装最新版本的 distr6 (1.4.2) 和 mlr3proba (0.2.0) 然后重试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM