Book Review: Mastering Scala Machine Learning

Book Review: Mastering Scala Machine Learning

A nephew of mine was learning Scala and I decided I’d like to be able to help, so I did some further learning on Scala. One of the books I read for this was Mastering Scala Machine Learning by Alex Kozlov. It was a little older but it was still useful.

Author

Alex Kozlov is a US-based big data scientist. He completed his Ph.D. from Stanford University in 1998. He has worked on Hadoop with Cloudera. I was interested to see that he had also worked at HP Labs as a researcher at HP Inc. That was one of my employers in the 1980s and it was common to have a close relationship between Stanford and HP. Alex has also been the chief solutions architect at an enterprise security startup, E8 Security.

Mastering Scala Machine Learning

Machine learning and big data are subjects that are often discussed together, but combining them into practical applications can be challenging. Add Scala and functional programming to the mix, and there is a great deal to cover. This book attempts exactly that. It’s an ambitious book, and while I found plenty of valuable material, I suspect it tries to cover too much in the space available.

One thing that stands out is the author’s practical experience. Alex has worked extensively with large-scale data systems, including at Cloudera, and that background comes through in his explanations. Rather than treating machine learning as an isolated collection of algorithms, he frequently discusses how those algorithms fit into larger data processing systems. I like that approach because building a successful machine learning solution involves much more than choosing an algorithm and training a model.

The book begins with exploratory data analysis, which I think is an excellent starting point. Too many machine learning discussions rush straight to sophisticated algorithms without spending enough time understanding the data. Alex covers sampling, summarization, correlations, and basic transformations using Scala and Spark. I particularly liked the discussion of consistent sampling using hashing. It’s a practical technique that can be useful when you need repeatable samples across multiple datasets.

The next chapter moves into data pipelines and modelling, including feedback loops, risk, and decision-making. This is interesting material, although it feels somewhat disconnected from the hands-on programming examples. The book then moves into Spark architecture, task scheduling, distributed processing, and MLlib. These sections provide useful background on why Spark was designed the way it was and how it handles large-scale processing.

The chapters on supervised and unsupervised learning, regression, and classification cover familiar machine learning techniques. There are examples involving decision trees, logistic regression, support vector machines, and ensemble methods. I appreciated the attention given to overfitting, regularization, and classification metrics. These are fundamental ideas that remain important regardless of which programming language or machine learning framework you’re using.

I do wonder if sometimes the explanations move a bit too quickly. Readers who already understand the mathematics and statistical concepts will probably be comfortable, but newcomers may struggle. The book provides enough information to introduce a technique without always giving readers the depth needed to understand when and why they should use it. Given the title, I expected a little more depth in some areas.

I enjoyed the chapters on unstructured data and graph algorithms. The graph material is particularly interesting, with examples using Graph for Scala and Spark GraphX. The use of Enron email data to explore connected components, triangle counting, and PageRank gives the discussion a practical setting. It’s a good reminder that not all useful data analysis fits naturally into rows and columns.

The integration chapter covering R and Python is another useful inclusion. In real organizations, data science work rarely happens entirely within one programming language. Being able to combine existing R or Python code with Scala and Spark can be important. I liked that Alex acknowledges this rather than pretending that Scala should replace everything else. And while the world seems to have embraced Python for this work, I still have clients who are currently wedded to R.

The natural language processing chapter also covers some interesting ground, including TF-IDF, topic modelling with LDA, and word2vec. These techniques were particularly relevant when the book was written and still have educational value. However, this is an area where the age of the book becomes very noticeable.

And that brings me to my biggest concern. The book was published in 2016, and the tools have changed enormously since then. The examples use Scala 2.11, older Spark and MLlib APIs, and even Python 2.7. Readers wanting to work through the code today should expect compatibility problems and substantial changes. I certainly wouldn’t recommend using the installation instructions without checking current documentation.

I was pleased to see the book finish with model monitoring. This is an important subject that is often overlooked. Alex discusses system monitoring, application metrics, model performance over time, and when models should be retired. I particularly liked the recognition that a model can become less useful as the underlying data changes. Unfortunately, the coverage of statistical model monitoring is quite brief, and I would have liked much more discussion of this area.

The writing style is generally direct and practical, but the book can feel uneven. Some sections contain detailed code, while others are more conceptual. There are also occasions where the subject changes rather abruptly. I suspect the problem is simply that machine learning, Scala, Spark, distributed systems, and data engineering are too much to cover thoroughly in around 300 pages. Alex has done a good job of trying to do that though.

I thought the copy editing was a little odd. The author constantly says things like One can get but then uses I used and You can use. The passive tense of all the One can or One could seems out of place for this type of book.

Summary

Mastering Scala Machine Learning is an interesting book, but one that has aged significantly. Its greatest value today is in the underlying ideas about data preparation, distributed processing, machine learning algorithms, and operational monitoring. I would recommend it to experienced developers and data professionals who want to understand how these technologies fit together, particularly from a historical perspective. However, for someone starting a new Scala and Spark machine learning project today, I would strongly recommend finding a more recent technical guide to accompany it. I’m sure Alex would say the same himself today.

7 out of 10

2026-11-23