Enrollments Closing Soon for Online Instructor-Led DevOps Certification Training by CloudxLab | No Cost EMI AvailableEnroll Now
We have time-series data kept in the file
This is the stock data over a period of time. It is stored chronologically - the first record is older than second, second is older than third and so on. Do not shuffle it.
We want to create a dataset on which we can train a model to predict the stock price given the previous 5 values. So, we have to convert it into a dataset such that the previous 5 values are the features and the 6th value is the label.
If our input dataset is:
t1, t2, t3, t4, t5, t6, t7, t8, t9, t10
Our expected X is:
[ [t1, t2, t3, t4, t5] , [t2, t3, t4, t5, t6] , [t3, t4, t5, t6, t7] , [t4, t5, t6, t7, t8] , [t5, t6, t7, t8, t9] , [t6, t7, t8, t9, t10] , ]
Our expect y is:
[t6, t7, t8, t9, t10]
import pandas as pdand
import numpy as np
yas described above.
Xshould be two dimensional and
yshould a single-dimensional NumPy array
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here