Once upon a time(1943), a neuroscientist named Warren McCulloch and a logician named Walter Pitts created the first artificial neuron. Known as the McCulloch Pitts neuron, it is capable of doing binary classification on linearly separable data.
In this articles, we will see the various aspects of MP neuron and how it works, along with some codes.
WHAT IS IT USED FOR?
MP Neuron is used only for binary classification, on a linearly separable data.
INPUT DATA
All input data of MP Neuron are Boolean values only. It takes in only one parameters , that is the inputs (this is in contrast to other models which allow weight and bias too).
x1,x2….xn ∈ {0,1}
ACTIVATION FUNCTION
The activation function of a MP Neuron model is f(g(x)).
g(x) is used to compute the aggregate of all the inputs
f(x) is used to take decision based on some threshold b.
OUTPUT DATA
All the output data from a MP Neuron model is Boolean in nature. Hence it can only do binary classification tasks.
CODE
MP Neuron working:
On line number 9, we are aggregating all the inputs and testing it against a given threshold. On line number 13, the predicted row is matched against the ground truth and y== Y_pred is 1 if it is true, so 1 gets added to accurate rows, and y ≠ Y_pred then 0 gets added to accurate rows, and there is no net change.
For the breast cancer dataset, on running MP neuron, the following graph was obtained.
The MP Neuron class code:
Creating and accessing the class:
To get a full view of the code, including binarization, splitting etc. please see
ipshita-ghosh/mp-neuron | Jovian
PROS OF MP Neuron
- Simple
- Easy to implement
CONS OF MP Neuron
- Cannot deal with real data (Boolean inputs only)
- Can perform binary classification only
- Data needs to be linear
- Y intercepts are limited
- Slope is fixed
MP Neuron was a giant step in artificial intelligence, and we have come a long way ahead. Although MP Neuron is not suitable for real life data and tasks, but it is a great starting point to understand how and why different technologies gradually evolved.
Thankyou!