|
40 | 40 | "cell_type": "markdown",
|
41 | 41 | "metadata": {},
|
42 | 42 | "source": [
|
43 |
| - "#### Import ETL tools (pandas)" |
| 43 | + "#### Import ETL tools (pandas)\n", |
| 44 | + "They can easily be installed following [this guide](https://pandas.pydata.org/pandas-docs/stable/install.html)." |
44 | 45 | ]
|
45 | 46 | },
|
46 | 47 | {
|
|
57 | 58 | "cell_type": "markdown",
|
58 | 59 | "metadata": {},
|
59 | 60 | "source": [
|
60 |
| - "#### Import Machine Learning tools (TensorFlow/sklearn)" |
| 61 | + "#### Import Machine Learning tools (TensorFlow)\n", |
| 62 | + "This must be installed as is explained in the codelab" |
61 | 63 | ]
|
62 | 64 | },
|
63 | 65 | {
|
|
70 | 72 | "from tensorflow.contrib.learn.python.learn import learn_runner\n",
|
71 | 73 | "from tensorflow.contrib.learn.python.learn.datasets import base\n",
|
72 | 74 | "from tensorflow.contrib.learn.python.learn.utils import input_fn_utils\n",
|
73 |
| - "from tensorflow.contrib.learn.python.learn.utils import saved_model_export_utils\n", |
74 |
| - "\n", |
75 |
| - "from sklearn import model_selection # to split the train/test cases" |
| 75 | + "from tensorflow.contrib.learn.python.learn.utils import saved_model_export_utils\n" |
| 76 | + ] |
| 77 | + }, |
| 78 | + { |
| 79 | + "cell_type": "markdown", |
| 80 | + "metadata": {}, |
| 81 | + "source": [ |
| 82 | + "#### Import Sklearn to split the train/test cases\n", |
| 83 | + "To install it, you can follow [this guide](https://www.scipy.org/install.html) (SciPy) and [this other](http://scikit-learn.org/stable/install.html) one (Scikit-Learn). You might have to restart Jupyter after this installation." |
| 84 | + ] |
| 85 | + }, |
| 86 | + { |
| 87 | + "cell_type": "code", |
| 88 | + "execution_count": null, |
| 89 | + "metadata": {}, |
| 90 | + "outputs": [], |
| 91 | + "source": [ |
| 92 | + "from sklearn import model_selection " |
76 | 93 | ]
|
77 | 94 | },
|
78 | 95 | {
|
|
259 | 276 | },
|
260 | 277 | {
|
261 | 278 | "cell_type": "code",
|
262 |
| - "execution_count": 26, |
| 279 | + "execution_count": 31, |
263 | 280 | "metadata": {
|
264 | 281 | "scrolled": true
|
265 | 282 | },
|
|
302 | 319 | },
|
303 | 320 | {
|
304 | 321 | "cell_type": "code",
|
305 |
| - "execution_count": 27, |
| 322 | + "execution_count": 30, |
306 | 323 | "metadata": {},
|
307 | 324 | "outputs": [
|
308 | 325 | {
|
|
507 | 524 | "[5 rows x 32 columns]"
|
508 | 525 | ]
|
509 | 526 | },
|
510 |
| - "execution_count": 27, |
| 527 | + "execution_count": 30, |
511 | 528 | "metadata": {},
|
512 | 529 | "output_type": "execute_result"
|
513 | 530 | }
|
|
870 | 887 | },
|
871 | 888 | {
|
872 | 889 | "cell_type": "code",
|
873 |
| - "execution_count": 40, |
| 890 | + "execution_count": null, |
874 | 891 | "metadata": {},
|
875 |
| - "outputs": [ |
876 |
| - { |
877 |
| - "name": "stdout", |
878 |
| - "output_type": "stream", |
879 |
| - "text": [ |
880 |
| - "accuracy: 0.997436\n", |
881 |
| - "accuracy/baseline_label_mean: 0.758974\n", |
882 |
| - "accuracy/threshold_0.500000_mean: 0.997436\n", |
883 |
| - "auc: 0.999964\n", |
884 |
| - "auc_precision_recall: 0.999989\n", |
885 |
| - "global_step: 200\n", |
886 |
| - "labels/actual_label_mean: 0.758974\n", |
887 |
| - "labels/prediction_mean: 0.757851\n", |
888 |
| - "loss: 0.0123835\n", |
889 |
| - "precision/positive_threshold_0.500000_mean: 0.996633\n", |
890 |
| - "recall/positive_threshold_0.500000_mean: 1.0\n", |
891 |
| - "Model exported to [b'/tmp/tmppck_ehkt/export/Servo/1511867231']\n" |
892 |
| - ] |
893 |
| - }, |
894 |
| - { |
895 |
| - "ename": "SystemExit", |
896 |
| - "evalue": "", |
897 |
| - "output_type": "error", |
898 |
| - "traceback": [ |
899 |
| - "An exception has occurred, use %tb to see the full traceback.\n", |
900 |
| - "\u001b[0;31mSystemExit\u001b[0m\n" |
901 |
| - ] |
902 |
| - }, |
903 |
| - { |
904 |
| - "name": "stderr", |
905 |
| - "output_type": "stream", |
906 |
| - "text": [ |
907 |
| - "/usr/local/lib/python3.5/dist-packages/IPython/core/interactiveshell.py:2918: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.\n", |
908 |
| - " warn(\"To exit: use 'exit', 'quit', or Ctrl-D.\", stacklevel=1)\n" |
909 |
| - ] |
910 |
| - } |
911 |
| - ], |
| 892 | + "outputs": [], |
912 | 893 | "source": [
|
913 | 894 | "def main(_):\n",
|
914 | 895 | " train_and_eval()\n",
|
|
962 | 943 | "language_info": {
|
963 | 944 | "codemirror_mode": {
|
964 | 945 | "name": "ipython",
|
965 |
| - "version": 3 |
| 946 | + "version": 2 |
966 | 947 | },
|
967 | 948 | "file_extension": ".py",
|
968 | 949 | "mimetype": "text/x-python",
|
969 | 950 | "name": "python",
|
970 | 951 | "nbconvert_exporter": "python",
|
971 |
| - "pygments_lexer": "ipython3", |
972 |
| - "version": "3.5.2" |
| 952 | + "pygments_lexer": "ipython2", |
| 953 | + "version": "2.7.12" |
973 | 954 | }
|
974 | 955 | },
|
975 | 956 | "nbformat": 4,
|
|
0 commit comments