1.2 Machine Learning Fundamentals

What is Machine Learning?

Machine learning is a way of making computers learn from data and experience, without explicitly telling them what to do. It is a branch of artificial intelligence that has been around since the 1950s, when a couple of scientists, such as Alan Turing, John McCarthy, and Marvin Minsky, started to explore how computers could mimic human intelligence. Machine learning can help us solve many problems, such as recognizing faces, translating languages, playing games, and more. Machine learning is not magic, though. It is based on mathematical and statistical methods that allow computers to find patterns and make predictions from data. 

How does it work?

Machine learning works by using algorithms, which are sets of instructions or rules, to process data and find patterns or relationships in it. For example, an algorithm can look at a bunch of pictures of animals and learn to recognize which ones are cats and which ones are dogs, based on their features like fur, ears, tails, and so on.

There are different types of machine learning, depending on how they learn and what they learn. Some of the most common ones are:

  • Supervised learning: This is when the algorithm learns from labelled data, which means the data has the correct answers or outcomes already given. For example, if you want to teach an algorithm to identify spam emails, you can give it a bunch of emails labelled as spam or not spam, and it will learn to find the features that make an email spammy or not.
  • Unsupervised learning: This is when the algorithm learns from unlabeled data, meaning the data has no correct answers or outcomes. The algorithm has to find its way of organizing or grouping the data based on some criteria. For example, if you give an algorithm a bunch of pictures of people’s faces, it can learn to cluster them based on their similarities, such as age, gender, ethnicity, etc.
  • Reinforcement learning: This is when the algorithm learns from its actions and feedback, which means the data is generated by the algorithm’s interaction with an environment. The algorithm has to find the best actions to take to maximize a reward or minimize a penalty. For example, if you want to teach an algorithm to play a video game, you can give it a score based on how well it performs, and it will learn to improve its strategy over time.

Basic Machine Learning Algorithms

There are many types of machine learning algorithms, but here are three basic ones that you should know:

  • Linear Regression: This is a supervised learning algorithm used primarily for regression tasks, i.e., predicting a continuous output variable based on one or more input variables It tries to find the best straight line that fits the data points. For example, if you have data about the height and weight of people, you can use linear regression to find the relationship between them and predict the weight of a person given their height.
  • Decision Trees: This algorithm splits the data into smaller groups based on some criteria, such as a question or a rule. For example, if you have data about the weather and whether people go to the park or not, you can use decision trees to find out what factors influence their decision and predict whether someone will go to the park or not based on the weather.
A representation of the Decision tree example above

A representation of the Decision tree example above

Decision trees can be used for both classification and regression tasks as they work by creating a tree-like model of decisions based on the input variables. For classification problems, each leaf of the tree represents a class label, while for regression problems, it represents a continuous output. 

  • K-Nearest Neighbors: This algorithm finds the most similar data points to a new one and assigns them to the same label or value. For example, if you have data about the genre and rating of movies, you can use k-nearest neighbours to find the most similar movies to a new one and predict their genre or rating.

These are just some of the basic algorithms in machine learning, but there are many more to explore and learn. Machine learning is a fascinating and powerful field that can help us solve many problems and discover new insights.

Scroll to Top