【发布时间】:2017-11-11 13:41:50
【问题描述】:
我想预测利率,我有一些相关因素,比如股票指数和货币供应量,诸如此类。因子的数量可能高达 200。
例如,训练数据,X 包含因子,y 是我想要训练和预测的利率。
factor1 factor2 factor3 factor176 factor177 factor178
X= [[ 2.1428 6.1557 5.4101 ..., 5.86 6.0735 6.191 ]
[ 2.168 6.1533 5.2315 ..., 5.8185 6.0591 6.189 ]
[ 2.125 4.7965 3.9443 ..., 5.7845 5.9873 6.1283]...]
y= [[ 3.5593]
[ 3.014 ]
[ 2.7125]...]
所以我想使用 tensorflow/tflearn 来训练这个模型,但我真的不知道我应该选择什么方法来做回归。我之前尝试过 tflearn 中的 LinearRegression,但结果不是很好。
目前,我只是使用我在网上找到的代码。
net = tflearn.input_data([None, 178])
net = tflearn.fully_connected(net, 64, activation='linear',
weight_decay=0.0005)
net = tflearn.fully_connected(net, 1, activation='linear')
net = tflearn.regression(net, optimizer=
tflearn.optimizers.AdaGrad(learning_rate=0.01, initial_accumulator_value=0.01),
loss='mean_square', learning_rate=0.05)
model = tflearn.DNN(net, tensorboard_verbose=0, checkpoint_path='tmp/')
model.fit(X, y, show_metric=True,
batch_size=1, n_epoch=100)
当误差范围为 ±10% 时,结果的准确度大约为 50%。 我试图将窗口设为 7 天,但结果仍然很糟糕。所以我想知道我可以使用什么额外的层来改善这个网络。
【问题讨论】:
标签: machine-learning tensorflow deep-learning financial tflearn