def store_prediction_and_ground_truth(model):
input_size = 1
maxlen = 140
batch_size = 32
db = read_data('../data/ECG5000_TEST_PHASE_1_CONTINUOUS_SIGNAL_1.pkl')
X = create_sequences(db[:-140], win_size=maxlen, step=maxlen)
X = np.reshape(X, (X.shape[0], X.shape[1], input_size))
Y = create_sequences(db[140:], win_size=maxlen, step=maxlen).flatten()
prediction = model.predict(X, batch_size, verbose=1)
prediction = prediction.flatten()
with open('../data/ECG5000_TRAIN_PHASE_2_CONTINUOUS_SIGNAL_1.pkl', 'wb') as f:
pickle.dump(np.stack((Y, prediction)), f)
评论列表
文章目录