{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# VIP - Basic example\n\nA Variable Importance in Projection example showing the feature importance for a synthetic regression task.\n\nThe example uses a synthetic dataset with 10 standard normally distributed features.\nThe target values only depend on two features: #0 and #5.\nIf the VIP method is tasked with selecting two features, it identifies the two important features as shown below.\n\n<div class=\"alert alert-info\"><h4>Note</h4><p>See also `sphx_glr_auto_examples_plot_vip_threshold.py`</p></div>\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom auswahl import VIP\n\nnp.random.seed(1337)\nX = np.random.randn(100, 10)\ny = 5 * X[:, 0] - 2 * X[:, 5]\n\nvip = VIP(n_features_to_select=2)\nvip.fit(X, y)\n\ncolors = np.full(X.shape[1], fill_value='C00')\ncolors[vip.get_support()] = 'C01'\n\nplt.bar(x=np.arange(X.shape[1]), height=vip.vips_, color=colors)\n\nplt.xlabel('Feature')\nplt.ylabel('VIP')\n\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.8.13"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}