## 2 Classification Algorithms Theory
### Simple Perceptron  
The perceptron, first introduced by [PERSON] [46], is the fundamental unit of artificial neural networks, just as the neuron is the fundamental unit of our central nervous system. Hence, it conforms the basis of advanced ML methods that are used on several real-life applications on Industry 4.0, such as smart manufacturing [47], condition monitoring [48], material selection [49], building occupancy prediction [50], among others. In the basic applications of Machine Learning, the Simple Perceptron is used as a supervised binary classifier [51], and it has four parts:  
1. Input
2. Weights and bias
3. Net sum
4. Activation function  
In Figure 7, it can be seen that one constant input is related to weight \(w_{0}\). This weight is the bias (\(-\theta\)) of the system and represents the threshold that must be surpassed to fire the activation function. The system shown in Figure 7 can be mathematically represented as follows:  
\[\begin{split} y&=1\text{ if }\sum_{i=0}^{n}w_{i}\times x_{i}\geq 0 \\ &=0\text{ if }\sum_{i=0}^{n}w_{i}\times x_{i}<0\\ &\text{ where }x_{0}=1\text{ and }w_{0}=-\theta\end{split} \tag{5}\]As we can see, the perceptron has two possible outcomes, and the outcome changes from 0 (negative) to 1 (positive) if the weighted sum of the inputs surpasses the threshold \(\theta\). This weighted sum depends directly on the weight vector (\(\mathbf{w}\)) of the system, and the goal of training the perceptron is to find vector \(\mathbf{w}\), which allows us to correctly classify our negative and positive inputs.  
Vector \(\mathbf{w}\) is randomly initialized, and then it is tuned depending on the behavior of the system. We know that if an input \(x_{n}\) has a positive label, the dot product between the weight vector and the input vector (\(\mathbf{x}\)) must be greater or equal than 0, and if the label is negative, the dot product must be lower than 0. Knowing this, there can be two cases of misclassification. These cases are shown below with their corresponding corrective action:  
1. The input label is negative, and the dot product is greater or equal than 0. When this is the case, we must update \(\mathbf{w}\) by subtracting the input vector to the weight vector.
2. The input label is positive, and the dot product is lower than 0. When this happens, we must update \(\mathbf{w}\) by adding the input vector to the weight vector.  
Based on the method's description, we can see that the single perceptron is easy to set up, train, and implement. Furthermore, depending on which is the activation function, we can allow the algorithm to be linked to posterior probabilities, an example of this can be seen while using the sigmoid function. On the other hand, this algorithm is limited to work on linearly separable data, and thus, it can only create hyperplane threshold boundaries. Finally, for ease of understanding, we provide the pseudo-code in Algorithm 3, which summarizes the method originally provided by [PERSON] [46].  
```
Input: Vector \(\mathbf{x}\) Label 0 = Negative (\(N\)) input Label 1 = Positive (\(P\)) input Training: Randomly initialize \(\mathbf{w}\) misclassification!= 0 \(x\in N\) and \(\sum_{i=0}^{n}w_{i}\times x_{i}\geq 0\ \mathbf{w}=\mathbf{w}-\mathbf{x}\)\(x\in P\) and \(\sum_{i=0}^{n}w_{i}\times x_{i}<0\ \mathbf{w}=\mathbf{w}+\mathbf{x}\) Output: Parameters \(\mathbf{w}\)
```  
**Algorithm 3** Simple Perceptron Pseudo-code