Unverified Commit 5be37277 authored by Billy Lamberta's avatar Billy Lamberta Committed by GitHub
Browse files

Merge pull request #4997 from MarkDaoust/add-regression-plots

Add plots to regression notebook.
parents 7874c4b0 302725bd
......@@ -5,8 +5,6 @@
"colab": {
"name": "basic-regression.ipynb",
"version": "0.3.2",
"views": {},
"default_view": {},
"provenance": [],
"private_outputs": true,
"collapsed_sections": [
......@@ -34,12 +32,7 @@
"metadata": {
"id": "AwOEIRJC6Une",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -62,12 +55,7 @@
"metadata": {
"id": "KyPEtTqk6VdG",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -144,12 +132,7 @@
"metadata": {
"id": "1rRo8oNqZ-Rj",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -179,12 +162,7 @@
"metadata": {
"id": "p9kxxgzvzlyz",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -216,12 +194,7 @@
"metadata": {
"id": "Ujqcgkipr65P",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -263,12 +236,7 @@
"metadata": {
"id": "8tYsm8Gs03J4",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -291,12 +259,7 @@
"metadata": {
"id": "pYVyGhdyCpIM",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -327,12 +290,7 @@
"metadata": {
"id": "I8NwI2ND2t4Y",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -357,12 +315,7 @@
"metadata": {
"id": "ze5WQP8R1TYg",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -404,12 +357,7 @@
"metadata": {
"id": "c26juK7ZG8j-",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -450,12 +398,7 @@
"metadata": {
"id": "sD7qHCmNIOY0",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -489,12 +432,7 @@
"metadata": {
"id": "B6XriGbVPh2t",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -533,12 +471,7 @@
"metadata": {
"id": "fdMZuhUgzMZ4",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -572,12 +505,7 @@
"metadata": {
"id": "jl_yNr5n1kms",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
......@@ -604,18 +532,35 @@
"metadata": {
"id": "Xe7RXH3N3CWU",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
"colab": {}
},
"cell_type": "code",
"source": [
"test_predictions = model.predict(test_data).flatten()\n",
"\n",
"print(test_predictions)"
"plt.scatter(test_labels, test_predictions)\n",
"plt.xlabel('True Values [1000$]')\n",
"plt.ylabel('Predictions [1000$]')\n",
"plt.axis('equal')\n",
"plt.xlim(plt.xlim())\n",
"plt.ylim(plt.ylim())\n",
"_ = plt.plot([-100, 100],[-100,100])\n"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "f-OHX4DiXd8x",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"error = test_predictions - test_labels\n",
"plt.hist(error, bins = 50)\n",
"plt.xlabel(\"Prediction Error [1000$]\")\n",
"_ = plt.ylabel(\"Count\")"
],
"execution_count": 0,
"outputs": []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment