Closed BillGatesIII closed 3 years ago
The return type of predict is documented here.
In you are interested in the prediction only (not the uncertainty or internal state of the filter), you can append the .observations.mean
to your Dataframe, for example, like this
df.append(pd.DataFrame(
data={ 'A': pr.observations.mean },
index=[10]))
But please note that for good results, the matrices in the Kalman filter (A,Q,H & R) should be well thought out and tuned for your specific problem. The matrices in example.py are not intended to work as a general purpose prediction algorithm.
Amazing stuff and I'm curious if I can use it with pandas dataframe. For example I have this dataframe
which looks like this
How can I add a row with the Kalman prediction for row 10?
I came this far
to get one predicted value.
But adding it to the dataframe gives an error.
I understand why I get the error but I don't know how to 'extract' the predicted value from object.