def get_train_data():
# definite the dataset as two input , one output
DS = SupervisedDataSet(2, 1)
u1, u2, y = _generate_data()
# add data element to the dataset
for i in np.arange(199):
DS.addSample([u1[i], u2[i]], [y[i + 1]])
# you can get your input/output this way
# X = DS['input']
# Y = DS['target']
# split the dataset into train dataset and test dataset
dataTrain, dataTest = DS.splitWithProportion(0.8)
return dataTrain, dataTest
评论列表
文章目录