# How can a perceptron be used for regression?

I know perceptron is a binary classifier which has a 0/1 output. But in one of my exercises for a Neural Network course, there is a question that asks to implement a linear regression with perceptron. Unfortunately, I have no idea.

• What is the question literally? There are different ways I can imagine a perceptron(/dummy variable?) in a regression. – Martijn Weterings Mar 16 '18 at 19:13
• @MartijnWeterings different features of homes are given, I should learn the price of new homes. the question wants I write a perceptron that does regression. – Farhad Bat Mar 16 '18 at 19:31
• This is still not very clear. Is it that you are supposed to do a binary classification of expensive-cheap homes? What is literally the question (not what the question wants)? – Martijn Weterings Mar 16 '18 at 20:21
• I had asked somewhat related question. Check out. It'll surely help you - stats.stackexchange.com/questions/253337/… – tired and bored dev Mar 17 '18 at 5:36

## 1 Answer

The difference between linear regression and logistic regression is the activation function, which converts the logits (W$\cdot$X) to a probability-like value.

If you specifically need to keep the activation function in the perceptron algorithm, then I would say you have to consider it as a multi-class classification problem, where the classes are all the house prices. For example, class1 = 1000, class2 = 1001 ... classN = [max] price. This should give you the closest thing to regression. Look at this if you want Multi-class Perceptron

You can also reduce the number of class by grouping house prices. For ex., prices [1000 - 1100] become 1050. This, however, will reduce your model's accuracy.