所以我有时间序列长度324.我想为每次迭代随机选择60个连续时间步骤,例如。对于i = 1选择3:74,对于I = 2选择255:314,依此类推,数千 倍。
r
。r
到r+60
例:
import numpy as np
sampleSize = 60
timeSeries = np.random.random((324, 5, 5)) # exchange this with your real data
r = np.random.randint(0, timeSeries.shape[0]-sampleSize+1)
sample = timeSeries[r:r+60]