Live data from Hacker News

Kalman and Bayesian Filters in Python

nbviewer.ipython.org

11–20 of 30 posts

Re: Kalman and Bayesian Filters in Python

#11
post #7

I have just started, and will likely take a couple of days to finish, but I already like what I've read so far. I really appreciate this author (Roger Labbe, yes?) as well as all the other authors of these online interactive ebooks or whatever they're called ("interabooks"?) for taking the time to prepare such comprehensive and informative material, purely to help others. Surely, preparing something like this could n…

If you're one of those authors I too would like to thank you. Also I like to toot my own horn and help you. With some help I built ipy_pep8[1]. It helps iPython Notebook authors to make their code pep8 valid. It has already been used to improve "Probabilistic Programming and Bayesian Methods for Hackers". [1]: https://github.com/bobjansen/ipy_pep8 [2]: http://nbviewer.ipython.org/github/CamDavidsonPilon/Probabil...

Sadly, I'm not one :(. But I do use iPython a lot, and will check out your tool. Thanks for the link!

Re: Kalman and Bayesian Filters in Python

#12
post #5

Author here. I struggle a lot with the choice of medium. In many senses Jupyter (IPython Notebook) is fanstastic in terms of workflow. With latex+external program+external data+external output it is hard to keep everything in sync. Here, it all happens in one place. And, of course, it should make it easier for the reader. "What happens if I change this constant?" (A normal question with scientific processing). Trivia…

A brief introduction stating what Kalman/Bayesian filters are and what they can be used for in the real world would be good for the start of the book.

In your Preface/Motivation section, you currently mention Kalman filters (4 times in the 1st 4 sentences) without explaining what it is and that seems to be the only intro to the topic.

Re: Kalman and Bayesian Filters in Python

#13
post #10

Earlier quoted context omitted.

Wasn't there a way to run the IPython notebook with a javascript kernel in the browser? At least that is how iocaml notebooks work (which AFAICT are IPython compatible): you have the full OCaml interpreter running as javascript and can edit any cells: http://gazagnaire.org/fuconf14/ This seems to be the Python equivalent: https://github.com/minrk/jskernel

Jupyter supports all kinds of kernels now. R, Julia, Javascript, Python, Haskell, Ruby, bash, it goes on and on. I am just giddy in love with the Jupyter project, despite the pain points about the current pace of changes. http://jupyter.org/

Maybe you could set up a python virtualenv and use 'pip freeze' to dump the exact versions of all the libs you use. Then someone who wants to edit/render the notebook can 'pip install -r requirements.txt' to get an environment close to yours.

This still doesn't solve the problem that .ipynb format may not be stable, or that various python libs can introduce incompatibilities between versions but at least upgrading would be entirely under your control, and done at your pace.

Perhaps markdown with embedded code sections, or org-mode+org-babel would be a better long-term storage format, but I don't know if there are any tools that can round-trip to IPython notebooks, and you'd loose some of the interactivity.

Re: Kalman and Bayesian Filters in Python

#14
post #5

Author here. I struggle a lot with the choice of medium. In many senses Jupyter (IPython Notebook) is fanstastic in terms of workflow. With latex+external program+external data+external output it is hard to keep everything in sync. Here, it all happens in one place. And, of course, it should make it easier for the reader. "What happens if I change this constant?" (A normal question with scientific processing). Trivia…

If you want to do things in JavaScript and want to have your users avoid the version problem, the thing to do would be to provide an installer which pins versions of the various libraries (ostensibly through NPM) and/or to just distribute the package as a whole with the various libraries in place.

This can be automated. If you'd like, ping me at stonecypher at gmail dot com, and I'll share the system I use, and show you how to work with it.

Or you can just see it here: https://github.com/StoneCypher/flocks.rocks/blob/master/gulp...

Re: Kalman and Bayesian Filters in Python

#15
post #12
post #5

Author here. I struggle a lot with the choice of medium. In many senses Jupyter (IPython Notebook) is fanstastic in terms of workflow. With latex+external program+external data+external output it is hard to keep everything in sync. Here, it all happens in one place. And, of course, it should make it easier for the reader. "What happens if I change this constant?" (A normal question with scientific processing). Trivia…

A brief introduction stating what Kalman/Bayesian filters are and what they can be used for in the real world would be good for the start of the book. In your Preface/Motivation section, you currently mention Kalman filters (4 times in the 1st 4 sentences) without explaining what it is and that seems to be the only intro to the topic.

Good point, I will do that.

Re: Kalman and Bayesian Filters in Python

#16
post #10

Earlier quoted context omitted.

Jupyter supports all kinds of kernels now. R, Julia, Javascript, Python, Haskell, Ruby, bash, it goes on and on. I am just giddy in love with the Jupyter project, despite the pain points about the current pace of changes. http://jupyter.org/

Maybe you could set up a python virtualenv and use 'pip freeze' to dump the exact versions of all the libs you use. Then someone who wants to edit/render the notebook can 'pip install -r requirements.txt' to get an environment close to yours. This still doesn't solve the problem that .ipynb format may not be stable, or that various python libs can introduce incompatibilities between versions but at least upgrading wo…

I had no knowledge about pip freeze, I will look into that. I don't do Python professionally, except as a Matlab replacement.

Re: Kalman and Bayesian Filters in Python

#17
post #7

Earlier quoted context omitted.

If you're one of those authors I too would like to thank you. Also I like to toot my own horn and help you. With some help I built ipy_pep8[1]. It helps iPython Notebook authors to make their code pep8 valid. It has already been used to improve "Probabilistic Programming and Bayesian Methods for Hackers". [1]: https://github.com/bobjansen/ipy_pep8 [2]: http://nbviewer.ipython.org/github/CamDavidsonPilon/Probabil...

Sadly, I'm not one :(. But I do use iPython a lot, and will check out your tool. Thanks for the link!

It's a gteat way to contribute to existing projects ;)

Re: Kalman and Bayesian Filters in Python

#18
post #9
post #7

Earlier quoted context omitted.

If you're one of those authors I too would like to thank you. Also I like to toot my own horn and help you. With some help I built ipy_pep8[1]. It helps iPython Notebook authors to make their code pep8 valid. It has already been used to improve "Probabilistic Programming and Bayesian Methods for Hackers". [1]: https://github.com/bobjansen/ipy_pep8 [2]: http://nbviewer.ipython.org/github/CamDavidsonPilon/Probabil...

Sweet tool; I didn't know about it. I will be running it tonight against my source.

Cool! Please let me know what you think.

Re: Kalman and Bayesian Filters in Python

#19
post #5

Author here. I struggle a lot with the choice of medium. In many senses Jupyter (IPython Notebook) is fanstastic in terms of workflow. With latex+external program+external data+external output it is hard to keep everything in sync. Here, it all happens in one place. And, of course, it should make it easier for the reader. "What happens if I change this constant?" (A normal question with scientific processing). Trivia…

I came here to say, as someone who's done a little work on kalman filters for robot localization, this seemed like a good introduction to what they are and what they mean. I would have loved to find this back in 2009 when I was finishing my bachelors! Thanks.
Post reply on HN