有关监督学习中培训和测试的问题

发布于 2025-02-13 18:10:44 字数 664 浏览 0 评论 0原文

我有点困惑,希望有人可以帮助我。

我目前正在尝试监督的学习。而且我认为我对lstms的输入和输出有一个基本的误解。

当我有10个观测值的序列时,

我将其分为trains = 1,2,3,4,5,6,7,8

test = 9,10代码>。

然后我将其转变为一个有监督的问题:

Xtrain= [(1,2)(2,3)(3,4)(4,5)(5,6)]
Ytrain= [(3,4)(4,5)(5,6)(6,7)(7,8)]

因此,

Xtest= [(7,8)]

该模型是为了预测前两个观察结果。

prediction <- predict(Xtest)

火车/测试拆分是非法的吗?我是否正确地说,我可以根据XTEST对包含的实际测试集评估预测输出

,或者我应该在xtrain停止培训= [(4,5)]ytrain = [(6,7)]在训练和测试之间获得一些空间,因为我的示例中使用了Y培训中的最后一次观察结果为了预测 ?

I am a bit confused and hope someone can help me.

I am currently experimenting with supervised learning. And I think I have a basic misunderstanding about the input and output of LSTMs.

When I have a sequence of 10 observations,

And I split it into trains = 1,2,3,4,5,6,7,8

Also, test = 9,10.

And I transform it into a supervised problem like:

Xtrain= [(1,2)(2,3)(3,4)(4,5)(5,6)]
Ytrain= [(3,4)(4,5)(5,6)(6,7)(7,8)]

And

Xtest= [(7,8)]

So the model is made to predict the next two observations from the previous two.

prediction <- predict(Xtest)

Is this illegal for a train/test split ? Am I correct that I can than evaluate the prediction output from xtest against the actual test set containing [(9,10)]

Or should I stop training at xtrain =[(4,5)] and ytrain = [(6,7)] to get some space between training and testing, since the last observations from y training in my example are used for the prediction
?

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

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

发布评论

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