diff --git a/ArtificialNeuralNetwork.ipynb b/ArtificialNeuralNetwork.ipynb index 6fa36fd..e7e0d54 100644 --- a/ArtificialNeuralNetwork.ipynb +++ b/ArtificialNeuralNetwork.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -22,28 +22,68 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: tensorflow==1.13.1 in /home/andrew/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (1.13.1)\n", + "Requirement already satisfied: numpy==1.16.2 in /home/andrew/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (1.16.2)\n", + "Requirement already satisfied: pandas==0.24.2 in /home/andrew/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (0.24.2)\n", + "Requirement already satisfied: matplotlib==3.0.3 in /home/andrew/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 4)) (3.0.3)\n", + "Requirement already satisfied: Keras==2.2.4 in /home/andrew/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (2.2.4)\n", + "Requirement already satisfied: sklearn==0.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 6)) (0.0)\n", + "Requirement already satisfied: wheel>=0.26 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (0.32.3)\n", + "Requirement already satisfied: six>=1.10.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (1.12.0)\n", + "Requirement already satisfied: absl-py>=0.1.6 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (0.7.1)\n", + "Requirement already satisfied: tensorboard<1.14.0,>=1.13.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (1.13.1)\n", + "Requirement already satisfied: tensorflow-estimator<1.14.0rc0,>=1.13.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (1.13.0)\n", + "Requirement already satisfied: grpcio>=1.8.6 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (1.19.0)\n", + "Requirement already satisfied: astor>=0.6.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (0.7.1)\n", + "Requirement already satisfied: termcolor>=1.1.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (1.1.0)\n", + "Requirement already satisfied: keras-applications>=1.0.6 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (1.0.7)\n", + "Requirement already satisfied: gast>=0.2.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (0.2.2)\n", + "Requirement already satisfied: protobuf>=3.6.1 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (3.7.1)\n", + "Requirement already satisfied: keras-preprocessing>=1.0.5 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow==1.13.1->-r requirements.txt (line 1)) (1.0.9)\n", + "Requirement already satisfied: python-dateutil>=2.5.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from pandas==0.24.2->-r requirements.txt (line 3)) (2.7.5)\n", + "Requirement already satisfied: pytz>=2011k in /home/andrew/anaconda3/lib/python3.7/site-packages (from pandas==0.24.2->-r requirements.txt (line 3)) (2018.7)\n", + "Requirement already satisfied: cycler>=0.10 in /home/andrew/anaconda3/lib/python3.7/site-packages (from matplotlib==3.0.3->-r requirements.txt (line 4)) (0.10.0)\n", + "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /home/andrew/anaconda3/lib/python3.7/site-packages (from matplotlib==3.0.3->-r requirements.txt (line 4)) (2.3.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /home/andrew/anaconda3/lib/python3.7/site-packages (from matplotlib==3.0.3->-r requirements.txt (line 4)) (1.0.1)\n", + "Requirement already satisfied: h5py in /home/andrew/anaconda3/lib/python3.7/site-packages (from Keras==2.2.4->-r requirements.txt (line 5)) (2.8.0)\n", + "Requirement already satisfied: pyyaml in /home/andrew/anaconda3/lib/python3.7/site-packages (from Keras==2.2.4->-r requirements.txt (line 5)) (3.13)\n", + "Requirement already satisfied: scipy>=0.14 in /home/andrew/anaconda3/lib/python3.7/site-packages (from Keras==2.2.4->-r requirements.txt (line 5)) (1.1.0)\n", + "Requirement already satisfied: scikit-learn in /home/andrew/anaconda3/lib/python3.7/site-packages (from sklearn==0.0->-r requirements.txt (line 6)) (0.20.1)\n", + "Requirement already satisfied: werkzeug>=0.11.15 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorboard<1.14.0,>=1.13.0->tensorflow==1.13.1->-r requirements.txt (line 1)) (0.14.1)\n", + "Requirement already satisfied: markdown>=2.6.8 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorboard<1.14.0,>=1.13.0->tensorflow==1.13.1->-r requirements.txt (line 1)) (3.1)\n", + "Requirement already satisfied: mock>=2.0.0 in /home/andrew/anaconda3/lib/python3.7/site-packages (from tensorflow-estimator<1.14.0rc0,>=1.13.0->tensorflow==1.13.1->-r requirements.txt (line 1)) (2.0.0)\n", + "Requirement already satisfied: setuptools in /home/andrew/anaconda3/lib/python3.7/site-packages (from protobuf>=3.6.1->tensorflow==1.13.1->-r requirements.txt (line 1)) (40.6.3)\n", + "Requirement already satisfied: pbr>=0.11 in /home/andrew/anaconda3/lib/python3.7/site-packages (from mock>=2.0.0->tensorflow-estimator<1.14.0rc0,>=1.13.0->tensorflow==1.13.1->-r requirements.txt (line 1)) (5.1.3)\n" + ] + } + ], "source": [ "!pip install -r requirements.txt" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 256, "metadata": {}, "outputs": [], "source": [ "# Importing the libraries\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", - "import pandas as pd" + "import pandas as pd\n", + "from mlxtend.plotting import plot_confusion_matrix\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 257, "metadata": {}, "outputs": [], "source": [ @@ -55,9 +95,162 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 258, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
CreditScoreGeographyGenderAgeTenureBalanceNumOfProductsHasCrCardIsActiveMemberEstimatedSalaryExited
0619FranceFemale4220.00111101348.881
1608SpainFemale41183807.86101112542.580
2502FranceFemale428159660.80310113931.571
3699FranceFemale3910.0020093826.630
4850SpainFemale432125510.8211179084.100
\n", + "
" + ], + "text/plain": [ + " CreditScore Geography Gender Age Tenure Balance NumOfProducts \\\n", + "0 619 France Female 42 2 0.00 1 \n", + "1 608 Spain Female 41 1 83807.86 1 \n", + "2 502 France Female 42 8 159660.80 3 \n", + "3 699 France Female 39 1 0.00 2 \n", + "4 850 Spain Female 43 2 125510.82 1 \n", + "\n", + " HasCrCard IsActiveMember EstimatedSalary Exited \n", + "0 1 1 101348.88 1 \n", + "1 0 1 112542.58 0 \n", + "2 1 0 113931.57 1 \n", + "3 0 0 93826.63 0 \n", + "4 1 1 79084.10 0 " + ] + }, + "execution_count": 258, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df1 = dataset.iloc[:, 3:14]\n", + "df1.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 259, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/andrew/anaconda3/lib/python3.7/site-packages/sklearn/preprocessing/_encoders.py:368: FutureWarning: The handling of integer data will change in version 0.22. Currently, the categories are determined based on the range [0, max(values)], while in the future they will be determined based on the unique values.\n", + "If you want the future behaviour and silence this warning, you can specify \"categories='auto'\".\n", + "In case you used a LabelEncoder before this OneHotEncoder to convert the categories to integers, then you can now use the OneHotEncoder directly.\n", + " warnings.warn(msg, FutureWarning)\n", + "/home/andrew/anaconda3/lib/python3.7/site-packages/sklearn/preprocessing/_encoders.py:390: DeprecationWarning: The 'categorical_features' keyword is deprecated in version 0.20 and will be removed in 0.22. You can use the ColumnTransformer instead.\n", + " \"use the ColumnTransformer instead.\", DeprecationWarning)\n" + ] + } + ], "source": [ "# Encoding categorical data\n", "from sklearn.preprocessing import LabelEncoder, OneHotEncoder\n", @@ -72,7 +265,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 261, "metadata": {}, "outputs": [], "source": [ @@ -83,7 +276,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 262, "metadata": {}, "outputs": [], "source": [ @@ -96,7 +289,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 263, "metadata": {}, "outputs": [], "source": [ @@ -110,52 +303,341 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 318, "metadata": {}, "outputs": [], "source": [ - "# Initialising the ANN\n", - "classifier = Sequential()\n", + "def plotConfusion(array):\n", + "# Method to plot confusion matrix\n", + " df_cm = pd.DataFrame(\n", + " array\n", + " )\n", + " fig = plt.figure(figsize=(5, 4))\n", + " try:\n", + " heatmap = sn.heatmap(df_cm, annot=True, fmt=\"d\")\n", + " except ValueError:\n", + " raise ValueError(\"Confusion matrix values must be integers.\")\n", + " heatmap.yaxis.set_ticklabels(heatmap.yaxis.get_ticklabels(), rotation=0, ha='right')\n", + " heatmap.xaxis.set_ticklabels(heatmap.xaxis.get_ticklabels(), rotation=45, ha='right')\n", + " plt.ylabel('True label')\n", + " plt.xlabel('Predicted label')\n" + ] + }, + { + "cell_type": "code", + "execution_count": 320, + "metadata": {}, + "outputs": [], + "source": [ + "def learn(layers,epochs=30):\n", + " # layers -> array of dictionaries\n", + " # epochs -> int \n", + " # EX:\n", + " # learn([\n", + " # {'units': 10, 'activation': 'relu'},\n", + " # {'units': 1, 'activation': 'sigmoid'}\n", + " # ], 50)\n", + " \n", + " \n", + " # Initialising the ANN\n", + " classifier = Sequential()\n", "\n", - "# Adding the input layer and the first hidden layer\n", - "classifier.add(Dense(units = 6, kernel_initializer = 'uniform', activation = 'relu', input_dim = 11))\n", + " for layer in layers:\n", + " # Adding the input layer and the first hidden layer\n", + " classifier.add(Dense(units = layer['units'], activation = layer['activation']))\n", "\n", - "# Adding the second hidden layer\n", - "classifier.add(Dense(units = 6, kernel_initializer = 'uniform', activation = 'relu'))\n", + " # Compiling the ANN\n", + " classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])\n", + " \n", + " # Fitting the ANN to the Training set\n", + " classifier.fit(X_train, y_train, batch_size = 10, epochs = epochs)\n", "\n", - "# Adding the output layer\n", - "classifier.add(Dense(units = 1, kernel_initializer = 'uniform', activation = 'sigmoid'))\n", + " # Predicting the Test set results\n", + " y_pred = classifier.predict(X_test)\n", + " y_pred = (y_pred > 0.5)\n", "\n", - "# Compiling the ANN\n", - "classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])" + " # Making the Confusion Matrix\n", + " from sklearn.metrics import confusion_matrix\n", + " cm = confusion_matrix(y_test, y_pred)\n", + " plotConfusion(cm)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 326, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/30\n", + "8000/8000 [==============================] - 4s 537us/step - loss: 0.8432 - acc: 0.5835\n", + "Epoch 2/30\n", + "8000/8000 [==============================] - 2s 220us/step - loss: 0.5007 - acc: 0.7976\n", + "Epoch 3/30\n", + "8000/8000 [==============================] - 2s 212us/step - loss: 0.4582 - acc: 0.8065\n", + "Epoch 4/30\n", + "8000/8000 [==============================] - 2s 210us/step - loss: 0.4489 - acc: 0.8127\n", + "Epoch 5/30\n", + "8000/8000 [==============================] - 2s 219us/step - loss: 0.4442 - acc: 0.8172\n", + "Epoch 6/30\n", + "8000/8000 [==============================] - 2s 217us/step - loss: 0.4273 - acc: 0.8154\n", + "Epoch 7/30\n", + "8000/8000 [==============================] - 2s 210us/step - loss: 0.4181 - acc: 0.8191\n", + "Epoch 8/30\n", + "8000/8000 [==============================] - 2s 216us/step - loss: 0.4180 - acc: 0.8241\n", + "Epoch 9/30\n", + "8000/8000 [==============================] - 2s 211us/step - loss: 0.4146 - acc: 0.8317\n", + "Epoch 10/30\n", + "8000/8000 [==============================] - 2s 214us/step - loss: 0.4202 - acc: 0.8297\n", + "Epoch 11/30\n", + "8000/8000 [==============================] - 2s 217us/step - loss: 0.4070 - acc: 0.8331\n", + "Epoch 12/30\n", + "8000/8000 [==============================] - 2s 213us/step - loss: 0.4066 - acc: 0.8366\n", + "Epoch 13/30\n", + "8000/8000 [==============================] - 2s 217us/step - loss: 0.4211 - acc: 0.8415\n", + "Epoch 14/30\n", + "8000/8000 [==============================] - 2s 219us/step - loss: 0.4375 - acc: 0.8387\n", + "Epoch 15/30\n", + "8000/8000 [==============================] - 2s 213us/step - loss: 0.4185 - acc: 0.8436\n", + "Epoch 16/30\n", + "8000/8000 [==============================] - 2s 242us/step - loss: 0.4182 - acc: 0.8435\n", + "Epoch 17/30\n", + "8000/8000 [==============================] - 2s 239us/step - loss: 0.4108 - acc: 0.8427\n", + "Epoch 18/30\n", + "8000/8000 [==============================] - 2s 222us/step - loss: 0.4019 - acc: 0.8444\n", + "Epoch 19/30\n", + "8000/8000 [==============================] - 2s 219us/step - loss: 0.4065 - acc: 0.8466\n", + "Epoch 20/30\n", + "8000/8000 [==============================] - 2s 221us/step - loss: 0.4028 - acc: 0.8471\n", + "Epoch 21/30\n", + "8000/8000 [==============================] - 2s 216us/step - loss: 0.4065 - acc: 0.8482\n", + "Epoch 22/30\n", + "8000/8000 [==============================] - 2s 222us/step - loss: 0.4162 - acc: 0.8472\n", + "Epoch 23/30\n", + "8000/8000 [==============================] - 2s 225us/step - loss: 0.4084 - acc: 0.8506\n", + "Epoch 24/30\n", + "8000/8000 [==============================] - 2s 221us/step - loss: 0.3963 - acc: 0.8504\n", + "Epoch 25/30\n", + "8000/8000 [==============================] - 2s 230us/step - loss: 0.4130 - acc: 0.8477\n", + "Epoch 26/30\n", + "8000/8000 [==============================] - 2s 247us/step - loss: 0.4010 - acc: 0.8504\n", + "Epoch 27/30\n", + "8000/8000 [==============================] - 2s 228us/step - loss: 0.3955 - acc: 0.8477\n", + "Epoch 28/30\n", + "8000/8000 [==============================] - 2s 233us/step - loss: 0.3928 - acc: 0.8496\n", + "Epoch 29/30\n", + "8000/8000 [==============================] - 2s 240us/step - loss: 0.3997 - acc: 0.8437\n", + "Epoch 30/30\n", + "8000/8000 [==============================] - 2s 280us/step - loss: 0.3960 - acc: 0.8486\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAUIAAAELCAYAAACs+o84AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAA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FlO26e19H+kpZMTYYWT1J7sI2HPJ0X9gesiYgDwPnA+cFBEDCa7aOx3JXUCbgD+C9gD2HYjh78aeCQidgMGA/OAc4GXk97o2ZJGJG0OBQYBe0jaT9IewJikbBSwZx6nc1dE7Jm093dgXM6+vkkbhwG/TM5hHPBOROyZHP9USf3yaMdsHX7WuHJ1ljQ7+fxnYBLZFW9ei4gnkvJhwOeAx5KlETsAfwV2AV6NiPkAyYortRto4wDgJFi7NNU7yWNouUYk27PJ983IJsauwIyIWJm0UZfHOQ2U9BOyw+/NgPtz9k1LHlucL+mV5BxGALvmXD/cImn7pTzaMlvLibByfRARg3ILkmT3fm4R8GBEHL9evXV+10ICfhoRv1qvje8UcKybgCMjYo6kk4HhOfvWfwQqkrbPiojchImkvgW0bSnmoXF1ewLYW9KOkF2VWdJOwItAX0k7JPWO38jvZwKnJ7+tkbQF8B+yvb017ge+lnPtsZekTwGPAkdK6iypK9lheFO6AouTVyB8Zb19x0lql8T8GeAfSdunJ/WRtFOy8rRZs7hHWMUi4t9Jz2qqpI5J8fkR8ZKkWuAPklaSHVp33cAhvg1MlDQOaABOj4i/SnosuT3l3uQ64WeBvyY90vfILkH2jKQ7gTnAEmBWHiH/CHgS+HfyZ25M/wKeIvtqhG8k60DeSPba4TPKNv5v4Mj8/u+YfcyLLphZ6nlobGap50RoZqnnRGhmqedEaGap50RoZqnnRGhmqedEaGap97/cI0PgDfkpjgAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], "source": [ - "# Fitting the ANN to the Training set\n", - "classifier.fit(X_train, y_train, batch_size = 10, epochs = 100)" + "learn([\n", + " {'units': 10, 'activation': 'relu'},\n", + " {'units': 10, 'activation': 'hard_sigmoid'},\n", + " {'units': 1, 'activation': 'relu'}\n", + "])" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 330, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/30\n", + "8000/8000 [==============================] - 5s 580us/step - loss: 0.4465 - acc: 0.7982\n", + "Epoch 2/30\n", + "8000/8000 [==============================] - 2s 256us/step - loss: 0.4205 - acc: 0.8090\n", + "Epoch 3/30\n", + "8000/8000 [==============================] - 3s 328us/step - loss: 0.4073 - acc: 0.8141\n", + "Epoch 4/30\n", + "8000/8000 [==============================] - 2s 252us/step - loss: 0.4001 - acc: 0.8185\n", + "Epoch 5/30\n", + "8000/8000 [==============================] - 2s 242us/step - loss: 0.3956 - acc: 0.8185\n", + "Epoch 6/30\n", + "8000/8000 [==============================] - 2s 247us/step - loss: 0.3950 - acc: 0.8195\n", + "Epoch 7/30\n", + "8000/8000 [==============================] - 2s 240us/step - loss: 0.3910 - acc: 0.8195\n", + "Epoch 8/30\n", + "8000/8000 [==============================] - 2s 239us/step - loss: 0.3915 - acc: 0.8197\n", + "Epoch 9/30\n", + "8000/8000 [==============================] - 2s 247us/step - loss: 0.3909 - acc: 0.8207\n", + "Epoch 10/30\n", + "8000/8000 [==============================] - 2s 245us/step - loss: 0.3884 - acc: 0.8180\n", + "Epoch 11/30\n", + "8000/8000 [==============================] - 2s 253us/step - loss: 0.3872 - acc: 0.8237\n", + "Epoch 12/30\n", + "8000/8000 [==============================] - 2s 270us/step - loss: 0.3860 - acc: 0.8202\n", + "Epoch 13/30\n", + "8000/8000 [==============================] - 2s 312us/step - loss: 0.3848 - acc: 0.8242\n", + "Epoch 14/30\n", + "8000/8000 [==============================] - 3s 313us/step - loss: 0.3837 - acc: 0.8272\n", + "Epoch 15/30\n", + "8000/8000 [==============================] - 2s 281us/step - loss: 0.3830 - acc: 0.8325\n", + "Epoch 16/30\n", + "8000/8000 [==============================] - 2s 270us/step - loss: 0.3834 - acc: 0.8336\n", + "Epoch 17/30\n", + "8000/8000 [==============================] - 2s 266us/step - loss: 0.3733 - acc: 0.8531\n", + "Epoch 18/30\n", + "8000/8000 [==============================] - 2s 259us/step - loss: 0.3760 - acc: 0.8465\n", + "Epoch 19/30\n", + "8000/8000 [==============================] - 2s 284us/step - loss: 0.3768 - acc: 0.8461\n", + "Epoch 20/30\n", + "8000/8000 [==============================] - 2s 290us/step - loss: 0.3771 - acc: 0.8377\n", + "Epoch 21/30\n", + "8000/8000 [==============================] - 2s 276us/step - loss: 0.3731 - acc: 0.8416\n", + "Epoch 22/30\n", + "8000/8000 [==============================] - 2s 261us/step - loss: 0.3738 - acc: 0.8346\n", + "Epoch 23/30\n", + "8000/8000 [==============================] - 2s 258us/step - loss: 0.3721 - acc: 0.8376\n", + "Epoch 24/30\n", + "8000/8000 [==============================] - 2s 253us/step - loss: 0.3720 - acc: 0.8474\n", + "Epoch 25/30\n", + "8000/8000 [==============================] - 2s 275us/step - loss: 0.3744 - acc: 0.8512\n", + "Epoch 26/30\n", + "8000/8000 [==============================] - 2s 265us/step - loss: 0.3713 - acc: 0.8500\n", + "Epoch 27/30\n", + "8000/8000 [==============================] - 2s 269us/step - loss: 0.3749 - acc: 0.8367\n", + "Epoch 28/30\n", + "8000/8000 [==============================] - 2s 287us/step - loss: 0.3695 - acc: 0.8481\n", + "Epoch 29/30\n", + "8000/8000 [==============================] - 2s 256us/step - loss: 0.3709 - acc: 0.8496\n", + "Epoch 30/30\n", + "8000/8000 [==============================] - 2s 258us/step - loss: 0.3726 - acc: 0.8539\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAUIAAAELCAYAAACs+o84AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGwlJREFUeJzt3Xu4VVW9//H3BxRFxSuIgCioqKkpXsvM0mPijQS1SDS1JPGamWVheg5maZa38lr4k5BTaiqRpPZTs56jdkRFBQRDBMQAuUggKqjAXt/zx5rg4rb32nOvtddlfl4+89lzjXkZ38V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p4jvtI+mn5LvfWwCPF2x7IHls8Q1JM5Lv0AfYt+D64VZJ3VOLqMtsNSfC2vVhRPQuLEiS3dLCIuDJiBi41n5rHNdCAn4WEb9Zq45LUpxrBNA/IiZI+gZwRMG2tR+BiqTub0dEYcJEUo8UdVuGuWtc38YCh0naDfKzMkvaHZgC9JC0a7LfwA0c/xRwfnJsW0lbAe+Tb+2t8jhwdsG1x26StgeeBvpLai+pA/lueFM6AHOTVyCcvta2r0pqk8S8C/B6Uvf5yf5I2j2ZedqsWdwirGMR8U7SsrpP0iZJ8ZURMVXSYOBRScvId607rOcU3wGGSRoENADnR8Rzkv6R3J7yl+Q64aeA55IW6QfkpyB7WdIfgAnAAuDFIkL+T+B54J3kZ2FM/wJeIP9qhPOSeSD/H/lrhy8rX/k7QP/i/nXMPuFJF8ws89w1NrPMcyI0s8xzIjSzzHMiNLPMcyI0s8xzIjSzzHMiNLPM+z9hiKGg2WXcngAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "learn([\n", + " {'units': 480, 'activation': 'exponential'},\n", + " {'units': 6, 'activation': 'tanh'},\n", + " {'units': 1, 'activation': 'sigmoid'}\n", + "])" + ] + }, + { + "cell_type": "code", + "execution_count": 328, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/30\n", + "8000/8000 [==============================] - 5s 679us/step - loss: 0.4814 - acc: 0.8114\n", + "Epoch 2/30\n", + "8000/8000 [==============================] - 2s 305us/step - loss: 0.4734 - acc: 0.8076\n", + "Epoch 3/30\n", + "8000/8000 [==============================] - 2s 229us/step - loss: 0.4357 - acc: 0.8281\n", + "Epoch 4/30\n", + "8000/8000 [==============================] - 2s 217us/step - loss: 0.4229 - acc: 0.8381\n", + "Epoch 5/30\n", + "8000/8000 [==============================] - 2s 218us/step - loss: 0.4591 - acc: 0.8194\n", + "Epoch 6/30\n", + "8000/8000 [==============================] - 2s 225us/step - loss: 0.4368 - acc: 0.8407\n", + "Epoch 7/30\n", + "8000/8000 [==============================] - 2s 255us/step - loss: 0.4252 - acc: 0.8452\n", + "Epoch 8/30\n", + "8000/8000 [==============================] - 2s 269us/step - loss: 0.4238 - acc: 0.8342\n", + "Epoch 9/30\n", + "8000/8000 [==============================] - 2s 228us/step - loss: 0.4173 - acc: 0.8475\n", + "Epoch 10/30\n", + "8000/8000 [==============================] - 2s 216us/step - loss: 0.4172 - acc: 0.8437\n", + "Epoch 11/30\n", + "8000/8000 [==============================] - 2s 219us/step - loss: 0.4168 - acc: 0.8475\n", + "Epoch 12/30\n", + "8000/8000 [==============================] - 2s 218us/step - loss: 0.4137 - acc: 0.8474\n", + "Epoch 13/30\n", + "8000/8000 [==============================] - 2s 225us/step - loss: 0.4400 - acc: 0.8245\n", + "Epoch 14/30\n", + "8000/8000 [==============================] - 2s 222us/step - loss: 0.4316 - acc: 0.8417\n", + "Epoch 15/30\n", + "8000/8000 [==============================] - 2s 256us/step - loss: 0.4005 - acc: 0.8519\n", + "Epoch 16/30\n", + "8000/8000 [==============================] - 2s 236us/step - loss: 0.4145 - acc: 0.8376\n", + "Epoch 17/30\n", + "8000/8000 [==============================] - 2s 228us/step - loss: 0.4625 - acc: 0.8112\n", + "Epoch 18/30\n", + "8000/8000 [==============================] - 2s 235us/step - loss: 0.4079 - acc: 0.8412\n", + "Epoch 19/30\n", + "8000/8000 [==============================] - 2s 280us/step - loss: 0.4033 - acc: 0.8452\n", + "Epoch 20/30\n", + "8000/8000 [==============================] - 2s 218us/step - loss: 0.3907 - acc: 0.8499\n", + "Epoch 21/30\n", + "8000/8000 [==============================] - 2s 220us/step - loss: 0.3757 - acc: 0.8526\n", + "Epoch 22/30\n", + "8000/8000 [==============================] - 2s 222us/step - loss: 0.3848 - acc: 0.8489\n", + "Epoch 23/30\n", + "8000/8000 [==============================] - 2s 218us/step - loss: 0.3867 - acc: 0.8519\n", + "Epoch 24/30\n", + "8000/8000 [==============================] - 2s 220us/step - loss: 0.3853 - acc: 0.8516\n", + "Epoch 25/30\n", + "8000/8000 [==============================] - 2s 230us/step - loss: 0.3819 - acc: 0.8532\n", + "Epoch 26/30\n", + "8000/8000 [==============================] - 2s 222us/step - loss: 0.3764 - acc: 0.8521\n", + "Epoch 27/30\n", + "8000/8000 [==============================] - 2s 220us/step - loss: 0.3763 - acc: 0.8566\n", + "Epoch 28/30\n", + "8000/8000 [==============================] - 2s 223us/step - loss: 0.3744 - acc: 0.8514\n", + "Epoch 29/30\n", + "8000/8000 [==============================] - 2s 218us/step - loss: 0.3637 - acc: 0.8567\n", + "Epoch 30/30\n", + "8000/8000 [==============================] - 2s 223us/step - loss: 0.4133 - acc: 0.8585\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAUIAAAELCAYAAACs+o84AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGnlJREFUeJzt3XmUFOW9//H3h0EWDQpuiIgXF1yJCypu0esSFRARid6gMS4hwQWNJr/rFo1Lrho9Jhq3RFG4qHEjKldc4hp/Gr0uuCCCoiDRCAERd0GRmfneP7rABoeZnpru6emuz4tTZ7qfqq7n28yZ73mWqqcUEZiZZVm7cgdgZlZuToRmlnlOhGaWeU6EZpZ5ToRmlnlOhGaWeU6EZpZ5ToRmlnlOhGaWee3LHUC+JQtm+TaXCtV5/T3KHYK1QO3Xc5Tmc835m11l7Y1T1dEa2lQiNLMKU19X7giKwonQzNKL+nJHUBROhGaWXn11JEJPlphZahH1BW9NkTRW0nxJU/PKzpc0R9LkZBuUt+8sSTMlvSnpgLzyAUnZTElnFvI93CI0s/Tqaot5tnHANcDNK5RfERG/yy+QtBUwHNgaWB94TNJmye5rgf2A2cAkSRMj4vXGKnYiNLP0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": "display_data" + } + ], "source": [ - "\n", - "# Part 3 - Making predictions and evaluating the model\n", - "\n", - "# Predicting the Test set results\n", - "y_pred = classifier.predict(X_test)\n", - "y_pred = (y_pred > 0.5)\n", - "\n", - "# Making the Confusion Matrix\n", - "from sklearn.metrics import confusion_matrix\n", - "cm = confusion_matrix(y_test, y_pred)" + "learn([\n", + " {'units': 50, 'activation': 'relu'},\n", + " {'units': 20, 'activation': 'sigmoid'},\n", + " {'units': 1, 'activation': 'relu'}\n", + "])" ] }, { @@ -182,7 +664,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.1" } }, "nbformat": 4,