Skip to content

Instantly share code, notes, and snippets.

@mjbommar
Last active August 29, 2015 14:14
Show Gist options
  • Save mjbommar/74fcefdcd0f2b1a5f708 to your computer and use it in GitHub Desktop.
Save mjbommar/74fcefdcd0f2b1a5f708 to your computer and use it in GitHub Desktop.
Test case for Isotonic Regression regression in fit vs. fit_transform
{"nbformat_minor": 0, "cells": [{"execution_count": 1, "cell_type": "code", "source": "# Imports\nimport matplotlib.pyplot as plt\nimport numpy\nimport pandas\nimport scipy\nimport sklearn\nimport sklearn.isotonic\nimport sys", "outputs": [], "metadata": {"collapsed": true, "trusted": true}}, {"source": "## Version strings", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "print(sys.version)\nprint(sklearn.__version__)", "outputs": [{"output_type": "stream", "name": "stdout", "text": "2.7.3 (default, Mar 13 2014, 11:03:55) \n[GCC 4.7.2]\n0.16.dev\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Generate samples with and without ties", "cell_type": "markdown", "metadata": {}}, {"execution_count": 3, "cell_type": "code", "source": "# Sample with x ties\ndata_with_ties = pandas.DataFrame()\ndata_with_ties[\"feature\"] = [0, 0, 1, 2, 3]\ndata_with_ties[\"target\"] = [0.1, 0.05, 0.15, 0.2, 0.35]\n\n# Sample without x ties\ndata_without_ties = pandas.DataFrame()\ndata_without_ties[\"feature\"] = [0, 1, 2, 3, 4]\ndata_without_ties[\"target\"] = [0.1, 0.05, 0.15, 0.2, 0.35]\n", "outputs": [], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Failure test case with ties", "cell_type": "markdown", "metadata": {}}, {"execution_count": 4, "cell_type": "code", "source": "%matplotlib inline\n\n# Fit and then transform the model\nisotonic = sklearn.isotonic.IsotonicRegression()\nisotonic.fit(data_with_ties.loc[:, \"feature\"],\n data_with_ties.loc[:, \"target\"])\nresults_fit = isotonic.transform(data_with_ties.loc[:, \"feature\"])\n\n# fit_transform in one go\nisotonic = sklearn.isotonic.IsotonicRegression()\nresults_fit_transform = isotonic.fit_transform(data_with_ties.loc[:, \"feature\"],\n data_with_ties.loc[:, \"target\"])\n\n# Describe data and output norm\nprint(\"Norm: {0}\".format(numpy.linalg.norm(results_fit - results_fit_transform)))\nprint(\"fit, transform\")\nprint(pandas.DataFrame(results_fit).describe())\nprint(\"fit_transform\")\nprint(pandas.DataFrame(results_fit_transform).describe())\n\n# Plot\nf = plt.figure()\nplt.scatter(data_with_ties.loc[:, \"feature\"],\n data_with_ties.loc[:, \"target\"],\n color=\"red\", alpha=0.25)\nplt.scatter(data_with_ties.loc[:, \"feature\"],\n results_fit,\n color=\"green\", alpha=0.25)\nplt.scatter(data_with_ties.loc[:, \"feature\"],\n results_fit_transform,\n color=\"blue\", alpha=0.25)\n_ = plt.legend((\"Actual\", \"fit, transform\", \"fit_transform\"),\n loc=\"best\")", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Norm: 0.111803398875\nfit, transform\n 0\ncount 5.000000\nmean 0.140000\nstd 0.147479\nmin 0.000000\n25% 0.000000\n50% 0.150000\n75% 0.200000\nmax 0.350000\nfit_transform\n 0\ncount 5.000000\nmean 0.170000\nstd 0.115109\nmin 0.050000\n25% 0.100000\n50% 0.150000\n75% 0.200000\nmax 0.350000\n"}, {"output_type": "display_data", "data": {"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEACAYAAABcXmojAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X10VfWd7/H39+QBCAkPARKeI4qAiF3SUkak1oCDgq3i\naKlgi1VXHadLxlu71hR7qQNO6x2n2s4ty9UH5uIDKlJvK1SLVLyjsSC14AxSqyCgJvIQkPIghEAS\nku/94+xsTkICydlJzoF8XmvtlfPb+/fb53u2+PuevX97n5+5OyIiIgCxVAcgIiLpQ0lBRERCSgoi\nIhJSUhARkZCSgoiIhJQUREQkFDkpmNlUM9tiZlvNbO5p6n3ezGrM7MbWthURkY5hUZ5TMLMYsBW4\nCtgNbABmu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4lJe4VrZyNs36O\n5m7dunleXp7fcsstrZ6f+fe//71nZ2d7dna25+bmhtNqFhcX+7x583zixImek5PjH3zwgT/++ON+\n0UUXeV5enl9wwQX+y1/+MtxPSUmJDx482H/84x97QUGBDxw40B9//PFw+8qVK3306NGel5cX1tu6\ndat3797dY7GY5+Xl+VVXXeXu7m+88YZ//vOf9169evn48eN93bp14X4ax7V9+3Y3M//Zz37mw4cP\n9x49evj999/vH3zwgU+YMMF79erlM2fO9JqamtMey+b6yGT7zpT/wz1jgEoKWrQktTSXFF580X3l\nypOd/tNPuwdTDbu7++bN7r/61cntL73k/vLLJ7fX1sbLzz3n/sor7r/5jfvvfud+4kSTb9es4uJi\nf+yxx9w9+fmZG8+NXL/foqIi37x5s9fW1npNTY2/9NJL/tFHH7m7+x/+8AfPycnxjRs3hu+XmZnp\nCxYs8BMnTvhLL73kOTk5fujQIXd3HzBggL/xxhvu7n7o0KGwXWlpqcdiMa+rq3N39wMHDnjv3r39\nmWee8draWn/22We9d+/efuDAgWbjMjO/4YYbvKKiwt977z3v0qWLT5482UtLS/3w4cM+evRoX7Jk\nyWmPQVsnBf3MhUgnc+wYdDk5GyexGNScnI2TwsL4WMLRo1BVFb+MdN55DdsfOBAfa8jMhPx8qKiI\nL60VdF5t7rbbbmPUqFHEYjEyMzOZNm0a5wUf4oorruDqq69mzZo1Yf3s7Gzuv/9+MjIymDZtGrm5\nubz//vvhtnfffZcjR47Qs2dPLr300iY/w8qVKxkxYgS33HILsViMmTNnMmrUKF588cVm4wKYO3cu\n3bt356KLLmLMmDFMnTqVoqIi8vLymDZtGhs3bmyXY9QcJQWRTqaoKD6IXFsb78gzMqDXydk46d0b\nJk2Kr6+uhnHj4MKTs3ES9GXU1p78W1d3cn06GDJkSIPyqlWrmDBhAn369KF3796sWrWqwbzMffr0\naTCLWuLczL/5zW9YuXIlRUVFTJo0iTfffLPJ92w8LzPE52betevkTZWN4wIoKCgIX3fr1u2UuZo7\nYl7mREoKIp3M2LEwYkR8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j4SEZEUUVIQEZGQkoKIiISUFERE\nJKSkICIiISUFEREJKSmIiEhISUFEREL/H2RXSb4i+mtlAAAAAElFTkSuQmCC\n", "text/plain": "<matplotlib.figure.Figure at 0x46dd9d0>"}, "metadata": {}}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Success case without ties", "cell_type": "markdown", "metadata": {}}, {"execution_count": 5, "cell_type": "code", "source": "%matplotlib inline\n\n# Fit and then transform the model\nisotonic = sklearn.isotonic.IsotonicRegression()\nisotonic.fit(data_without_ties.loc[:, \"feature\"],\n data_without_ties.loc[:, \"target\"])\nresults_fit = isotonic.transform(data_without_ties.loc[:, \"feature\"])\n\n# fit_transform in one go\nisotonic = sklearn.isotonic.IsotonicRegression()\nresults_fit_transform = isotonic.fit_transform(data_without_ties.loc[:, \"feature\"],\n data_without_ties.loc[:, \"target\"])\n\n# Describe data and output norm\nprint(\"Norm: {0}\".format(numpy.linalg.norm(results_fit - results_fit_transform)))\nprint(\"fit, transform\")\nprint(pandas.DataFrame(results_fit).describe())\nprint(\"fit_transform\")\nprint(pandas.DataFrame(results_fit_transform).describe())\n\n# Plot\nf = plt.figure()\nplt.scatter(data_without_ties.loc[:, \"feature\"],\n data_without_ties.loc[:, \"target\"],\n color=\"red\", alpha=0.25)\nplt.scatter(data_without_ties.loc[:, \"feature\"],\n results_fit,\n color=\"green\", alpha=0.25)\nplt.scatter(data_without_ties.loc[:, \"feature\"],\n results_fit_transform,\n color=\"blue\", alpha=0.25)\n_ = plt.legend((\"Actual\", \"fit, transform\", \"fit_transform\"),\n loc=\"best\")", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Norm: 0.0\nfit, transform\n 0\ncount 5.000000\nmean 0.170000\nstd 0.113743\nmin 0.075000\n25% 0.075000\n50% 0.150000\n75% 0.200000\nmax 0.350000\nfit_transform\n 0\ncount 5.000000\nmean 0.170000\nstd 0.113743\nmin 0.075000\n25% 0.075000\n50% 0.150000\n75% 0.200000\nmax 0.350000\n"}, {"output_type": "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Hojz2J5ECg\n/i3NbCgwA/i/qa4lSYwE8vuECPiA0oNeAWBmpwHnAn9NbSVdKzp8sRnYB6xz96Cd6f4a+AkQ1IuM\nDqwxs41mdlNbjeLdJtllzGwNkBe7ikiRd7j7i8erDpFEmVkm8F/AD6Nn8oHh7mFgrJllA6vN7GJ3\nD8QQqZldDnzi7u9Ev48mSCMDTSa5e7mZDSIS9MXR36pbOG4B7+5Tj9d7nSASeUhMTlBmlk4k3J9w\n9+dTXU+yuHuFma0ExhGca2CTgCvNbAbQG8gys6Xufn2K6+oy7l4e/XO/ma0gMiR8TMCfiEM0Qfm0\nbX5IzMx6EHnQK2hX843g/Hsd7VFgm7v/JtWFdDUzG2hm/aI/9wamAu+ktqqu4+7/y90L3P10Iv/f\nrQ1SuJtZn+hvl5hZX+BS4L3W2p4QAW9mV5nZLmAC8AczW5Xqmr4qd28Emh702gosD9KDXma2DHgD\nOMvMPjaz76W6pq4SvaPkWiJ3l2yO3mo3LdV1daFTgVejY/BvAS+4+59SXJMkLg9YH/Pv96K7r26t\noR50EhEJqBPiDF5ERLqeAl5EJKAU8CIiAaWAFxEJKAW8iEhAKeBFRAJKAS8iElAKeBGRgPr/+IsZ\nZ0HVX7kAAAAASUVORK5CYII=\n", "text/plain": "<matplotlib.figure.Figure at 0x478cf10>"}, "metadata": {}}], "metadata": {"collapsed": false, "trusted": true}}], "nbformat": 4, "metadata": {"kernelspec": {"display_name": "Python 2", "name": "python2"}, "language_info": {"mimetype": "text/x-python", "nbconvert_exporter": "python", "version": "2.7.3", "name": "python", "file_extension": ".py", "pygments_lexer": "ipython2", "codemirror_mode": {"version": 2, "name": "ipython"}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment