POSTS

Review - Scala for Machine Learning

TL;DR

I think this book has got a lot of flaws but is definitely worth owning if you are interested in Machine Learning. It does require a pretty good grasp of both Scala and maths to be useful though.

First impression

I was excited when got a copy of this book for review since I had recently attended a few conference talks on Machine Learning that were all either just shallow enough to spark interest or so deep into the maths that they were incomprehensible.

First impression is that the book covers almost all ground there is to cover in the domain. The epub version is somewhere around 900 pages distributed over 12 chapters. Most of the parts of Machine Learning (that I know of or has heard of) has some sort of coverage in the book, so even given the critique below I feel that it is a pretty good reference book, where I can go look at what to read up on elsewhere.

The Machine Learning side of it

The pace of the book is pretty high, and there isn’t much time spent on explaining basic concepts from math and statistics so be prepared to put in some effort on your own to get any value out of the book (of course this could also be my level of math isn’t what the authors expected).

The book would probably work well as literature for university studies where it would be combined with lectures and tutoring, and in fact I think it pretty much matches the last year of my own university studies.

The Scala side of it

The Scala parts are sadly what I am least happy with about the book.

A few examples of things that annoyed me:

  • Implicit type conversions - pretty central in the architecture proposed in the book, this is something most of the community is moving away from and view bounds is becoming deprecated in coming Scala versions
  • A short section starts by saying that performance of higher order performance is out of the scope of the book but then still goes on to make claims about efficiency and performance
  • Talk about Scala`s functional features such as dependency injection - and then no explanation of what is meant and no further mention of how that is functional.
  • Code samples that are mostly boilerplate and the actual interesting machine learning part being cut out

In general I think that the architecture and design proposed might be useful in a real project, or maybe a framework for machine learning, but in the context of trying to wrap your head around different machine learning concepts the idea of cake pattern + monadic data transformation mostly gets in the way (and to some extent I get a feeling of the authors more trying to show off how clever they are than anything else).

What I would have wished the book was like

Since I read lots of “industry” CS-books and online articles I had higher expectations on the pedagogic sides of the book, it did not really feel like the kind of book that wanted me to learn or understand something. Less a helpful teacher and more like the annoying co-worker that wants to brag to me about how much stuff she knows that I don’t know.

I really think spending some more time on that side of the book would have been a big plus. Clearer and more complete short code samples with less boilerplate, explanation of optimizations done in the code, less forward references etc.