[英]Validation_data and Validation_split
So I have a GRU model that predict output power.所以我有一个预测输出功率的 GRU 模型。 For the training data I have a csv file which has data from 2018, while for my testting data it is a different csv file which has data from 2019.对于训练数据,我有一个 csv 文件,其中包含 2018 年的数据,而对于我的测试数据,它是一个不同的 csv 文件,其中包含 2019 年的数据。
I just had to short questions.我只需要简短的提问。
Since I'm using 2 different csv files one for testing and one for training, I do not need to train_test_split
?由于我使用了 2 个不同的 csv 文件,一个用于测试,一个用于训练,我不需要train_test_split
吗?
When it comes to model.fit, I really don't know the difference between Validation_data
and Validation_split
and which one should I use?说到model.fit,我真的不知道Validation_data
和Validation_split
的区别,我应该使用哪个?
I have tested these 3 lines seperately, the 2nd and 3rd line give me the same exact results , while the first gives me way lower val_loss
.我分别测试了这 3 行,第 2 行和第 3 行给了我相同的确切结果,而第一行给了我更低的val_loss
。
Thank you.谢谢你。
history=model.fit(X_train, y_train, batch_size=256, epochs=25, validation_split=0.1, verbose=1, callbacks=[TensorBoardColabCallback(tbc)])
history=model.fit(X_train, y_train, batch_size=256, epochs=25, validation_data=(X_test, y_test), verbose=1, callbacks=[TensorBoardColabCallback(tbc)])
history=model.fit(X_train, y_train, batch_size=256, epochs=25, validation_data=(X_test, y_test), validation_split=0.1, verbose=1, callbacks=[TensorBoardColabCallback(tbc)])
train_test_split
if you wish.但是您也可以合并它们,然后根据需要使用train_test_split
。 However, I would recommend you to merge them as you have data from different periods of time, there may be differences.但是,我建议您将它们合并,因为您拥有不同时期的数据,可能会有差异。validation_data
means you are providing the training set and validation set yourself, whereas using validation_split
means you only provide a training set and keras splits it into a training set and a validation set (with the validation set being validation_split
times the size of the training set)使用validation_data
意味着你自己提供训练集和验证集,而使用validation_split
意味着你只提供一个训练集,keras将它分成一个训练集和一个验证集(验证集是validation_split
乘以训练集的大小)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.