{"cells":[
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": "# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output.\n\n#  Copyright 2015-present The Scikit Flow Authors. All Rights Reserved.\n#\n#  Licensed under the Apache License, Version 2.0 (the \"License\");\n#  you may not use this file except in compliance with the License.\n#  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n#  Unless required by applicable law or agreed to in writing, software\n#  distributed under the License is distributed on an \"AS IS\" BASIS,\n#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#  See the License for the specific language governing permissions and\n#  limitations under the License.\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom sklearn import datasets, metrics, cross_validation\nfrom tensorflow.contrib import learn\n\niris = datasets.load_iris()\nX_train, X_test, y_train, y_test = cross_validation.train_test_split(iris.data, iris.target,\n    test_size=0.2, random_state=42)\n\ndef my_model(X, y):\n    \"\"\"This is DNN with 10, 20, 10 hidden layers, and dropout of 0.1 probability.\"\"\"\n    layers = learn.ops.dnn(X, [10, 20, 10], dropout=0.1)\n    return learn.models.logistic_regression(layers, y)\n\nclassifier = learn.TensorFlowEstimator(model_fn=my_model, n_classes=3,\n    steps=1000)\nclassifier.fit(X_train, y_train)\nscore = metrics.accuracy_score(y_test, classifier.predict(X_test))\nprint('Accuracy: {0:f}'.format(score))"
 }
],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}}, "nbformat": 4, "nbformat_minor": 0}