×

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

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.

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.

Epoch in Machine Learning

Machine Learning is one of the most used modern technologies in the world. Machine Learning helps human a lot to do their jobs at ease. Epoch is an important concept...

3 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.

Applications of Machine Learning

If you have connection with technical world then you have must heard about Machine Learning. It is one of the modern technologies. Machine Learning is the future of our tech...

6 minutes read.

Kaggle Machine Learning Project

What is Kaggle? Data scientists and machine learning enthusiasts connect online at Kaggle. Users of Kaggle can work together, access and share datasets, use notebooks with GPU integration, and compete with...

6 minutes read.

Boosting in Machine Learning

Machine Learning and Artificial Intelligence are one of the major modern technologies. In Machine Learning, we mainly develop a model by a Machine Learning algorithm which can predict something. In...

3 minutes read.

Genetic Algorithm in Machine Learning

Genetic algorithm Genetic algorithms are basically search algorithms that are different from conventional search algorithms. Compared to conventional search algorithms, it is based on Darwin's theory of evolution. It is used to...

3 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.

Heart Disease Prediction Using Machine Learning

The world uses machine learning in many different fields. This is also true in the healthcare sector. Machine learning may be crucial in determining if locomotor disorders, heart illnesses, and...

12 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 Techniques

In today's world, we are surrounded by machines and different types of gadgets. Machine learning is a technique which prepares machines to think and learn. In modern days machine learning...

6 minutes read.

Top 5 programming languages and their libraries for Machine Learning

In this data-driven era, Artificial Intelligence and Machine Learning are combined in every business. Machine learning-based solutions are used to increase the speed. There are many programming languages available for...

3 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.

Machine Learning Gesture Recognition

Strong attempts have recently been made to create user-computer interfaces that are intelligent, natural and based on human gestures. Both human and computers may use gestures as an interactive design. Therefore,...

12 minutes read.

Feature engineering for 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. Feature engineering is an important...

6 minutes read.

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.

K-means clustering Algorithm

Introduction to K-means clustering K-mean clustering comes under the unsupervised based learning, is a process of splitting an unlabeled dataset into the clusters based on some similarity patterns present in the data. Given...

9 minutes read.

Feature Extraction in Machine Learning

With the advancement of technology in the databases, everyone can store a vast amount of data with hundreds of thousands of features these days. Features contain information about the dependent...

4 minutes read.

Best Python Libraries for Machine Learning

Machine Learning is an important technology in modern days. It helps us to do the things which were not possible in previous days. If you have interest in Machine Learning...

8 minutes read.