简体   繁体   English

使用 Keras 使用多个指标进行预测

[英]Use multiple indicators for predictions using Keras

The program I am using deals with just the opening column of the apple stock (from yahoo finance).我正在使用的程序只处理苹果股票的开盘栏(来自雅虎财经)。

Basically I want to add other columns into the model to add some complexity into my model.基本上我想将其他列添加到模型中以向我的模型添加一些复杂性。 For example, look at the High for the day or even the close of the day.例如,查看当天或什至当天收盘价的最高价。

How do I do this.我该怎么做呢。 Do I just change this code below:我是否只需更改以下代码:

regressor.add(LSTM(units = 50, return_sequences = True, input_shape = (X_train.shape[1], 1)))

To

regressor.add(LSTM(units = 50, return_sequences = True, input_shape = (X_train.shape[1], #2 or 3 etc.)))

If so does this mean I change the processed data set from:如果是这样,这是否意味着我将处理后的数据集更改为:

data_training_processed = data_training_complete.loc[:, ['Open']].values

To

data_training_processed = data_training_complete.loc[:, ['Open']['High'].values #adding as much as neccessary

If I want to include High into the model.如果我想在模型中包含高。

It remains它仍然

regressor.add(LSTM(units = 50, return_sequences = True, input_shape = (X_train.shape[1], 1)))

Because the additional column is already automatically processed correctly by X_train.shape[1] (which will be one higher).因为附加列已经由X_train.shape[1]自动正确处理(将更高)。

And

data_training_processed = data_training_complete.loc[:, ['Open', 'High']].values

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM