Commit a95142bf authored by Mark Daoust's avatar Mark Daoust
Browse files

Minor + typos

parent 2756d49a
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
"colab": { "colab": {
"name": "basic-regression.ipynb", "name": "basic-regression.ipynb",
"version": "0.3.2", "version": "0.3.2",
"views": {},
"default_view": {},
"provenance": [], "provenance": [],
"private_outputs": true, "private_outputs": true,
"collapsed_sections": [ "collapsed_sections": [
...@@ -34,13 +32,7 @@ ...@@ -34,13 +32,7 @@
"metadata": { "metadata": {
"id": "AwOEIRJC6Une", "id": "AwOEIRJC6Une",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -63,13 +55,7 @@ ...@@ -63,13 +55,7 @@
"metadata": { "metadata": {
"id": "KyPEtTqk6VdG", "id": "KyPEtTqk6VdG",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -141,12 +127,7 @@ ...@@ -141,12 +127,7 @@
"metadata": { "metadata": {
"id": "1rRo8oNqZ-Rj", "id": "1rRo8oNqZ-Rj",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -176,12 +157,7 @@ ...@@ -176,12 +157,7 @@
"metadata": { "metadata": {
"id": "p9kxxgzvzlyz", "id": "p9kxxgzvzlyz",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -213,12 +189,7 @@ ...@@ -213,12 +189,7 @@
"metadata": { "metadata": {
"id": "Ujqcgkipr65P", "id": "Ujqcgkipr65P",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -258,12 +229,7 @@ ...@@ -258,12 +229,7 @@
"metadata": { "metadata": {
"id": "8tYsm8Gs03J4", "id": "8tYsm8Gs03J4",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -286,12 +252,7 @@ ...@@ -286,12 +252,7 @@
"metadata": { "metadata": {
"id": "pYVyGhdyCpIM", "id": "pYVyGhdyCpIM",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -322,12 +283,7 @@ ...@@ -322,12 +283,7 @@
"metadata": { "metadata": {
"id": "I8NwI2ND2t4Y", "id": "I8NwI2ND2t4Y",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -352,12 +308,7 @@ ...@@ -352,12 +308,7 @@
"metadata": { "metadata": {
"id": "ze5WQP8R1TYg", "id": "ze5WQP8R1TYg",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -399,22 +350,17 @@ ...@@ -399,22 +350,17 @@
"metadata": { "metadata": {
"id": "c26juK7ZG8j-", "id": "c26juK7ZG8j-",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"def build_model():\n", "def build_model():\n",
" model = keras.Sequential()\n", " model = keras.Sequential([\n",
" \n", " keras.layers.Dense(64, activation=tf.nn.relu, \n",
" model.add(keras.layers.Dense(64, activation=tf.nn.relu,\n", " input_shape=(train_data.shape[1],)),\n",
" input_shape=(train_data.shape[1],)))\n", " keras.layers.Dense(64, activation=tf.nn.relu),\n",
" model.add(keras.layers.Dense(64, activation=tf.nn.relu))\n", " keras.layers.Dense(1)\n",
" model.add(keras.layers.Dense(1))\n", " ])\n",
"\n", "\n",
" optimizer = tf.train.RMSPropOptimizer(0.001)\n", " optimizer = tf.train.RMSPropOptimizer(0.001)\n",
"\n", "\n",
...@@ -445,12 +391,7 @@ ...@@ -445,12 +391,7 @@
"metadata": { "metadata": {
"id": "sD7qHCmNIOY0", "id": "sD7qHCmNIOY0",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -484,12 +425,7 @@ ...@@ -484,12 +425,7 @@
"metadata": { "metadata": {
"id": "B6XriGbVPh2t", "id": "B6XriGbVPh2t",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -500,8 +436,10 @@ ...@@ -500,8 +436,10 @@
" plt.figure()\n", " plt.figure()\n",
" plt.xlabel('Epoch')\n", " plt.xlabel('Epoch')\n",
" plt.ylabel('Mean Abs Error [1000$]')\n", " plt.ylabel('Mean Abs Error [1000$]')\n",
" plt.plot(history.epoch, np.array(history.history['mean_absolute_error']), label='Train Loss')\n", " plt.plot(history.epoch, np.array(history.history['mean_absolute_error']), \n",
" plt.plot(history.epoch, np.array(history.history['val_mean_absolute_error']), label = 'Val loss')\n", " label='Train Loss')\n",
" plt.plot(history.epoch, np.array(history.history['val_mean_absolute_error']),\n",
" label = 'Val loss')\n",
" plt.legend()\n", " plt.legend()\n",
" plt.ylim([0,5])\n", " plt.ylim([0,5])\n",
"\n", "\n",
...@@ -526,12 +464,7 @@ ...@@ -526,12 +464,7 @@
"metadata": { "metadata": {
"id": "fdMZuhUgzMZ4", "id": "fdMZuhUgzMZ4",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -565,12 +498,7 @@ ...@@ -565,12 +498,7 @@
"metadata": { "metadata": {
"id": "jl_yNr5n1kms", "id": "jl_yNr5n1kms",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -597,12 +525,7 @@ ...@@ -597,12 +525,7 @@
"metadata": { "metadata": {
"id": "Xe7RXH3N3CWU", "id": "Xe7RXH3N3CWU",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -622,7 +545,7 @@ ...@@ -622,7 +545,7 @@
"source": [ "source": [
"## Conclusion\n", "## Conclusion\n",
"\n", "\n",
"This notebook i a few techniques to introduce a regresson problem.\n", "This notebook introduced a few techniques to handle a regresson problem.\n",
"\n", "\n",
"* Mean Squared Error (MSE) is a common loss function used for regression problems (different than classification problems).\n", "* Mean Squared Error (MSE) is a common loss function used for regression problems (different than classification problems).\n",
"* Similarly, evaluation metrics used for regression differ from classification. A common regression metric is Mean Absolute Error (MAE).\n", "* Similarly, evaluation metrics used for regression differ from classification. A common regression metric is Mean Absolute Error (MAE).\n",
......
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