{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Transformers\n\n\nThis example shows the different transforming algorithms available in\n:mod:`pyts.preprocessing`.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\nfrom pyts.datasets import load_gunpoint\nfrom pyts.preprocessing import PowerTransformer, QuantileTransformer\n\nX, _, _, _ = load_gunpoint(return_X_y=True)\nn_timestamps = X.shape[1]\n\n# Scale the data with different scaling algorithms\nX_power = PowerTransformer().transform(X)\nX_quantile = QuantileTransformer(n_quantiles=n_timestamps).transform(X)\n\n# Show the results for the first time series\nplt.figure(figsize=(8, 6))\nplt.plot(X[0], '--', label='Original')\nplt.plot(X_power[0], '--', label='PowerTransformer')\nplt.plot(X_quantile[0], '--', label='QuantileTransformer')\nplt.legend(loc='best', fontsize=12)\nplt.title('Transforming time series', fontsize=16)\nplt.tight_layout()\nplt.show()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}