watex.base.AdalineStochasticGradientDescent#
- class watex.base.AdalineStochasticGradientDescent(eta=0.01, n_iter=50, shuffle=True, random_state=42)[source]#
Adaptative Linear Neuron Classifier with batch (stochastic) gradient descent
A stochastic gradient descent is a popular alternative algorithm which is sometimes also called iterative or online gradient descent [1]. It updates the weights based on the sum of accumulated errors over all training examples \(x^{(i)}\):
\[\delta w: \sum{i} (y^{(i)} -\phi( z^{(i)}))x^(i)\]the weights are updated incremetally for each training examples:
\[\eta(y^{(i)} - \phi(z^{(i)})) x^{(i)}\]- Parameters:
eta (float,) – Learning rate between (0. and 1.)
n_iter (int,) – number of iteration passes over the training set
suffle (bool,) – shuffle training data every epoch if True to prevent cycles.
random_state (int, default is 42) – random number generator seed for random weight initialization.
- w_#
Weight after fitting
- Type:
Array-like,
- cost_#
Sum of squares cost function (updates ) in each epoch
- Type:
list
See also
AdelineGradientDescent
References
[1]Windrow and al., 1960. An Adaptative “Adaline” Neuron Using Chemical “Memistors”, Technical reports Number, 1553-2,B Windrow and al., standford Electron labs, Standford, CA,October 1960.