This repository intends to provide code for a single layer perception (SLP) algorithm in order to solve a binary classification problem. The problem to be solved is an optical recognition of two characters ("O" and "I"). The available data consists of two properties. The first one is the total number of pixels contained in the character and the variance present in x-axis. The perceptron will be tested in both training and validation data.
For activation function, the signum function is chosen because we deal with binary classification. Thus, if y=1 then input belongs to class 1 ("I") otherwise if y=-1 then belongs to class 2 ("O").
Perceptron's prediction
Weights adaptation based on Widrow-Hoff rule