ModelOriented / survex

Explainable Machine Learning in Survival Analysis
https://modeloriented.github.io/survex
GNU General Public License v3.0
95 stars 10 forks source link

error in evaluating the argument 'x' in selecting a method for function 't': attempt to set 'colnames' on an object with less than two dimensions #91

Closed lzxcvn closed 6 months ago

lzxcvn commented 6 months ago

I encountered the following error while explaining the mboost learner for the MLR3 package. What is the reason for this? image image image image image image image

krzyzinskim commented 6 months ago

I've tried to reproduce the error and found that it is rather not related to survex package itself. It stems from mlr3proba and mboost used underneath. Not sure how your surv_pred function look like but I see it uses the $predict_newdata method (line 16.), which gives this error when predicting for one observation represented as one row of data.frame, even outside the survex.

The solution would be to use another model from mlr3proba and report this error.

lzxcvn commented 6 months ago

survex我尝试重现该错误,发现它与包本身无关。它源自mlr3probamboost在下面使用。不确定你的surv_pred函数是什么样的,但我看到它使用了$predict_newdata方法(第 16 行),该方法在预测表示为一行的一个观察值时给出此错误data.frame,即使在survex.

解决方案是使用另一个模型mlr3proba并报告此错误。

Thank you for your reply. After switching to another function, this issue was resolved. It seems that each learner has its own applicable function.