.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "glr_examples/view/plot_projection.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_projection.py: ================================================= Plot projection ================================================= creates a scatterplot of all instances to visualize data alongside the geographical information. e .. GENERATED FROM PYTHON SOURCE LINES 9-12 .. code-block:: Python # Author: L.Kouadio # Licence: BSD-3-clause .. GENERATED FROM PYTHON SOURCE LINES 13-17 The plot needs the coordinates informations of the survey area. If there is there is geographical information(latitude/longitude or easting/northing) in the data, plot shows the distribution of the data and can be used to visualize the location of the correct of wrong predicted value in the survey area. .. GENERATED FROM PYTHON SOURCE LINES 17-50 .. code-block:: Python from watex.datasets import fetch_data from watex.view.mlplot import plotProjection # Discard all the non-numeric data # then inut numerical data from watex.utils import to_numeric_dtypes, naive_imputer X, Xt, *_ = fetch_data ('bagoue', split_X_y =True, as_frame =True) X =to_numeric_dtypes(X, pop_cat_features=True ) X= naive_imputer(X) Xt = to_numeric_dtypes(Xt, pop_cat_features=True ) Xt= naive_imputer(Xt) plot_kws = dict (fig_size=(8, 12), lc='k', marker='o', lw =3., font_size=15., xlabel= 'easting (m) ', ylabel='northing (m)' , marker_facecolor ='k', marker_edgecolor='blue', alpha =1., marker_edgewidth=2., show_grid =True, galpha =0.2, glw=.5, rotate_xlabel =90., fs =3., s =None ) plotProjection( X, Xt , columns= ['east', 'north'], trainlabel='train location', testlabel='test location', #test_kws = dict (color = "r", edgecolor="#0A4CEE"), **plot_kws ) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_projection_001.png :alt: plot projection :srcset: /glr_examples/view/images/sphx_glr_plot_projection_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.331 seconds) .. _sphx_glr_download_glr_examples_view_plot_projection.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_projection.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_projection.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_projection.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_