{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Benchmarking - Example\n\nExample demonstrating the feature selection benchmarking facilities.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import numpy as np\n\nfrom auswahl import VIP, MCUVE, CARS\nfrom auswahl.benchmarking import benchmark, ZucknickScore, DengScore, plot_score, plot_score_vs_stability\n\nnp.random.seed(1337)\nX = np.random.randn(100, 100)\ny = 5 * X[:, 0] - 2 * X[:, 5]\n\nvip = VIP()\nmcuve = MCUVE()\ncars = CARS()\n\nresult = benchmark([(X, y, 'data_example', 0.8)],\n                   features=[i for i in range(1, 10)],\n                   methods=[vip, mcuve, cars],\n                   n_runs=10,\n                   random_state=42,\n                   stab_metrics=[DengScore(), ZucknickScore(correlation_threshold=0.8)],\n                   n_jobs=5,\n                   verbose=False)\n\nplot_score(result)\nplot_score_vs_stability(result, stability_metric='deng_score', n_features=5)"
      ]
    }
  ],
  "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
}