.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_transformer.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_transformer.py: ============================= Plotting Template Transformer ============================= An example plot of :class:`skltemplate.template.TemplateTransformer` .. GENERATED FROM PYTHON SOURCE LINES 8-28 .. image-sg:: /auto_examples/images/sphx_glr_plot_transformer_001.png :alt: Plots of original and transformed data :srcset: /auto_examples/images/sphx_glr_plot_transformer_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np from matplotlib import pyplot as plt from skltemplate import TemplateTransformer X = np.arange(50, dtype=np.float64).reshape(-1, 1) X /= 50 estimator = TemplateTransformer() X_transformed = estimator.fit_transform(X) plt.plot(X.flatten(), label="Original Data") plt.plot(X_transformed.flatten(), label="Transformed Data") plt.title("Plots of original and transformed data") plt.legend(loc="best") plt.grid(True) plt.xlabel("Index") plt.ylabel("Value of Data") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.062 seconds) .. _sphx_glr_download_auto_examples_plot_transformer.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_transformer.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_transformer.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_