{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Loading the GunPoint dataset\n\n\nThis example shows how to load and plot the GunPoint dataset.\nThis dataset involves one female actor and one male actor making\na motion with their hand. The two classes are: Gun-Draw and Point:\nFor Gun-Draw the actors have their hands by their sides. They draw\na replicate gun from a hip-mounted holster, point it at a target for\napproximately one second, then return the gun to the holster, and\ntheir hands to their sides. For Point the actors have their gun by\ntheir sides. They point with their index fingers to a target for\napproximately one second, and then return their hands to their sides.\nFor both classes, we tracked the centroid of the actor's right hands\nin both X- and Y-axes, which appear to be highly correlated. The\ndata in the archive is just the X-axis.\nIt is implemented as :func:`pyts.datasets.load_gunpoint`.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\nfrom pyts.datasets import load_gunpoint\n\n\nX_train, X_test, y_train, y_test = load_gunpoint(return_X_y=True)\nn_samples_per_plot = 3\n\nplt.figure(figsize=(12, 8))\n\nfor i, (X, y, set_, class_,) in enumerate(zip(\n    [X_train, X_train, X_test, X_test],\n    [y_train, y_train, y_test, y_test],\n    ['Training', 'Training', 'Test', 'Test'],\n    [1, 2, 1, 2]\n)):\n    plt.subplot(2, 2, i + 1)\n    for i in range(n_samples_per_plot):\n        plt.plot(X[y == class_][i], 'C0')\n    plt.title('{} set - class {}'.format(set_, class_), fontsize=16)\n\nplt.suptitle('GunPoint dataset', fontsize=20)\nplt.tight_layout()\nplt.subplots_adjust(top=0.9, hspace=0.2)\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
}