如何解决Stack(), blending_predictions of models, result in warning: 需要相关计算,但估计是常数,标准差为 0
我第一次使用 stacks 包在集成模型中堆叠我的回归模型。一切都相对顺利,直到我到达需要混合预测的步骤,使用来自不同子模型的 blend_predictions()
。我怀疑这与惩罚设置有关,因为显然 stacks()
没有选择模型,但是当我尝试更改它们时没有区别。我正在遵循 Andrew Couch ( https://github.com/andrew-couch/Tidy-Tuesday/blob/master/Season%201/Scripts/TidyModelsStacks.Rmd ) 的优秀示例,但是我不明白我遇到的错误。
我在写这个问题时正在处理 reprex
,但如果有人有解释此错误消息的建议,我将不胜感激。谢谢。
era.af_stack_blend_fit <- era.af_stack %>%
blend_predictions(penalty = 0.01,mixture = 1)
警告信息
! Bootstrap01: internal: A correlation computation is required,but `estimate` is constant and has 0 standard deviation,resulting in a divide by 0 error. `NA...
! Bootstrap02: internal: A correlation computation is required,resulting in a divide by 0 error. `NA...
! Bootstrap03: internal: A correlation computation is required,resulting in a divide by 0 error. `NA...
....continues to
! Bootstrap25: internal: A correlation computation is required,resulting in a divide by 0 error. `NA...
我的堆叠看起来像这样
era.af_stack <- stacks() %>%
add_candidates(lm_fit_cv) %>%
add_candidates(glm_fit_cv) %>%
add_candidates(spline_fit_cv) %>%
add_candidates(knn_fit_cv) %>%
add_candidates(pca_fit_cv) %>%
add_candidates(rf_resample_param_fit) %>%
add_candidates(xgboost_res_param_fit)
# A data stack with 7 model definitions and 15 candidate members:
# lm_fit_cv: 1 model configuration
# glm_fit_cv: 1 model configuration
# spline_fit_cv: 1 model configuration
# knn_fit_cv: 1 model configuration
# pca_fit_cv: 1 model configuration
# rf_resample_param_fit: 5 model configurations
# xgboost_res_param_fit: 5 model configurations
# Outcome: logRR (numeric)
era.af_stack_blend_fit
-- A stacked ensemble model -------------------------------------
Out of 15 possible candidate members,the ensemble retained 0.
Penalty: 0.01.
Mixture: 1.
The 0 highest weighted members are:
# A tibble: 0 x 3
# ... with 3 variables: member <chr>,type <chr>,weight <dbl>
Members have not yet been fitted with `fit_members()`.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。