watex.base.GreedyPerceptron#

class watex.base.GreedyPerceptron(eta=0.01, n_iter=50, random_state=42)[source]#

Perceptron classifier

Inspired from Rosenblatt concept of perceptron rules. Indeed, Rosenblatt published the first concept of perceptron learning rule based on the MCP (McCulloth-Pitts) neuron model. With the perceptron rule, Rosenblatt proposed an algorithm thar would automatically learn the optimal weights coefficients that would them be multiplied by the input features in order to make the decision of whether a neuron fires (transmits a signal) or not. In the context of supervised learning and classification, such algirithm could them be used to predict whether a new data points belongs to one class or the other.

Rosenblatt initial perceptron rule and the perceptron algorithm can be summarized by the following steps:

  • initialize the weights at 0 or small random numbers.

  • For each training examples, \(x^{(i)}\):
    • Compute the output value \(\hat{y}\).

    • update the weighs.

the weights \(w\) vector can be fromally written as:

\[w := w_j + \delta w_j\]
Parameters
  • eta (float,) – Learning rate between (0. and 1.)

  • n_iter (int ,) – number of iteration passes over the training set

  • random_state (int, default is 42) – random number generator seed for random weight initialization.

w_#

Weight after fitting

Type

Array-like,

errors_#

Number of missclassification (updates ) in each epoch

Type

list

References

1

Rosenblatt F, 1957, The perceptron:A perceiving and Recognizing Automaton,Cornell Aeoronautical Laboratory 1957

2

McCulloch W.S and W. Pitts, 1943. A logical calculus of Idea of Immanent in Nervous Activity, Bulleting of Mathematical Biophysics, 5(4): 115-133, 1943.