×

Perceptron in Machine Learning

Machine Learning is becoming a very important part of the technology industry day by day. Perceptron is one of the key things of Machine Learning. Mr. Frank Rosenblatt invented this thing in the mid of 19th century. In this article, we are going to explore perceptron in detail.

What is the Perceptron in Machine Learning?

It is supervised learning technology. It is mainly considered a unit of artificial neural networks. Perceptron is considered the simplest neural network structure. It has four different parameters. They are input values, weights and Bias, net sum, and an activation function.

Some basic things in perceptron

  1. Perceptron inputs: These inputs can also be called input nodes. This is the primary level of the perceptron. It takes inputs. All the inputs will be in numerical value.
  2. Weight: It shows the strength of each node in the perceptron.
  3. Values: The value which every node takes is called the value.
  4. Activation function: This function is a major part of the perceptron. This part of the perceptron decides whether the neural network will proceed or not. Activation functions can be of different types sign function, sigmoid function, and step function.

A basic example of perceptron

Let's understand this concept by a simple example. As we know, that perceptron works as a neural network. So we can think about our brain. When our brain decides something, it judges some point and then decides what to do. The same case happens with perceptron. Just think we are making a perceptron so that we can decide whether to go to watch a cricket match or not. This thing will surely depend upon some parameters like where the ground is, how it will cost, which teams will play, whether any friend is going or not and etc.

CriteriaInput valueWeight
The ground is nearX1 = 1W1 = 0.4
The team is IndiaX2 = 1W2 = 0.6
The cost is lowX3 = 0W3 = 0.5
Virat Kohli is playingX4 = 0W4 = 0.4
It is a T20 matchX5 = 1W5 = 0.6
It is an IPL matchX6 = 0W6 = 0.2
Friends are goingX7 = 1W7 = 0.6

Algorithm to calculate the result

Frank Rosenblatt suggested the algorithm as follows:

  1. Set a threshold value.
  2. Multiply all inputs with their weights.
  3. Sum all the results.
  4. Activate the output.

Set a threshold value

So, for this example, we are going to set a threshold value. But you have to remember that this value may vary from person to person. What I am trying to say is that if you are taking the threshold as two, then another guy may be your friend can take 1 or 3. If someone is taking 3 means, he wants genuine reasons to go to watch the game. If someone is taking 1 means, he wants very few reasons to go to watch the game.

Multiply all inputs with their weights

In this step, we will multiply values with weight. We have to find  X*W for every node.

  1. X1 * W1 = 1 * 0.4 = 0.4
  2. X2 * W2 = 1 * 0.6 = 0.6
  3. X3 * W3 = 0 * 0.5 = 0
  4. X4 * W4 = 0 * 0.4 = 0
  5. X5 * W5 = 1 * 0.6 = 0.6
  6. X6 * W6 = 0 * 0.2 = 0
  7. X7 * W7 = 1 * 0.6 = 0.6

Sum all the results

In this step, we will sum all the results we got from the previous step. So the sum will be as follows.

 Sum= 0.4 + 0.6 + 0 + 0 + 0.6 + 0 + 0.6 = 2.2                            

Activate the output

Now, we will go through activate function, which will check whether the result exceeds the threshold or not. In this example result sum = 2.2, and our threshold value is 2. So we can conclude with the result that we can go to watch cricket match.

Here is the basic code for this example:

const threshold = 1.5;
const inputs = [1, 1, 0, 0, 1, 0, 1];
const weights = [0.4, 0.6, 0.5, 0.4, 0.6, 0.2, 0.6];


let sum = 0;
for (let i = 0; i < inputs.length; i++) {
  sum += inputs[i] * weights[i];
}


const activate = (sum > 2);

Related Topics

Perceptron in Machine Learning

Machine Learning is becoming a very important part of the technology industry day by day. Perceptron is one of the key things of Machine Learning. Mr. Frank Rosenblatt invented this...

3 minutes read.

Diabetes Prediction using Machine Learning

Diabetes Mellitus (shortly known as Diabetes) is one of the fastest-growing diseases. Nowadays, many people are affected with diabetes for many reasons, irrespective of age. Recently, many people who belong...

6 minutes read.

Top 10 Books on Machine Learning

If you are looking to explore some new domains in engineering field then you may like ML or Machine Learning. The popularity of Machine Learning is increasing gradually day by...

5 minutes read.

Machine Learning Projects for the Final Year Students

We live in a technologically advanced age where machines and various technologies are all around us. Machine learning is a method for teaching computers to think and learn. In the...

7 minutes read.

Standardization in Machine Learning

In machine learning, we train our data to anticipate or categorize things in ways that aren't pre-programmed into the computer. As a result, firstly, the dataset or input data must...

6 minutes read.

Python Anaconda setup

Python programming language is used in this tutorial to get hands-on machine learning. A compatible IDE (Integrated Development Environment) is needed to be installed on the computer system before using...

3 minutes read.

Bias and Variances in Machine Learning

Machine Learning is an important part in many industries. Machine Learning mainly works on predicting things depending on given input. Machine Learning models are trained over a sample data set....

4 minutes read.

Association Rule Learning Algorithm

Introduction to Association Rule Learning Association rule learning extracts alliances among the datapoints in a huge dataset. It incorporates the concept of data mining, which helps in finding useful commercial associations or regularities between the...

3 minutes read.

Supervised Machine Learning

What is Supervised Machine Learning? In Supervised learning, the machine is trained with the help of well-labeled training data, i.e., the data is tagged with the truthful answer. In other words,...

8 minutes read.

AWS Machine Learning Certification

In the technical world, you must have heard the name of AWS. Its full form is Amazon Web Services. What is AWS (Amazon Web Services)? You must have heard about cloud technology....

3 minutes read.

Pattern Recognition and Machine Learning a MATLAB Companion

The cognitive process that occurs in the brain when it compares the information that we see with the information stored in our memories is called pattern recognition. It is what...

10 minutes read.

Overfitting and Underfitting in Machine Learning

We actually talk about prediction errors, which are a measure of a machine learning model's performance and accuracy. Think about the possibility that we are developing a machine learning model....

3 minutes read.

Data Preprocessing in Machine Learning

Before starting a machine learning project, data is an essential thing needed before starting a project. The data used in ML projects is in CSV (Comma Separated Value) format. It...

9 minutes read.

Logistic Regression in Machine learning

The Logistic regression model is a supervised learning model that is used to forecast the possibility of a target variable. The dependent variable would have two classes, or we can...

9 minutes read.

Basics Vectors in Linear Algebra in ML

First, to learn Machine Learning sincerely, we must know about vectors in Linear Algebra. The principle of Linear Algebra is very much important here. Linear Algebra is the study of...

3 minutes read.

Machine Learning Clustering Algorithm

Introduction to ML Clustering Algorithm Clustering falls under unsupervised learning methods. In this, the machine is provided with a set of unlabeled data, and the machine is required to extract the structure from...

2 minutes read.

KNN algorithm in Machine Learning

Machine Learning is one of the most used modern technologies in our world. Machine Learning helps human a lot to do their jobs at ease. Today almost every big tech...

7 minutes read.

Machine Learning Engineer Salary in Different Organisation

We are very familiar with the word Machine Learning nowadays. Machine Learning technologies are used everywhere. Many IT companies use this type of technologies to improve their product. This branch...

3 minutes read.

Student Performance Prediction Using Machine Learning

Machine learning is a powerful tool that can be used to analyze and make predictions about student performance. One of the key advantages of using machine learning for student performance...

11 minutes read.

Machine Learning Algorithms

Machine learning algorithms are powerful methods and techniques which are high in terms of probability and used to give computers high power to compute the solution for large numbers of...

4 minutes read.