Machine Learning Algorithms for Beginners

A quick intro to various machine learning algorithms!

Shivam Dhyani
TheLeanProgrammer
5 min readApr 21, 2021

--

Introduction

Machine Learning is the most trending way to achieve Artificial Intelligence. But it’s a data-driven field i.e. it requires a lot of data to train a model. To fetch the desired output from the large amount of data we use various Machine Learning Algorithms. The selection of these algorithms depends upon the type of the data, the amount of the data, and the expected output from the data. Hence, the selection of the algorithm is one of the most crucial parts of any Machine Learning Project.

Now, these Machine Learning Algorithms are mainly classified based on the type of input data. They are of three types:-

1. Supervised Learning Algorithms

These algorithms work on Labeled data i.e. data that describes the information that it contains. For Example:- Any document file which contains a name that specifies the content of the document.

2. Un-Supervised Learning Algorithms

These algorithms work on Non-Labeled data i.e. data that does not describe the information that it contains. For Example:- A random number value “2023”. It doesn’t come with any prior data that describes it.

3. Reinforcement Learning Algorithms

These algorithms are different from the above-discussed algorithms. Here the data provided as input to the reinforcement algorithm is considered if it generates the expected output, else neglected. The algorithm then improves its internal working based on the considered input and hence becomes more accurate.

The Four Common Algorithms…

Now, based on the above-discussed category of Machine Learning Algorithms, there are (in general) 4 types of Algorithms that are most commonly used in a Machine Learning Project. These algorithms are as follows:-

1. Regression

The Regression Algorithm is used when the output data is expected to generate continuous values. It is easy to implement and is represented in a form of a graph. It is a Supervised Learning Algorithm. It is generally used in predictive analysis such as predicting the demand for any product in the future, predicting stock market price, etc.

There are many forms of Regression Algorithms based on the number of parameters required for filtering the output. But the most common among these are Linear Regression. It consists of two parameters that are plotted in a two-dimensional graph. It uses the first-degree curve equation to represent in mathematical form.

y = (m * x) + c

Below is an image showing the graph of Linear Regression.

Linear Regression

2. Classification

The Regression Algorithm is used when the output data is expected to generate discrete values. It is also a Supervised Learning Algorithm. Here, the data is divided into different classes, and operations are performed to predict the output.

There are basically three types of Classification algorithms. They are as follows:-

a. Two-Class Classification Algorithm

As the name suggests, in the two-class classification algorithm the data is divided into two classes and then operations are performed on them to predict the output. This algorithm is also called as Binary Classification algorithm. For example, predicting the future decision of a customer that, will he buy the product or not.

Below is an image showing the graph of Two-Class Classification.

Two-Class Classification

b. Multi-Class Classification Algorithm

Here the data is divided into three or more than three classes to create several categories. Due to this, we can predict output between multiple categories. For Example, to predict a person's mood — happy, sad, angry, impressed, etc. To find which factors draw the customer's attention towards a product.

Below is an image showing the graph of Multi-Class Classification.

Multi-Class Classification

c. Decision Tree Algorithm

The Decision Tree Algorithm works a little differently from the above-discussed algorithms of the Classification category. It works on discrete data and gives binary output — Yes or No. The advantage of using a decision tree algorithm is that the input data need not be much cleaned before providing it to the algorithm. But, this algorithm requires a lot of training compared to others to generate the output. For Example, to predict the income-expenditure of a person of a certain age group.

Below is an image showing the structure of the decision tree of this example.

Structure of Decision Tree Algorithm

3. Clustering

As the name suggests, here the data forms clusters based upon their similarities. It looks similar to Multi-Class Classification but is different as is an Un-Supervised Learning Algorithm. Here, the concept of the mean from statistics is used for clustering of data. The most common and popular algorithm of Clustering is K-Means Algorithm.

In K-Means Algorithm, the input data is plotted into a graph and based upon the variations in values between, then it gets divided into three divisions. These three divisions are called clusters. Then for each individual cluster, a calculating point is found by calculating the mean of the cluster. For Example, to put customers in different segments based on their past purchases in an E-Commerce Website.

Below is an image showing the graph of the K-Means Algorithm.

K-Means Algorithm

4. Neural Network

Neural Network is the newly developing field in Machine Learning and is very popular among developers as well as users who are using its applications. Here artificial neurons are used to form a network between them so that they can mimic the working of a human brain. Hence, human-like activities such as recognizing an image, faces, and voices.

Here in the Artificial neural network, there are some hidden layers between the input and output layer depending on the complexity of the problem. Every neuron is connected with the other neuron of the successive layer with a biased value when keeps on improving during training the model.

Below is an image showing the Artificial Neural Network.

Artificial Neural Network

We hope now you have a better understanding of Machine Learning & how it plays with data to generate the desired output.

Don’t forget to follow The Lean Programmer Publication for more such articles, and subscribe to our newsletter tinyletter.com/TheLeanProgrammer

--

--