{"cells":[{"metadata":{"_cell_guid":"adf2cc68-377f-4fe0-ac1e-198769f10a94","_uuid":"267ad40152033abaec3a30b9bcf431b631665dc3","trusted":true},"cell_type":"code","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\ntrain_df = pd.read_csv('../input/train.csv')\ntest_df = pd.read_csv('../input/test.csv')\n\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"collapsed":true,"trusted":true,"_uuid":"f5a4993feba6a02d86c78a13403f053ed855807a"},"cell_type":"code","source":"#test_df","execution_count":null,"outputs":[]},{"metadata":{"collapsed":true,"trusted":true,"_uuid":"2573de06874a8c587910e2c55e9f85df6ee34deb"},"cell_type":"code","source":"#print(train_df['pixel12'].sum())","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"af9145833ad53af4d984384d5d15cfa17a1da8bf"},"cell_type":"code","source":"X = train_df.drop('label', axis=1)\ny = train_df['label']\nX_train,X_test,y_train,y_test = train_test_split(X,y)\n\nnn = MLPClassifier()\nnn.fit(X_train,y_train)\nres = nn.predict(X_test)\n\nprint(accuracy_score(res,y_test, normalize=False))\n","execution_count":null,"outputs":[]},{"metadata":{"collapsed":true,"trusted":true,"_uuid":"849be21c21fac73ab9693a02638cf04f604e9e7f"},"cell_type":"code","source":"test_result = nn.predict(test_df)\ntest_result = pd.DataFrame(test_result)\nsub = test_result.to_csv('sub.csv', index=False)","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.4","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}