Grokking Machine Learning
eBook - ePub

Grokking Machine Learning

Luis Serrano

Share book
  1. 512 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Grokking Machine Learning

Luis Serrano

Book details
Book preview
Table of contents
Citations

About This Book

Discover valuable machine learning techniques you can understand and apply using just high-school math. In Grokking Machine Learning you will learn: Supervised algorithms for classifying and splitting data
Methods for cleaning and simplifying data
Machine learning packages and tools
Neural networks and ensemble methods for complex datasets Grokking Machine Learning teaches you how to apply ML to your projects using only standard Python code and high school-level math. No specialist knowledge is required to tackle the hands-on exercises using Python and readily available machine learning tools. Packed with easy-to-follow Python-based exercises and mini-projects, this book sets you on the path to becoming a machine learning expert. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the technology
Discover powerful machine learning techniques you can understand and apply using only high school math! Put simply, machine learning is a set of techniques for data analysis based on algorithms that deliver better results as you give them more data. ML powers many cutting-edge technologies, such as recommendation systems, facial recognition software, smart speakers, and even self-driving cars. This unique book introduces the core concepts of machine learning, using relatable examples, engaging exercises, and crisp illustrations. About the book
Grokking Machine Learning presents machine learning algorithms and techniques in a way that anyone can understand. This book skips the confused academic jargon and offers clear explanations that require only basic algebra. As you go, you'll build interesting projects with Python, including models for spam detection and image recognition. You'll also pick up practical skills for cleaning and preparing data. What's inside Supervised algorithms for classifying and splitting data
Methods for cleaning and simplifying data
Machine learning packages and tools
Neural networks and ensemble methods for complex datasetsAbout the reader
For readers who know basic Python. No machine learning knowledge necessary. About the author
Luis G. Serrano is a research scientist in quantum artificial intelligence. Previously, he was a Machine Learning Engineer at Google and Lead Artificial Intelligence Educator at Apple.Table of Contents
1 What is machine learning? It is common sense, except done by a computer
2 Types of machine learning
3 Drawing a line close to our points: Linear regression
4 Optimizing the training process: Underfitting, overfitting, testing, and regularization
5 Using lines to split our points: The perceptron algorithm
6 A continuous approach to splitting points: Logistic classifiers
7 How do you measure classification models? Accuracy and its friends
8 Using probability to its maximum: The naive Bayes model
9 Splitting data by asking questions: Decision trees
10 Combining building blocks to gain more power: Neural networks
11 Finding boundaries with style: Support vector machines and the kernel method
12 Combining models to maximize results: Ensemble learning
13 Putting it all in practice: A real-life example of data engineering and machine learning

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Grokking Machine Learning an online PDF/ePUB?
Yes, you can access Grokking Machine Learning by Luis Serrano in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Python. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Manning
Year
2021
ISBN
9781638350200

1 What is machine learning? It is common sense, except done by a computer

In this chapter
  • what is machine learning
  • is machine learning hard (spoiler: no)
  • what do we learn in this book
  • what is artificial intelligence, and how does it differ from machine learning
  • how do humans think, and how can we inject those ideas into a machine
  • some basic machine learning examples in real life
I am super happy to join you in your learning journey!
Welcome to this book! I’m super happy to be joining you in this journey through understanding machine learning. At a high level, machine learning is a process in which the computer solves problems and makes decisions in much the same way as humans.
In this book, I want to bring one message to you: machine learning is easy! You do not need to have a heavy math and programming background to understand it. You do need some basic mathematics, but the main ingredients are common sense, a good visual intuition, and a desire to learn and apply these methods to anything that you are passionate about and where you want to make an improvement in the world. I’ve had an absolute blast writing this book, because I love growing my understanding of this topic, and I hope you have a blast reading it and diving deep into machine learning!
Machine learning is everywhere
Machine learning is everywhere. This statement seems to be truer every day. I have a hard time imagining a single aspect of life that cannot be improved in some way or another by machine learning. For any job that requires repetition or looking at data and gathering conclusions, machine learning can help. During the last few years, machine learning has seen tremendous growth due to the advances in computing power and the ubiquity of data collection. Just to name a few applications of machine learning: recommendation systems, image recognition, text processing, self-driving cars, spam recognition, medical diagnoses . . . the list goes on. Perhaps you have a goal or an area in which you want to make an impact (or maybe you are already making it!). Very likely, machine learning can be applied to that field—perhaps that is what brought you to this book. Let’s find out together!

Do I need a heavy math and coding background to understand machine learning?

No. Machine learning requires imagination, creativity, and a visual mind. Machine learning is about picking up patterns that appear in the world and using those patterns to make predictions in the future. If you enjoy finding patterns and spotting correlations, then you can do machine learning. If I were to tell you that I stopped smoking and am eating more vegetables and exercising, what would you predict will happen to my health in one year? Perhaps that it will improve. If I were to tell you that I’ve switched from wearing red sweaters to green sweaters, what would you predict will happen to my health in one year? Perhaps that it won’t change much (it may, but not based on the information I gave you). Spotting these correlations and patterns is what machine learning is about. The only difference is that in machine learning, we attach formulas and numbers to these patterns to get computers to spot them.
Some mathematics and coding knowledge are needed to do machine learning, but you don’t need to be an expert. If you are an expert in either of them, or both, you will certainly find your skills will be rewarded. But if you are not, you can still learn machine learning and pick up the mathematics and coding as you go. In this book, we introduce all the mathematical concepts we need at the moment we need them. When it comes to coding, how much code you write in machine learning is up to you. Machine learning jobs range from those who code all day long, to those who don’t code at all. Many packages, APIs, and tools help us do machine learning with minimal coding. Every day, machine learning is more available to everyone in the world, and I’m glad you’ve jumped on the bandwagon!
Formulas and code are fun when seen as a language
In most machine learning books, algorithms are explained mathematically using formulas, derivatives, and so on. Although these precise descriptions of the methods work well in practice, a formula sitting by itself can be more confusing than illustrative. However, like a musical score, a formula may hide a beautiful melody behind the confusion. For example, let’s look at this formula: Σi4=1i. It looks ugly at first glance, but it represents a very simple sum, namely, 1 + 2 + 3 + 4. And what about Σin=1wi? That is simply the sum of many (n) numbers. But when I think of a sum of many numbers, I’d rather imagine something like 3 + 2 + 4 + 27, rather than 1 Σin=1wi. Whenever I see a formula, I immediately have to imagine a small example of it, and then the picture is clearer in my mind. When I see something like P(A|B), what comes to mind? That is a conditional probability, so I think of some sentence along the lines of “The probability that an event A occurs given that another event B already occurs.” For example, if A represents rain today and B represents living in the Amazon rain forest, then the formula P(A|B) = 0.8 simply means “The probability that it rains today given that we live in the Amazon rain forest is 80%.”
If you do love formulas, don’t worry—this book still has them. But they will appear right after the example that illustrates them.
The same phenomenon happens with code. If we look at code from far away, it may look complicated, and we might find it hard to imagine that someone could fit all of that in their head. However, code is simply a sequence of steps, and normally each of these steps is simple. In this book, we’ll write code, but it will be broken down into simple steps, and each step will be carefully explained with examples or illustrations. During the first few chapters, we will be coding our models from scratch to understand how they work. In the later chapters, however, the models get more complicated. For these, we will use packages such as Scikit-Learn, Turi Create, or Keras, which have implemented most machine learning algorithms with great clarity and power.

OK, so what exactly is machine learning?

To define machine learning, first let’s define a more general term: artificial intelligence.
What is artificial intelligence?
Artificial intelligence (AI) is a general term, which we define as follows:
artificial intelligence The set of all tasks in which a computer can make decisions
In many cases, a computer makes these decisions by mimicking the ways a human makes decisions. In other cases, they may mimic evolutionary processes, genetic processes, or physical processes. But in general, any time we see a computer solving a problem by itself, be it driving a car, finding a route between two points, diagnosing a patient, or recommending a movie, we are looking at artificial intelligence.
What is machine learning?
Machine learning is similar to artificial intelligence, and often their definitions are confused. Machine learning (ML) is a part of artificial intelligence, and we define it as follows:
machine learning The set of all tasks in which a computer can make decisions based on data
What does this mean? Allow me to illustrate with the diagram in figure 1.1.
Figure 1.1 Machine learning is a part of artificial intelligence.
Let’s go back to looking at how humans make decisions. In general terms, we make decisions in the following two ways:
  • By using logic and reasoning
  • By using our experience
For ...

Table of contents