watex.utils.plot_cost_vs_epochs#

watex.utils.plot_cost_vs_epochs(regs, *, fig_size=(10, 4), marker='o', savefig=None, **kws)[source]#

Plot the cost against the number of epochs for the two different learnings rates

Parameters
  • regs (Callable, single or list of regression estimators) – Estimator should be already fitted.

  • fig_size (tuple , default is (10, 4)) – the size of figure

  • kws (dict ,) – Additionnal keywords arguments passes to matplotlib.pyplot.plot()

Returns

ax

Return type

Matplotlib.pyplot axes objects

Examples

>>> from watex.datasets import load_iris
>>> from watex.base import AdalineGradientDescent
>>> from watex.utils.plotutils import plot_cost_vs_epochs
>>> X, y = load_iris (return_X_y= True )
>>> ada1 = AdalineGradientDescent (n_iter= 10 , eta= .01 ).fit(X, y)
>>> ada2 = AdalineGradientDescent (n_iter=10 , eta =.0001 ).fit(X, y)
>>> plot_cost_vs_epochs (regs = [ada1, ada2] )