Choosing a Machine Learning Model from a Library
The book focuses on the practical aspects of using machine learning algorithms rather than their detailed mathematics.
Knowing What a Machine Learning Book Offers
Before you start a machine learning book, it helps to know what kind of help it is trying to give you. Some books walk through the equations behind every algorithm. Others teach you to build each algorithm yourself from first principles. Others focus on getting useful results by applying tested tools. This article explains which of these approaches the book chooses, which it deliberately leaves out, and how you can decide whether its emphasis matches what you need.
The main idea is one of purpose. Read in this way, the book's focus is a question of what you should be able to do after reading it. Its answer is that you should be able to apply machine learning algorithms to problems, choosing and using models that already exist, rather than prove why those algorithms work or code them yourself.
Three Approaches to Learning Machine Learning
Machine learning books generally fall into one of three camps. The first walks through the equations behind every algorithm. The second teaches you to build each algorithm yourself from first principles. The third concentrates on getting useful results by applying tested, ready-made tools. Each camp serves a different reader, so the first step is to identify which camp a given book belongs to.
What do you think happens?
Given the three approaches, which one does this book choose?
Reveal answer
Applying tested tools to get useful results
The book concentrates on the practical side of using machine learning algorithms. It uses models that are already implemented in libraries such as scikit-learn, rather than deriving equations or writing algorithms from scratch.
Where the Book Focuses Its Attention
The authors say they made a deliberate choice to keep mathematics in the background and concentrate on the practical side of using machine learning algorithms. The goal is to help you apply these algorithms to problems, not to prove why they work in full mathematical depth. Your reading goal is therefore practical: understand which algorithm suits a problem and how to apply it.
The diagram below compares what the book covers with what it leaves out. Use it as a map of the book's scope before you read the chapters.
What the Book Sets Aside
The book deliberately sets aside two things: detailed mathematical analysis and writing algorithms from scratch. It does not take the analysis of each algorithm down to great detail, and it does not teach you to implement learning methods yourself.
The authors point readers who want the mathematics to a separate resource. They recommend The Elements of Statistical Learning by Trevor Hastie, Robert Tibshirani, and Jerome Friedman, which the source says is available for free at the authors' website. The book hands off mathematical depth to a dedicated text rather than trying to cover everything itself.
Working With Libraries Such as scikit-learn
The second part of the book's focus is how it expects you to work with algorithms. Rather than teaching you to write each learning method yourself, the book concentrates on using the large collection of models already implemented in scikit-learn and other libraries. The practical skill being developed is choosing and applying an available model to a task.
The example below illustrates the working style the book assumes. It does not implement a learning algorithm. It obtains a model that scikit-learn already provides, and that is the kind of object this book works with throughout. This example was written for illustration and is not taken from the source.
- The import brings in a model that scikit-learn already implements. You do not write the algorithm yourself.
- Creating the object gives you a ready-made model. The library handles the internal algorithm.
Choosing a Model From a Library Rather Than Coding One
You need to apply a machine learning method to a task. Following this book's approach, how should you proceed?
- 1Identify the task
Decide what you want the algorithm to do for your problem. The book's skill is matching an available model to a task.
- 2Look for an existing model
Check the models already implemented in scikit-learn or another library. The book uses these rather than asking you to write a learning method from scratch.
- 3Apply the model in code
Obtain the model object from the library and use it. The internal algorithm is handled by the library, so your main task is knowing which model fits and how to use it.
- 4Consult a separate resource for the mathematics
If you need the full mathematical analysis, the book points to The Elements of Statistical Learning rather than covering it itself.
You choose and apply an existing model suited to the task, relying on the library for the algorithm and on a separate text for the deep mathematics.
Mistakes Readers Make With This Book
Common mistake Expecting full mathematical derivations of each algorithm
Why it failsThe book deliberately keeps mathematics in the background and leaves detailed analysis to other resources.
Do this insteadRead the book for practical application skills. Use The Elements of Statistical Learning for the deep mathematics.
Common mistake Expecting to write each algorithm from scratch
Why it failsThe book does not teach writing algorithms from scratch. It uses models already implemented in scikit-learn and other libraries.
Do this insteadFocus on choosing an available model that fits the problem and applying it with the library.
Common mistake Concluding that mathematics is unimportant
Why it failsThe source names probability theory as the foundation on which machine learning is built. The book simply does not analyze each algorithm in great detail.
Do this insteadTreat the mathematics as foundational knowledge that the book hands off to a dedicated resource.
Checking Your Understanding of the Book's Scope
A friend says, 'This book will show me how to write a learning algorithm from scratch, so I can understand every equation.' Using what you have learned, explain why this expectation does not match the book's focus, and say what the book expects you to do with existing libraries instead.
Hints
- Look at the two things the book deliberately sets aside.
- Think about where the book sends readers who want full mathematical depth.
- The book's working style centers on choosing and applying an available model.
Key Takeaways
- This book focuses on the practical use of machine learning algorithms, with the goal of helping you apply them to problems.
- The book deliberately sets aside detailed mathematical analysis and writing algorithms from scratch, while recognizing that probability theory is the foundation of machine learning.
- Readers are expected to choose and apply models already implemented in scikit-learn and other libraries, leaving the internal algorithm to the library.
- For full mathematical depth, the book directs readers to The Elements of Statistical Learning.