100 Days of Machine Learning- Day 1–2, The Machine Learning Landscape

Munish Prasad Lohani
7 min readJun 13, 2024

--

Photo by h heyerlein on Unsplash

The Beginning

With the turn of the year, I told myself, “Not another year doing nothing!” I wanted to do something productive — learn something new, learn the hottest trend around. This is when I started exploring Machine Learning.

ML

Unlike a pure beginner, I was already familiar with certain ML concepts and Python concepts. But I was not satisfied. I wanted to explore the theory even more than I had before. I wanted to be a complete Machine-Learning Enthusiast. Well, I decided to start the trendy challenge with a twist — 100 days of Code. Oh wait, not code!

100 Days of Machine Learning

Throughout these 100 days, I decided I want to spend at least an hour learning Machine Learning concepts. I decided on using the famous Hands-on Machine Learning with Scikit-Learn, Keras & TensorFlow by Aurélien Géron and The Hundred-Page Machine Learning Book by Andry Burkov as my references (also ChatGPT for clarification).

Day 1–2: The Machine Learning Landscape

For my first two days, I wanted to learn more about Machine Learning in general as well as dive into some of its components.

What is Machine Learning?

The term “Machine Learning” has gained popularity in recent times. However, it is anything but new. Machine learning algorithms have been used for decades. But its popularity rose after the 1990s when the famous spam filter began to be widespread. So, what really is Machine Learning? Simply put, machine learning is the art of programming a computer to solve practical problems using data. If you want a more sophisticated answer, machine learning can be defined as a computer program where the machine learns from experience ‘E’ with respect to some task ‘T’ and a performance measure ‘P’.

Why Use Machine Learning?

Let’s go back a few decades, long before spam detection using ML was a thing. Now, let’s try making a spam detection algorithm. What would our approach be? Well, firstly, we would make an algorithm that would detect certain phrases like “amazing,” “4 you,” “free” as spam.

But there is a massive problem. What if the scammers write “4 u” instead? Would we have to change the algorithm again? Alas, we would have to. But with machine learning, we wouldn’t. Instead, we would simply feed it new spam data and let the computer do its thing. Isn’t it so simple?

Let’s take another example — a different one. Suppose we are trying to make a speech recognition algorithm. What’s our plan? Well, going traditional, it’s quite difficult. But with machine learning, it’s the opposite. We would first feed in the audio data with labels of words and train a model to identify these words.

In a nutshell, Machine Learning helps solve:

  • Problems for which existing solution requires a lot of fine-tuning
  • Problems that do not yield positive result with a traditional approach
  • Problems whose environment change frequently

Types of Machine learning Systems

Now that we know the basic use cases of Machine Learning and what it actually is, let’s dig deeper into its systems — let’s get the fun stuff going!

Supervised Learning

Supervised Learning

In supervised learning, the data set (training set) contains labels (or answers). Each element ‘x’ is called a feature vector. A feature vector is a vector where x^j for j=1…D, where j defines each dimension that describes the property of the example. For instance, if our x refers to a person, its dimensions x^j include weight, height, age, etc. A typical supervised learning task includes classification and regression.

Classification

Let’s take a spam detector, for example. In a spam detector, while we train the model, we feed in training data that includes emails as well as the answers (spam/ham). This helps the machine learn to classify new emails, i.e., email classification.

Regression

Regression includes predicting values based on a given set of values (predictors). For example, if we are to predict the price of a car, we would need its mileage, horsepower, age, etc. These are known as predictors. To train a model, we provide a set of training data that consists of all these predictors along with the price. This helps the machine predict new prices based on the predictors.

A graph showing linear regression
Wikipedia: Linear Regression

Regression-Classification

Some regression algorithms can also be used for classification. For example, logistic regression gives values between 0–1. This can also be used for spam detection (e.g., 0.2 spam).

Unsupervised Learning

Unsupervised Learning

In unsupervised learning, the model takes a collection of unlabeled data and returns an output that either transforms the feature vector into another vector or modifies it into other values that can be used to solve a practical problem.

Clustering

Clustering is an unsupervised learning process where we divide sets of data points based on their similarity. Data points within the same group are more similar to each other than those in other groups.

So, why cluster data? Well, let’s take an example: Let’s say we run an e-commerce company and want to sell our new product — an expensive perfume. But we don’t know the targeted audience to cater our product via email. This is where clustering comes in. Suppose we have a dataset of customers based on their salary and spending score — higher scores mean they spend more. Now, we plot a graph based on these features.

From the graph, we get four clusters: high income-high score, high income-low score, low income-high score, and low income-low score. So, if we are to sell our expensive product, we must try selling it to high income-high score or low income-high score customers via some discounts. We might also try selling it to high income-low score customers since some may buy it with a little discount. But trying to sell it to low income-low score customers is certainly a bad idea.

Dimensionality Reduction

This is a technique that takes data with numerous features but returns output with a reduced number of features. This technique helps simplify models, reduce storage, and reduce processing time. One way to do so is to merge similar features into one. For example, if the battery life and the age of a laptop are strongly correlated, a feature extraction technique like Principal Component Analysis (PCA) might transform these two features into a new set of uncorrelated features. These new features represent the underlying patterns in the data, capturing the most important information from the original features. This transformation process is called feature extraction

Anomaly Detection

In this technique, the system is shown mostly normal instances during training. So, when it experiences an abnormality with data, it flags it as an anomaly. One of the popular uses is fraud detection.

Associative Learning Rule

In this technique, we dig deeper into a large set of data to find interesting relations among the features. For example, let’s say we have a set of data containing a list of customers who buy potato chips. Upon further investigation of the data, we also find that these sets of customers tend to buy Coca-Cola. Thus, we may want to place both items together to maximize sales.

Semi-Supervised Learning

This is a combination of supervised learning and unsupervised learning. Here, some instances are labeled whereas most are not. So, the system itself identifies each label based on the clusters. A popular example of semi-supervised learning is Google Photos. Once we upload all the photos to the service, it automatically recognizes the patterns of people and divides them into clusters (unsupervised). Now, once we provide labels for each person in a single photo, the algorithm automatically labels other photos of the same person.

Semi Supervised Learning

Reinforcement Learning

Reinforcement learning is a sub-field of machine learning, a different beast. Here, the learning agent, called the agent, lives in an environment and can perceive the state of the environment. The machine can perform actions and in return get rewards (or penalties). Based on this, it must learn by itself the best action to get the maximum average result over time. This strategy is called the policy.

Reinforcement learning is mostly used to solve a particular problem where the goal is long-term.

Reinforcement Learning

Reflection: Day 1–2

tarting this long journey is indeed challenging, but it is equally engaging and exciting. I will continue posting blogs throughout these hundred days — in batches if not every day.

--

--