Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
280 views
in Technique[技术] by (71.8m points)

time series - How to use sequences as Y_train in LSTM model in Keras?

I have a data like this

    0       1           2       0       1           2
0   0.0000  0.000000    0.0000  0.8140  0.383000    0.7950
1   0.8140  0.383000    0.7950  0.0168  0.000146    0.1900
2   0.0168  0.000146    0.1900  0.4460  0.217000    0.5990
3   0.4460  0.217000    0.5990  0.0299  0.005740    0.3360
4   0.0299  0.005740    0.3360  0.2300  0.359000    0.1600
5   0.2300  0.359000    0.1600  0.2290  0.088300    0.0339
6   0.2290  0.088300    0.0339  0.2360  0.234000    0.4490

The index 0-6 means 6 time steps. I would like to use the first 3 columns as X_train and the last 3 columns as Y_train. My X_train looks like: (the shape is (7, 1, 3)):

array([[[0.00e+00, 0.00e+00, 0.00e+00]],

   [[8.14e-01, 3.83e-01, 7.95e-01]],

   [[1.68e-02, 1.46e-04, 1.90e-01]],

   [[4.46e-01, 2.17e-01, 5.99e-01]],

   [[2.99e-02, 5.74e-03, 3.36e-01]],

   [[2.30e-01, 3.59e-01, 1.60e-01]],

   [[2.29e-01, 8.83e-02, 3.39e-02]]])

What is my Y_train looks like? what is the shape looks like?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...