我正在比较不同类型数据质量的拟合精度结果。“好数据”是特征值中没有任何 NA 的数据。“坏数据”是特征值中具有 NA 的数据。应该通过一些值校正来修复“坏数据”。作为值校正,它可能会用零或平均值替换 NA。
在我的代码中,我试图执行多个拟合程序。
查看简化的代码:
from keras import backend as K
...
xTrainGood = ... # the good version of the xTrain data
xTrainBad = ... # the bad version of the xTrain data
...
model = Sequential()
model.add(...)
...
historyGood = model.fit(..., xTrainGood, ...) # fitting the model with
# the original data without
# NA, zeroes, or the feature mean values
根据historyGood数据查看拟合精度图:
之后,代码重置存储的模型并使用“坏”数据重新训练模型:
K.clear_session()
historyBad = model.fit(..., xTrainBad, ...)
根据historyBad数据查看拟合过程结果:
可以注意到,初始精度> 0.7
,这意味着模型“记住”了之前的拟合。
为了比较,这是“坏”数据的独立拟合结果:
如何将模型重置为“初始”状态?
慕运维8079593
狐的传说
侃侃尔雅
相关分类