[DOC] jupyter notebook - training, rolling window, multivariate#159
[DOC] jupyter notebook - training, rolling window, multivariate#159jayzer wants to merge 2 commits into
Conversation
Added an example of a use case, multivariable, with extreme data and missing data.
Example use case of Multivariate Kalman Filter with a rolling window in Jupyter Notebook format.
|
rewriting second pull request |
|
Multivariate Kalman Filter with Rolling Window Example This example demonstrates how to apply a Kalman Filter to smooth noisy time-series data using a rolling window approach. It covers the following: Simulating data with noise, outliers, and missing values. |
Sorry if it was unclear there are two distinct files actually for the exampes section, which I tried to pull request in two PR's. The first one is a more basic example of kf with some data generated with added extremes, missing points and graphed raw data alongside kf-smoothed data. The second one smooths batches in a rolling window, with periodic updates to the kf. examples/pykalman_multivariate_example.ipynb examples/pykalman_rolling_window_example.ipynb thanks |
I think let's try 159 then? I did not change either Jupyter notebook between 158 and 159, only the pull comment, so I expect the files to be equivalent in that case, with no expected conflict. |
|
any other thoughts on this pull request? |
There was a problem hiding this comment.
Overall, very nice pull request! We have been looking for someone to help with jupyter notebooks, and these are nice! Also see issue #129.
A few comments:
- I would use headers more - you can use markdown cells and hashes such as
### this is a headerfor headers of different levels. For instance, the header comments in code - "step 1" etc, might look better in markdown, and also allow integration with search and table of contents later - remove the
pip installcommands at the start - expect that users have an environment already set up. Also, a valid environment may break when running the notebook without caution. - I would also advise to be more concise and to-the-point, avoid long text, use "telegram style" or "bullet point style" more - so users get to the "meat" quicker. For instance, instead of "This demonstration showcases the application of the Kalman Filter for smoothing noisy time-series data using the pykalman library in Python. We'll simulate data with noise, outliers, and missing values.", you could write:
- this notebook: Kalman Filter for smoothing
- on data with noise, outliers, missing values
- avoid too long printouts. As a rule of thumb, a printout should be 7 rows max.
- dataframes do not need to be printed, you can simply evaluate them on the last line, and they will "pretty display" in jupyter. E.g., write
my_dfon the last line of a code cell, instead ofprint(my_df) - the two notebooks could be two chapters in a single notebook? They are quite similar. If you order them, it might be easier to follow for the user.
- alternatively, you could number the notebooks, so users read them in the intended order.
- re naming, it is clear that the notebooks are about
pykalmanand tha they containexample-s, you could shorten it to01_multivariateand02_rolling_window. Alternatively, if you merge them, then just name ittutorial.ipynb.
ok sure. Noted on the recommendations. number scheme makes sense as well; next jupyter examples could do live update mode or explicitly defined input spaces with unscented filter to complete a tutorial set. |
|
are you still working on this, @jayzer? |
Yes, thanks for checking... Had some other project come up. Will come back with some updates in a couple weeks hopefully, unless someone else wants to take a try to make some jupyter notebook documentation. |
|
it is almost done, only small improvements needed imo - thanks for contributing! |
Multivariate Kalman Filter with Rolling Window Example
This example demonstrates how to apply a Multivariate Kalman Filter to smooth noisy time-series data using a rolling window approach. It covers the following:
This example provides an illustration of how to use the pykalman library in a rolling window use case. Comments include explanations of how to use package for data imputation, outlier handling, and dealing with missing values.