I found that this tutorial [1] was really helpful to help me understand how it works, in layman's terms. I followed it with hledger [2], but it should work with any double-entry bookkeeping system. You can also find a lot of resources here [3].
The Elements of Statistical Learning, by Hastie, Tibshirani and Friedman, for everything on Machine Learning and Statistics. Available for free online:
https://statweb.stanford.edu/~tibs/ElemStatLearn/
[1] http://www.dwmbeancounter.com/tutorial/Tutorial.html
[2] http://hledger.org/
[3] http://plaintextaccounting.org/