.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorial/auto_examples/usecase/usecase_function.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_tutorial_auto_examples_usecase_usecase_function.py: ======================== Use Case Function module ======================== Function plot_subplot .. GENERATED FROM PYTHON SOURCE LINES 10-36 .. code-block:: default import numpy as np import matplotlib.pyplot as plt import matplotlib._color_data as mcd def plot_subplot(X, Y, Y_pred, vue, subplot, title): cn = mcd.CSS4_COLORS classes = np.unique(Y) n_classes = len(np.unique(Y)) axs = plt.subplot(subplot[0],subplot[1],subplot[2]) axs.set_title(title) #plt.scatter(X._extract_view(vue), X._extract_view(vue), s=40, c='gray', # edgecolors=(0, 0, 0)) for index, k in zip(range(n_classes), cn.keys()): Y_class, = np.where(Y==classes[index]) Y_class_pred = np.intersect1d(np.where(Y_pred==classes[index])[0], np.where(Y_pred==Y)[0]) plt.scatter(X._extract_view(vue)[Y_class], X._extract_view(vue)[Y_class], s=40, c=cn[k], edgecolors='blue', linewidths=2, label="class real class: "+str(index)) # plt.scatter(X._extract_view(vue)[Y_class_pred], X._extract_view(vue)[Y_class_pred], s=160, edgecolors='orange', linewidths=2, label="class prediction: "+str(index)) if __name__ == '__main__': pass .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_tutorial_auto_examples_usecase_usecase_function.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: usecase_function.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: usecase_function.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_