There’s a really nice repo, which implements many different machine learning algorithms from scratch. I’ve been working on a Pythonista-friendly branch, removing dependencies that aren’t available in Pythonista. There are many examples too, including a variety of neural network implementations.
I think the only supervised learning algorithm I’ve not managed to port (yet!) is SVM. Everything else work very nicely.
Check it out here: ML-From-Scratch
To install, clone the repo in Stash, checkout the pythonista branch and copy the mlfromscratch folder to site-packages. Restart Pythonista and have fun!