Hello Everyone,
Welcome to the 37th edition of my newsletter ML & AI Cupcakes!
In this newsletter, I have discussed some of the most commonly asked interview questions on perceptrons with answers.
Just remember one thing. Neural networks is an extension of perceptrons. So, if you want to have a strong understanding of neural networks fundamentals, you need to start with perceptrons.
In the next newsletter, I will share a basic implementation of a perceptron from scratch in python. It’s is very important from interview preperations perspective.
Stay tuned for the same!
1. What is a perceptron?
Answer: A perceptron is the earliest and simplest form of a neural network. It was introduced by Frank Rosenblatt in 1958. It is mainly used for linearly separable binary classification problems. It takes input features, find their linear combination, apply activation function (usually a step function) and make a binary classification decision.
Image credit: Author (Me)
2. What are the components of a perceptron?
Answer: The components of a perceptron are given below:
Input features: It takes input features like (x1,x2,…xn).
Weights: These determine the contribution of each feature in the linear combination or final result. There is a weight corresponding to each input feature like (w1, w2,…,wn).
Bias: It is added to make a shift in the decision boundary.
Activation function: The usual activation function used in a perceptron is ‘step function’. It is a simple function which makes binary decision (0 or 1) based on the linear combination of weights and bias.
Output: The output of a perceptron is class label (0 or 1).
3. What is meant by the data is linearly separable?
Answer: The dats is said to be linearly separable if we can divide its data points into mutually exclusive classes using a hyperplane.
In terms of binary classification problem with two variables, it means that the data points in two classes can be separated by a straight line.
Image credit: Author (Me)
4. Which activation function is generally used in a perceptron?
Answer: The most commonly used activation function in a perceptron is ‘step function’.
5. Can perceptrons handle non-linearly separable data?
Answer. No. Perceptrons are inherently designed to solve problems with linearly separable data only.
6. What is the weights update rule in a perceptron?
Answer. weight = weight + learning_rate*(actual_value - predicted_value)*input
7. Can a perceptron be used for regression problems?
Answers. Not really. A perceptron is inherently designed as a linear classifier and so, not suitable for regression problems.
8. What are the limitations of a perceptron?
Answer: Some of the limitations are given below:
It can handle only linearly separable data.
Inherently, it can handle only binary classification problems. Though adjustments can be made to make it handle multi-class problems.
It directly predicts the class labels (0 or 1). It doesn’t provide class probabilities like logistic regression which is a crucial factor in various machine learning use cases.
9. How the convergence is defined in a perceptron?
Answer: It means that the algorithm has found a hyperplace which makes correct predictions for most of the data points after a finite number of steps.
10. What are the differences between a perceptron and a logistic regression model?
Answer: The key differences are summarized below:
Image Credit: Author (Me)
11. What other algorithms can be used to overcome the limitations of a perceptron?
Answer: Neural networks, SVM, Logistic regression etc.
Writing each newsletter takes a lot of research, time and effort. Just want to make sure it reaches maximum people to help them grow in their AI/ML journey.
It would be great if you could share this newsletter with your network.
Also, please let me know your feedbacks and suggestions in the comments section. That will help me keep going. Even a “like” on my posts will tell me that my posts are helpful to you.
See you soon!
-Kavita
Really helpful for a non tech person