Chapter 4: How Do Machines Learn? — Introduction to Machine Learning (ML)
Ivy walked into the office the next morning, the weight of the previous day's conversation still fresh in her mind. She’d learned a lot about AI and its predictive powers, but there was one thing that kept nagging at her—how exactly does AI "learn"? It wasn’t magic. So how did machines get so smart?
Derek was already at his desk, sipping his coffee as usual. When he saw Ivy approach, he grinned. "You look like you’re ready for the next step."
"I am," Ivy said, sitting down across from him. "Yesterday you told me about AI predicting things, but I’m still kind of confused about how AI actually learns from all that data."
Derek set his coffee down and leaned forward, his eyes bright. “Great question. You’re already thinking like a data scientist. Okay, so here’s the thing—AI is all about learning from data. But there are different ways machines learn. This is where machine learning comes in.”
“Machine learning?” Ivy repeated, tilting her head. “Is that like... teaching a robot?”
“Not exactly,” Derek explained. “Machine learning is about teaching computers how to find patterns in data without explicitly programming them to do so. It’s about letting the machine use examples to learn from—just like how we learn from experience.”
Ivy nodded slowly. “Okay, so it’s like when I learned to recognize the different types of fruit at the market. I didn’t need someone to tell me, ‘This is an apple, this is a banana.’ I just saw them enough times to figure it out.”
“Exactly! That’s a perfect analogy,” Derek said, clearly impressed. “Machines work the same way. We give them data, and they learn from it.”
“But how does the machine know what to look for?” Ivy asked, a little more curious now. “What’s the difference between the things it should pay attention to?”
“There’s where the two types of machine learning come in—supervised and unsupervised learning,” Derek explained.
“Let me break it down. In supervised learning, the machine learns by example. You give it a set of labeled data—like telling it, ‘Here’s a picture of an apple and here’s a picture of a banana.’ The machine learns to tell the difference by being shown enough examples.”
Ivy thought about it for a second. “So, the machine learns the characteristics of apples and bananas because we gave it examples?”
“Exactly. Now, unsupervised learning is a little different. In this case, we don’t give the machine labels. We just give it data, and it has to figure out the patterns on its own. It might group things together based on similar traits, like grouping all the apples together, even though it doesn’t know what apples are yet. It’s kind of like clustering things by similarity.”
Ivy’s eyes widened. “So it’s like when I used to organize my books by color before I realized that was totally unhelpful.”
Derek laughed. “Exactly! You didn’t know which book was which, but you saw a pattern in their appearance. The machine does something similar in unsupervised learning.”
“Okay, so it’s about finding patterns either with labels or just by seeing the data?” Ivy asked, now feeling a lot more confident about the concept.
“Right. But there’s another important part of this. A machine learning model is only as good as the data it learns from. The data you feed it is like the teacher. So, we need high-quality, relevant data to make sure the machine learns correctly.”
Ivy frowned. “So, if we give it bad data, it learns the wrong thing?”
“Exactly,” Derek said. “That’s why it’s important to clean and prepare data before feeding it into a model. The better the data, the better the results.”
“I get it now,” Ivy said, nodding thoughtfully. “But how does this connect to what we’re doing with our campaigns?”
“Well,” Derek said, opening his laptop, “let’s put it into practice. I have a tool called Teachable Machine that will let us build a simple image classification model. It uses supervised learning. We’ll upload a bunch of images of different types of products, and the machine will learn how to recognize them based on those examples.”
“Wait, you want me to teach the machine how to recognize product images?” Ivy asked, her voice tinged with excitement.
“That’s right,” Derek said. “I’ll show you how it works. You upload pictures of, say, shoes, bags, and hats. Then, the machine will learn to classify new images into those categories based on the data we’ve given it.”
Ivy’s fingers hovered over the keyboard. “Okay, let’s do it. I’m curious to see how this works.”
Derek guided her through the process, showing her how to upload different sets of images, tagging them by category. As the machine began to process the images, Ivy watched in awe as it started to recognize patterns—colors, shapes, sizes—and categorize the new images accordingly.
“This is actually kind of fun,” Ivy said with a grin. “It’s like teaching the machine to play a game.”
Derek laughed. “Exactly. The better you teach it, the better it plays. And soon, you’ll be able to use this same method with our campaign data. For example, you could use machine learning to predict which images are more likely to engage users based on previous interactions.”
Ivy looked at the screen, a new sense of excitement bubbling up. “So, machine learning isn’t just for images. You can teach it anything. Like predicting what time users are most likely to be online?”
“You got it,” Derek said, his voice filled with pride. “Machine learning is all about making better decisions with data, whether it’s for images, text, or even predicting future behavior.”
Ivy sat back, her mind racing with possibilities. “This could change everything for our campaigns. If we could predict what people like and when they’re most active... we’d have a huge advantage.”
“Exactly,” Derek said. “And you’re just getting started.”