有关监督学习中培训和测试的问题
我有点困惑,希望有人可以帮助我。
我目前正在尝试监督的学习。而且我认为我对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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论