{
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.5.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0,
  "cells": [
    {
      "metadata": {
        "_cell_guid": "8efc045e-e869-f9d6-c4e0-f658f1709a6c",
        "_active": false,
        "collapsed": false
      },
      "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.",
      "execution_count": 4,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "2a1060a7-74e8-e94c-41f9-361390416a3b",
        "_active": false,
        "collapsed": false
      },
      "source": "from sklearn.linear_model import LogisticRegression\ntrain_df = pd.read_csv('train.csv')\ntrain_m = train_df.as_matrix()",
      "execution_count": 1,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "91555172-5ce3-3f4f-7b6b-430d231422d3",
        "_active": false,
        "collapsed": false
      },
      "source": "import pandas as pd\nfrom sklearn.linear_model import LogisticRegression\ntrain_df = pd.read_csv('train.csv')\ntrain_m = train_df.as_matrix()\nX = train_m[:50,1:]\ny = train_m[:50,0]",
      "execution_count": 2,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "957c53d0-34c5-8abc-a877-b7e925ad7c41",
        "_active": false,
        "collapsed": false
      },
      "source": "import pandas as pd\nfrom sklearn.linear_model import LogisticRegression\ntrain_df = pd.read_csv('train.csv')",
      "execution_count": 3,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "759f6b24-d22d-ea45-1b15-44e37bb7ae65",
        "_active": false,
        "collapsed": false
      },
      "source": "print('Aditya')",
      "execution_count": 5,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "dce43d4a-a3b3-64fd-4d0a-369d404e66d2",
        "_active": false,
        "collapsed": false
      },
      "source": "import os, sys\npath = os.getcwd();\nprint (\"Current working dir : %s\" % path)\n",
      "execution_count": 7,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "11843a25-2118-ec40-066b-0cd33e716613",
        "_active": false,
        "collapsed": false
      },
      "source": "import os, sys\npath = os.getcwd();\nprint (\"Current working dir : %s\" % path)\npath = '../input'\nprint(\"Folder item :\",os.listdir(path))",
      "execution_count": 9,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "0c837c96-9b3a-b386-829d-a8dc0f1fe662",
        "_active": false,
        "collapsed": false
      },
      "source": "import pandas as pd\nfrom sklearn.linear_model import LogisticRegression\ntrain_df = pd.read_csv('../input/train.csv')",
      "execution_count": 10,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "96cf7d92-c5eb-36cd-b6fa-878ec516593b",
        "_active": false,
        "collapsed": false
      },
      "source": "train_m = train_df.as_matrix()\nX = train_m[:50,1:]\ny = train_m[:50,0]\nlogistic = LogisticRegression()\nlogistic.fit(X,y)\nprint ('Predicted class %s, real class %s' % (logistic.predict(X[419,:]),y[419])",
      "execution_count": 11,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "4ecac486-3529-f832-c93b-3ef5e0dc21d4",
        "_active": false,
        "collapsed": false
      },
      "source": "train_m = train_df.as_matrix()\nX = train_m[:50,1:]\ny = train_m[:50,0]\nlogistic = LogisticRegression()\nlogistic.fit(X,y)\nprint ('Predicted class %s, real class %s' % (logistic.predict(X[419,:]),y[419]))",
      "execution_count": 12,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "2be4952e-4133-beaa-f2d4-e2b4a983539c",
        "_active": false,
        "collapsed": false
      },
      "source": "train_m = train_df.as_matrix()\nX = train_m[:500,1:]\ny = train_m[:500,0]\nlogistic = LogisticRegression()\nlogistic.fit(X,y)\n#print ('Predicted class %s, real class %s' % (logistic.predict(X[419,:]),y[419]))",
      "execution_count": 13,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "58684870-84b4-3b74-a482-86d7e021973b",
        "_active": false,
        "collapsed": false
      },
      "source": "train_m = train_df.as_matrix()\nX = train_m[:500,1:]\ny = train_m[:500,0]\nlogistic = LogisticRegression()\nlogistic.fit(X,y)\n#print ('Predicted class %s, real class %s' % (logistic.predict(X[419,:]),y[419]))",
      "execution_count": 14,
      "cell_type": "code",
      "outputs": [],
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "9e5d6720-8fe2-0785-eb57-f19bb0899915",
        "_active": false,
        "collapsed": false
      },
      "source": "train_m = train_df.as_matrix()\nX = train_m[:500,1:]\ny = train_m[:500,0]\nlogistic = LogisticRegression()\nlogistic.fit(X,y)\nprint ('Predicted class %s, real class %s' % (logistic.predict(X[419,:].reshape(1,-1)),y[419]))",
      "execution_count": null,
      "cell_type": "code",
      "outputs": []
    },
    {
      "metadata": {
        "_cell_guid": "3ce0770b-67f3-9bfa-722a-99b259933839",
        "_active": true,
        "collapsed": false
      },
      "source": null,
      "execution_count": null,
      "cell_type": "code",
      "outputs": []
    }
  ]
}