1. An Introduction to the World of Machine Learning

Rithesh K
7 min readMar 25, 2024

--

This is a part of the Machine Learning series.

  1. This post
  2. First Look into Machine Learning
  3. Probability for Machine Learning — The Basics

Hi everyone! I am back to writing on Medium after a long time. I want to start it off with some basics of machine learning. It will be a series of blogs, each covering a concept in ML with some Python code for practice. But I will keep it more engaging and intuitive. When we come to the math-intensive components, I will add more details and references to check out (at least, that’s the plan!).

I cannot guarantee that I will cover all the topics in Machine Learning or that this will be a substitute for an actual course at a university. You can treat this as an additional guide to ML and something you can fall back on for some concepts you need help understanding.

Prerequisites

This is an introductory level of discussion and will not require you to know what Machine Learning is beforehand. However, you need to know basic levels of Statistics to understand some of the concepts I will be discussing—and the high school level of Calculus (coz Machine Learning is full of it). But I will explain as much as possible so you’re not left in the dark or anything.

I will add some code snippets along the way, written in Python. So, you need to know a bit of Python to do this. But you should be fine if you have some coding experience in any language. Honestly, Python is one of the simplest languages to write and understand algorithms (though I cannot say the same about understanding the internals of the language itself, but we won’t deal with that here). On a side note, I recommend Head First Python by Paul Barry if you want to learn Python.

References

I will structure my posts with the help of the book Pattern Recognition and Machine Learning by Christopher Bishop. You don’t have to read the book for this, as that’s pretty much my job while writing these posts, but you can try the book. I will warn you that the book has 700+ pages, so that you might get bored with it. But I recommend reading the book on some concepts you might need more understanding.

I will also refer to the CS229: Machine Learning course by Stanford University for some parts of the posts. You can find the lecture notes for the course on their website, and the lecture videos are available on YouTube.

There are so many other excellent textbooks, lectures, and blogs talking about Machine Learning, and they are all highly informative.

Why am I writing this series?

While they are all very instructive, are they all equally engaging? Do they keep you excited and make you want to learn more about Machine Learning?

A few days ago, a very good friend of mine wanted to get into ML. I recommended the video lectures and a few blogs I used to refer to while learning about the field. But after giving it a try, she didn’t find it as interesting as I did. While they were all educational, she felt too much information was delivered quickly, and losing track of it all was easy. I then felt this could be why many haven’t given ML a good shot.

And that’s why I am writing this series. I have a reputation for explaining things very well (my friends can endorse this for me XD) and want to make this series a compelling force for readers to try a hand at Machine Learning. To show what attracted me to this field and if it can bring them in too.

Now, then, what is Machine Learning? And how is it different from this other term that is so in the news these days — AI

Machine Learning and AI — Are they the same?

In a single word — No, they are not. But it’s hard to dismiss them as two separate things. You can consider them as sister fields — a lot of similarities, but they are on their own.

Artificial Intelligence — AI in short — refers to intelligent machines (computers, robots…) programmed to think and act like humans, with a bit of rationality in them (I like this definition from the Artificial Intelligence — A Modern Approach book). It contains a broad spectrum of ideas you use to make your system complete tasks that usually require a human. For example, it could be to identify a person by his face, get the lyrics of a song, check the MRI scans to see if there are any tumors, or even drive a car all by itself.

On the other hand, Machine Learning is about writing algorithms to understand the behavior of the data you have and make decisions from it. It could be something like, “Look at these data points and try to see if there’s a pattern” or “So these images are all dogs, and these are all cats. I’ll give you a new image. Is it a dog or a cat?” You don’t write explicit rules to do these tasks, but you’ll make your program learn from the data you give and write its own rules.

By definition, AI and ML seem to be different. One is about learning from data, and the other is about trying to do human tasks. But in reality, they overlap very frequently. Many real-life applications that need AI will have something to do with data. You need to take real-world data (listen to the song, look at the person’s face, read the texts, look at what’s around a car — all of these are some form of data) and make decisions from it. You don’t know exactly how you get the decision from the data. For example, a song is just some sound waves hitting your ears. An image is just some light pixels falling on our eyes. How are we combining some sound waves to get meaningful lyrics or grouping the light pixels to say it is a dog and not a cat? We want the machine to learn how to do these tasks by itself, as writing rules for them is not usually practical. And that’s where Machine Learning steps in.

I like to think of ML as tools that help AI solve problems. ML allows AI systems to learn from data, recognize patterns, and make decisions without an explicit program for every specific task. AI is the dream that is being realized with the help of ML (too fancy? maybe)

Are any tools and approaches used in AI applications that are not strictly Machine Learning? Yes, there are plenty. Some other algorithms that AI uses include Heuristic Search algorithms (A* search, for example), Genetic Algorithms, Knowledge Representation, Expert Systems, and a lot more. I say not strictly Machine Learning here because we sometimes use ML along with these approaches to solve the problem. So, they are all interconnected, but they are not the same.

How is ML different from… regular algorithms?

Well, let’s call them traditional algorithms. Or common algorithms? Familiar algorithms? Okay, traditional algorithms will do.

For the traditional algorithms, you need to define the rules of the task. The algorithms will follow a fixed set of instructions to perform the task. And they will fail if the real-life data has any variations from the instructions provided.

Let’s say, for example, you want to predict if it will rain tomorrow. And in your city, it only depends on today’s temperature and humidity readings (this is way too much generalization, but it is good enough as an example for now. In reality, weather prediction is a huge challenge and has a lot of variables to consider). But what is the relation? Is it linear? Exponential? We don’t have any information about it. So, even if you measure today’s readings, you don’t know the formula (or the algorithm) to find out tomorrow’s weather conditions.

But for a Machine Learning algorithm, you don’t need to know the relation. All you need is a collection of past readings and if it had rained or not. You can feed all that to an ML model and let it learn the relation by itself. Then, you can use the trained ML model to predict tomorrow’s weather. Also, what if the readings you took were faulty? Or there was a bit of noise in the instruments? Don’t worry. ML models have got it covered. Where the traditional model failed, the ML model succeeded.

Does that mean you don’t need a traditional approach to problems? No. Conventional algorithms are still the best when the relation is well-defined. While ML models are great at finding out relations with the data, they do not always give you 100% accurate results. After all, they try to estimate the relationship. But if you already know the logic, use traditional methods and always get precise results. (I am loosely using the terms “accuracy” and “precision” here. We will see what they both mean in future posts).

For example, you don’t need an ML algorithm if you want to read a barcode. Barcodes are fixed. Information is always consistently encoded in the bars. And you can learn the meaning of each bar quickly. So, just a plain algorithm with the rules is enough. (I give this example because I came across someone trying to build an ML algorithm to read barcodes. Please don’t do that XD).

Just remember this. If you know the relation between the data and are sure it doesn’t have any variations, write the relation as an algorithm (the traditional way). If you’re unsure of the relation or feel there could be some noise or abrupt data values, go for Machine Learning.

Alright, that’s it for this post. Next post: A first look into Machine Learning.

--

--

Rithesh K

An AI Enthusiast trying to explore the world with the love for Mathematics.