.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_classifier.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. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_classifier.py: ============================ Plotting FSVM Classifier ============================ An example plot of :class:`fsvm.FuzzySVC` .. GENERATED FROM PYTHON SOURCE LINES 10-11 Train our classifier on very simple dataset .. GENERATED FROM PYTHON SOURCE LINES 11-17 .. code-block:: Python from fsvm import FuzzySVC X = [[0, 0], [1, 1]] y = [0, 1] clf = FuzzySVC().fit(X, y) .. GENERATED FROM PYTHON SOURCE LINES 18-19 Create a test dataset .. GENERATED FROM PYTHON SOURCE LINES 19-24 .. code-block:: Python import numpy as np rng = np.random.RandomState(13) X_test = rng.rand(500, 2) .. GENERATED FROM PYTHON SOURCE LINES 25-26 Use scikit-learn to display the decision boundary .. GENERATED FROM PYTHON SOURCE LINES 26-42 .. code-block:: Python from sklearn.inspection import DecisionBoundaryDisplay disp = DecisionBoundaryDisplay.from_estimator(clf, X_test) disp.ax_.scatter( X_test[:, 0], X_test[:, 1], c=clf.predict(X_test), s=20, edgecolors="k", linewidths=0.5, ) disp.ax_.set( xlabel="Feature 1", ylabel="Feature 2", title="FSVM Classifier Decision Boundary", ) .. image-sg:: /auto_examples/images/sphx_glr_plot_classifier_001.png :alt: FSVM Classifier Decision Boundary :srcset: /auto_examples/images/sphx_glr_plot_classifier_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [Text(0.5, 23.52222222222222, 'Feature 1'), Text(30.972222222222214, 0.5, 'Feature 2'), Text(0.5, 1.0, 'FSVM Classifier Decision Boundary')] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.181 seconds) .. _sphx_glr_download_auto_examples_plot_classifier.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_classifier.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_classifier.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_classifier.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_