错误'名称'属性[35563]必须与向量[1]长度相同

发布于 2025-01-23 06:57:21 字数 472 浏览 0 评论 0原文

我正在尝试使用smognregressubl package r 中的smognregress使用smognregress

当我运行代码时:

SMOGNRegress(Deceased~., normalized_data, rel = "auto", thr.rel = 0.9999, C.perc = "balance", k = 2, repl = F, dist = "Euclidean", pert = 0.01)

我会收到以下错误:

'名称'属性[35563]必须与向量[1]

的长度相同

,从有关此错误的类似问题中,我看到这是一个不匹配的长度的问题,但是我无法围绕如何按顺序解决该问题围绕如何修复该问题生成新的超采样数据集。

I'm trying to oversample an imbalanced dataset with a continuous target variable using SMOGNRegress from the UBL package in R.

When I run the code:

SMOGNRegress(Deceased~., normalized_data, rel = "auto", thr.rel = 0.9999, C.perc = "balance", k = 2, repl = F, dist = "Euclidean", pert = 0.01)

I get the following error:

'names' attribute [35563] must be the same length as the vector [1]

From similar questions regarding this error, I saw that it is an issue of lengths not matching, but I cannot wrap my head around how to fix that in order to generate the new oversampled data set.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲜肉鲜肉永远不皱 2025-01-30 06:57:21

确保此函数知道“归一化_data”是对我有用的数据框架。

SMOGNRegress(Deceased~., as.data.frame(normalized_data), rel = "auto", thr.rel = 0.9999, C.perc = "balance", k = 2, repl = F, dist = "Euclidean", pert = 0.01)

Making sure this function knows that "normalized_data" is a data frame worked for me.

SMOGNRegress(Deceased~., as.data.frame(normalized_data), rel = "auto", thr.rel = 0.9999, C.perc = "balance", k = 2, repl = F, dist = "Euclidean", pert = 0.01)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文