.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "glr_examples/view/plot_model_scores.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_glr_examples_view_plot_model_scores.py: ================================================= Plot model scores ================================================= visualizes model fined tuned scores from the cross validation .. GENERATED FROM PYTHON SOURCE LINES 8-11 .. code-block:: Python # Author: L.Kouadio # Licence: BSD-3-clause .. GENERATED FROM PYTHON SOURCE LINES 12-15 :func:`~watex.view.plot_model_scores` is able to read multiple classifiers and accepts differents way of estimators arrangements. Here is two examples of estimators arrangement before feeding to the function. .. GENERATED FROM PYTHON SOURCE LINES 17-18 * Append scores to the model .. GENERATED FROM PYTHON SOURCE LINES 18-27 .. code-block:: Python import numpy as np from watex.exlib.sklearn import SVC from watex.view.mlplot import plot_model_scores svc_model = SVC() svc_fake_scores = np.sqrt (np.abs (np.linspace (0, 50, 200 ) + np.random.randn (200 ))) #add gaussian noises # normalize the scores svc_fake_scores = (svc_fake_scores - svc_fake_scores.min())/ (svc_fake_scores.max() - svc_fake_scores.min()) plot_model_scores([(svc_model, svc_fake_scores )], ** dict (xlabel ='samples', ylabel ='scores', font_size =7., lw=2. )) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_model_scores_001.png :alt: plot model scores :srcset: /glr_examples/view/images/sphx_glr_plot_model_scores_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 28-29 * Use scores separately and customize plot by passing baseplot keyword properties .. GENERATED FROM PYTHON SOURCE LINES 29-49 .. code-block:: Python base_plot_params ={ 'lw' :3., 'ls': '-.', 'lc':'m', 'ms':7., 'fig_size':(9, 6), 'font_size':15., 'xlabel': 'samples', 'ylabel':'scores' , 'marker':'o', 'alpha' :1., 'yp_markeredgewidth':2., 'show_grid' :True, 'galpha' :0.2, 'glw':.5, 'rotate_xlabel' :90., 'fs' :3., 's' :20 , 'sns_style': 'ticks', } plot_model_scores([svc_model], scores =[svc_fake_scores] , **base_plot_params ) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_model_scores_002.png :alt: plot model scores :srcset: /glr_examples/view/images/sphx_glr_plot_model_scores_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.317 seconds) .. _sphx_glr_download_glr_examples_view_plot_model_scores.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/watex/watex/0.3.X?urlpath=lab/tree/notebooks/glr_examples/view/plot_model_scores.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_model_scores.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_model_scores.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_