grouping - mlr3 错误:无法将分层与分组相结合
问题描述
代码示例:
# BLOCKING by "userID"
task$col_roles$group = "userID"
# Remove "userID" from features
task$col_roles$feature = setdiff(task$col_roles$feature, "userID")
# STRATIFICATION (by Target Variable!)
task$col_roles$stratum = "answer_code"
# Instantiate the resampling on the task:
rsmp_scheme$instantiate(task)
问题:尝试结合重采样程序“分层重采样”(按目标分层)和 2)“块重采样”(按用户 ID 分组)(参见 mlr3 库示例:https ://mlr3gallery.mlr-org.com/posts/2020 -03-30-stratification-blocking/ ) ,出现以下错误:
Error: Cannot combine stratification with grouping
背景资料:
- 我的数据集包括每个用户的多次重复测量(每个人可用的重复测量次数不同)-> 因此,每个用户 ID 的阻止或分组是合适的。
- 此外,目标变量的分布非常不平衡,这就是为什么按目标分层是合适的。
问题:如何在 mlr3 中实现这两种重采样方法?
谢谢你的帮助!:-)
解决方案
推荐阅读
- android - 在 Android 设备上启动 Unity3d 游戏时屏幕抖动?
- javascript - 如何在 Vue 中使用脚本标签加载第三方元素?
- r - parLapply 返回 NULL 而不是 for 循环的正确输出
- php - 如何禁用此代码上的 href 链接,使其不会在 URL 上返回 Void(0)?
- machine-learning - 通过 NLP 进行个性化食品推荐
- android - 如何从android webview加载使用fultter web构建的本地html
- python - if循环如何在一行中执行多个语句?
- linux - Bash 多进程替换重定向顺序
- python - 将数据框从一个条件(类别)转换为另一个条件(通过分隔符拆分字符串)
- powershell - 使用 powershell 合并行并将内容从一个 .csv 拆分到多个文件