XGBoost 输入数据维度

发布于 2025-01-19 08:04:17 字数 417 浏览 0 评论 0原文

我正在研究时间序列。我收集了 10 个不同通道的数据并将它们放入 pandas.DataFrame 中。我有一个 pandas.DataFrame 10 列(每个通道)和 10 行(每个值)。我这个数据框只有一个标签。它是一个二进制数。

例如:对于 10 列和 10 行的数据框,我的标签是“0”。

问题是我无法在具有这些输入的 XGBoost 中使用 .fit 。我遇到此错误:“IndexError:元组索引超出范围”。

到目前为止,我已经尝试将二进制标签放入列表中,尽管这是没有意义的。我还考虑过在这个二进制标签上使用插值,以便它与我的输入具有相同的维度,这也是没有意义的,因为这个标签代表我的训练数据的集合,而不是数据的一行/列。

我希望能够使用具有正确尺寸的参数在我的模型上使用 .fit() 。我有什么想法可以解决这个问题吗?

先感谢您。

I am working on time series. I have collected data having 10 different channels and put them in a pandas.DataFrame. I have a pandas.DataFrame of 10 columns (per channel) and 10 rows (per value). I have only one label for this data frame. It is a binary number.

Ex.: For a data frame of 10 columns and 10 rows, the label that I have is "0".

The problem is that I cannot use .fit in XGBoost having these inputs. I am having this error: "IndexError: tuple index out of range".

So far I have tried putting the binary label in a list, although it is non-sense. I also thought about using interpolation on this binary label so that it has the same dimension as my input, which is also non-sense because this label is representing the ensemble of my training data, not one row / column of the data.

I would like to be able to use .fit() on my model using the parameters having correct dimension. Any thoughts how I can resolve this?

Thank you in advance.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文