利用matlab/simulink搭建电力系统微网故障检测模型,输出故障数据集,输入到ann模型中用于分类检测。
下载地址:
电力系统微网故障检测数据集、代码及仿真模型
current |
load |
result |
Time_1.0 |
Time_2.0 |
Time_3.0 |
Time_4.0 |
Time_5.0 |
Time_6.0 |
Time_7.0 |
Time_8.0 |
Time_9.0 |
Time_10.0 |
Time_11.0 |
Time_12.0 |
Time_13.0 |
Time_14.0 |
Time_15.0 |
Time_16.0 |
|
0 |
8.858 |
492 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
4.429 |
246 |
1 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
2 |
4.429 |
246 |
1 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
3 |
4.429 |
246 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
4 |
4.429 |
246 |
1 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
5 |
7.382 |
410 |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
6 |
14.76 |
819.9 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
7 |
26.57 |
1476 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
8 |
29.53 |
1640 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
9 |
14.76 |
819.9 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
10 |
8.858 |
492 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
11 |
22.12 |
983.9 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
12 |
25.17 |
656 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
13 |
27.72 |
410 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
14 |
28.71 |
246 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
15 |
26.06 |
328 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
16 |
18.79 |
819.9 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
17 |
7.311 |
1476 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
18 |
33.96 |
1886 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
19 |
32.48 |
1804 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
20 |
32.48 |
1804 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
21 |
33.96 |
1886 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
22 |
26.57 |
1476 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
23 |
5.249 |
1093 |
2 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
24 |
2.625 |
546.7 |
2 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
25 |
2.625 |
546.7 |
2 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
26 |
2.625 |
546.7 |
2 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
27 |
2.625 |
546.7 |
2 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
检测代码实例
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "ANN Model Code.ipynb",
"provenance": [],
"collapsed_sections": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/Harsh24032000/Fault-Detection-in-Power-Microgrid/blob/master/ANN_Model_Code.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "vh_2PFdoc83n",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "3c535a50-5853-468d-b9f9-5a1d148a13ea"
},
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"from keras.models import Sequential\n",
"from keras.layers import Dense\n",
"from keras.layers import Dropout\n",
"from keras.wrappers.scikit_learn import KerasClassifier\n",
"from sklearn.model_selection import cross_val_score\n",
"from sklearn.preprocessing import LabelEncoder\n",
"from sklearn.model_selection import StratifiedKFold\n",
"from sklearn.preprocessing import StandardScaler\n",
"from sklearn.pipeline import Pipeline"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Using TensorFlow backend.\n"
],
"name": "stderr"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "p4mPCB1wwZQC",
"colab_type": "code",
"colab": {}
},
"source": [
"seed=7\n",
"np.random.seed(seed)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "dOR-kUC5dPB7",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 360
},
"outputId": "eb51bf24-927c-49ee-851f-91541dde974c"
},
"source": [
"df=pd.read_excel('Data.xlsx')\n",
"df1=df.values\n",
"df"
],
"execution_count": null,
"outputs": [
{
"output_type": "error",
"ename": "FileNotFoundError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-4-fec2305a1130>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mdf\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_excel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Data.xlsx'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mdf1\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mdf\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/pandas/io/excel/_base.py\u001b[0m in \u001b[0;36mread_excel\u001b[0;34m(io, sheet_name, header, names, index_col, usecols, squeeze, dtype, engine, converters, true_values, false_values, skiprows, nrows, na_values, keep_default_na, verbose, parse_dates, date_parser, thousands, comment, skipfooter, convert_float, mangle_dupe_cols, **kwds)\u001b[0m\n\u001b[1;32m 302\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 303\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mio\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mExcelFile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 304\u001b[0;31m \u001b[0mio\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mExcelFile\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mio\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mengine\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mengine\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 305\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mengine\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mengine\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0mio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mengine\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 306\u001b[0m raise ValueError(\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/pandas/io/excel/_base.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, io, engine)\u001b[0m\n\u001b[1;32m 822\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_io\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstringify_path\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mio\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 823\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 824\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_reader\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_engines\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mengine\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_io\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 825\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 826\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__fspath__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/pandas/io/excel/_xlrd.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, filepath_or_buffer)\u001b[0m\n\u001b[1;32m 19\u001b[0m \u001b[0merr_msg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"Install xlrd >= 1.0.0 for Excel support\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[0mimport_optional_dependency\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"xlrd\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mextra\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0merr_msg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 21\u001b[0;31m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 22\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mproperty\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/pandas/io/excel/_base.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, filepath_or_buffer)\u001b[0m\n\u001b[1;32m 351\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbook\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_workbook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 352\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 353\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbook\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_workbook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 354\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbytes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 355\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbook\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_workbook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mBytesIO\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/pandas/io/excel/_xlrd.py\u001b[0m in \u001b[0;36mload_workbook\u001b[0;34m(self, filepath_or_buffer)\u001b[0m\n\u001b[1;32m 34\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mopen_workbook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile_contents\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 36\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mopen_workbook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 37\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 38\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mproperty\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/xlrd/__init__.py\u001b[0m in \u001b[0;36mopen_workbook\u001b[0;34m(filename, logfile, verbosity, use_mmap, file_contents, encoding_override, formatting_info, on_demand, ragged_rows)\u001b[0m\n\u001b[1;32m 114\u001b[0m \u001b[0mpeek\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfile_contents\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mpeeksz\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 116\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"rb\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 117\u001b[0m \u001b[0mpeek\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpeeksz\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 118\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpeek\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34mb\"PK\\x03\\x04\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# a ZIP file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'Data.xlsx'"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "rOOARm0VdcBp",
"colab_type": "code",
"colab": {}
},
"source": [
"po=pd.DataFrame(columns=['current','load','result','Time'])"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "fbVDvAuRdjpn",
"colab_type": "code",
"colab": {}
},
"source": [
"for i in range(23):\n",
" po=po.append({'current':df.at[i,\"Current 1\"],'load':df.at[i,\"P_L 1\"],'result':1,'Time':df.at[i,\"Time\"]},ignore_index=True)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "oGNxLOtXdlhY",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 470
},
"outputId": "13485257-89c0-4378-e9c9-c63977b1cff6"
},
"source": [
"po"
],
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>0</th>\n",
" <th>1</th>\n",
" <th>2</th>\n",
" <th>3</th>\n",
" <th>4</th>\n",
" <th>5</th>\n",
" <th>6</th>\n",
" <th>7</th>\n",
" <th>8</th>\n",
" <th>9</th>\n",
" <th>10</th>\n",
" <th>11</th>\n",
" <th>12</th>\n",
" <th>13</th>\n",
" <th>14</th>\n",
" <th>15</th>\n",
" <th>16</th>\n",
" <th>17</th>\n",
" <th>18</th>\n",
" <th>19</th>\n",
" <th>20</th>\n",
" <th>21</th>\n",
" <th>22</th>\n",
" <th>23</th>\n",
" <th>24</th>\n",
" <th>25</th>\n",
" <th>26</th>\n",
" <th>27</th>\n",
" <th>28</th>\n",
" <th>29</th>\n",
" <th>30</th>\n",
" <th>31</th>\n",
" <th>32</th>\n",
" <th>33</th>\n",
" <th>34</th>\n",
" <th>35</th>\n",
" <th>36</th>\n",
" <th>37</th>\n",
" <th>38</th>\n",
" <th>39</th>\n",
" <th>...</th>\n",
" <th>3097</th>\n",
" <th>3098</th>\n",
" <th>3099</th>\n",
" <th>3100</th>\n",
" <th>3101</th>\n",
" <th>3102</th>\n",
" <th>3103</th>\n",
" <th>3104</th>\n",
" <th>3105</th>\n",
" <th>3106</th>\n",
" <th>3107</th>\n",
" <th>3108</th>\n",
" <th>3109</th>\n",
" <th>3110</th>\n",
" <th>3111</th>\n",
" <th>3112</th>\n",
" <th>3113</th>\n",
" <th>3114</th>\n",
" <th>3115</th>\n",
" <th>3116</th>\n",
" <th>3117</th>\n",
" <th>3118</th>\n",
" <th>3119</th>\n",
" <th>3120</th>\n",
" <th>3121</th>\n",
" <th>3122</th>\n",
" <th>3123</th>\n",
" <th>3124</th>\n",
" <th>3125</th>\n",
" <th>3126</th>\n",
" <th>3127</th>\n",
" <th>3128</th>\n",
" <th>3129</th>\n",
" <th>3130</th>\n",
" <th>3131</th>\n",
" <th>3132</th>\n",
" <th>3133</th>\n",
" <th>3134</th>\n",
" <th>3135</th>\n",
" <th>label</th>\n",
" </tr>\n",
" <tr>\n",
" <th>image</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>train0.jpg</th>\n",
" <td>165</td>\n",
" <td>166</td>\n",
" <td>174</td>\n",
" <td>174</td>\n",
" <td>175</td>\n",
" <td>193</td>\n",
" <td>196</td>\n",
" <td>194</td>\n",
" <td>200</td>\n",
" <td>193</td>\n",
" <td>197</td>\n",
" <td>194</td>\n",
" <td>190</td>\n",
" <td>198</td>\n",
" <td>194</td>\n",
" <td>200</td>\n",
" <td>190</td>\n",
" <td>201</td>\n",
" <td>197</td>\n",
" <td>201</td>\n",
" <td>208</td>\n",
" <td>209</td>\n",
" <td>201</td>\n",
" <td>203</td>\n",
" <td>203</td>\n",
" <td>199</td>\n",
" <td>192</td>\n",
" <td>193</td>\n",
" <td>182</td>\n",
" <td>192</td>\n",
" <td>180</td>\n",
" <td>181</td>\n",
" <td>173</td>\n",
" <td>160</td>\n",
" <td>182</td>\n",
" <td>186</td>\n",
" <td>188</td>\n",
" <td>189</td>\n",
" <td>192</td>\n",
" <td>184</td>\n",
" <td>...</td>\n",
" <td>203</td>\n",
" <td>194</td>\n",
" <td>197</td>\n",
" <td>192</td>\n",
" <td>184</td>\n",
" <td>201</td>\n",
" <td>200</td>\n",
" <td>192</td>\n",
" <td>188</td>\n",
" <td>191</td>\n",
" <td>196</td>\n",
" <td>201</td>\n",
" <td>192</td>\n",
" <td>186</td>\n",
" <td>194</td>\n",
" <td>185</td>\n",
" <td>149</td>\n",
" <td>181</td>\n",
" <td>181</td>\n",
" <td>160</td>\n",
" <td>161</td>\n",
" <td>151</td>\n",
" <td>166</td>\n",
" <td>166</td>\n",
" <td>144</td>\n",
" <td>162</td>\n",
" <td>145</td>\n",
" <td>145</td>\n",
" <td>140</td>\n",
" <td>103</td>\n",
" <td>100</td>\n",
" <td>97</td>\n",
" <td>95</td>\n",
" <td>114</td>\n",
" <td>119</td>\n",
" <td>69</td>\n",
" <td>79</td>\n",
" <td>90</td>\n",
" <td>78</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train1.jpg</th>\n",
" <td>27</td>\n",
" <td>44</td>\n",
" <td>61</td>\n",
" <td>78</td>\n",
" <td>96</td>\n",
" <td>109</td>\n",
" <td>120</td>\n",
" <td>123</td>\n",
" <td>130</td>\n",
" <td>136</td>\n",
" <td>144</td>\n",
" <td>150</td>\n",
" <td>163</td>\n",
" <td>169</td>\n",
" <td>172</td>\n",
" <td>165</td>\n",
" <td>157</td>\n",
" <td>163</td>\n",
" <td>169</td>\n",
" <td>170</td>\n",
" <td>173</td>\n",
" <td>173</td>\n",
" <td>166</td>\n",
" <td>170</td>\n",
" <td>173</td>\n",
" <td>175</td>\n",
" <td>179</td>\n",
" <td>185</td>\n",
" <td>186</td>\n",
" <td>184</td>\n",
" <td>183</td>\n",
" <td>177</td>\n",
" <td>178</td>\n",
" <td>180</td>\n",
" <td>178</td>\n",
" <td>176</td>\n",
" <td>181</td>\n",
" <td>177</td>\n",
" <td>169</td>\n",
" <td>169</td>\n",
" <td>...</td>\n",
" <td>150</td>\n",
" <td>147</td>\n",
" <td>149</td>\n",
" <td>145</td>\n",
" <td>140</td>\n",
" <td>141</td>\n",
" <td>143</td>\n",
" <td>140</td>\n",
" <td>146</td>\n",
" <td>144</td>\n",
" <td>141</td>\n",
" <td>147</td>\n",
" <td>152</td>\n",
" <td>149</td>\n",
" <td>143</td>\n",
" <td>141</td>\n",
" <td>147</td>\n",
" <td>147</td>\n",
" <td>155</td>\n",
" <td>160</td>\n",
" <td>166</td>\n",
" <td>165</td>\n",
" <td>166</td>\n",
" <td>168</td>\n",
" <td>162</td>\n",
" <td>158</td>\n",
" <td>151</td>\n",
" <td>140</td>\n",
" <td>134</td>\n",
" <td>125</td>\n",
" <td>116</td>\n",
" <td>108</td>\n",
" <td>90</td>\n",
" <td>72</td>\n",
" <td>54</td>\n",
" <td>33</td>\n",
" <td>13</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train2.jpg</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train3.jpg</th>\n",
" <td>197</td>\n",
" <td>210</td>\n",
" <td>204</td>\n",
" <td>199</td>\n",
" <td>206</td>\n",
" <td>210</td>\n",
" <td>208</td>\n",
" <td>207</td>\n",
" <td>207</td>\n",
" <td>205</td>\n",
" <td>203</td>\n",
" <td>204</td>\n",
" <td>198</td>\n",
" <td>189</td>\n",
" <td>176</td>\n",
" <td>175</td>\n",
" <td>175</td>\n",
" <td>172</td>\n",
" <td>162</td>\n",
" <td>157</td>\n",
" <td>134</td>\n",
" <td>134</td>\n",
" <td>135</td>\n",
" <td>136</td>\n",
" <td>138</td>\n",
" <td>149</td>\n",
" <td>145</td>\n",
" <td>140</td>\n",
" <td>141</td>\n",
" <td>146</td>\n",
" <td>158</td>\n",
" <td>159</td>\n",
" <td>170</td>\n",
" <td>171</td>\n",
" <td>170</td>\n",
" <td>162</td>\n",
" <td>174</td>\n",
" <td>164</td>\n",
" <td>152</td>\n",
" <td>161</td>\n",
" <td>...</td>\n",
" <td>165</td>\n",
" <td>166</td>\n",
" <td>153</td>\n",
" <td>146</td>\n",
" <td>161</td>\n",
" <td>168</td>\n",
" <td>174</td>\n",
" <td>176</td>\n",
" <td>179</td>\n",
" <td>178</td>\n",
" <td>174</td>\n",
" <td>173</td>\n",
" <td>174</td>\n",
" <td>175</td>\n",
" <td>164</td>\n",
" <td>160</td>\n",
" <td>157</td>\n",
" <td>162</td>\n",
" <td>176</td>\n",
" <td>181</td>\n",
" <td>184</td>\n",
" <td>197</td>\n",
" <td>193</td>\n",
" <td>193</td>\n",
" <td>197</td>\n",
" <td>192</td>\n",
" <td>197</td>\n",
" <td>203</td>\n",
" <td>200</td>\n",
" <td>201</td>\n",
" <td>198</td>\n",
" <td>201</td>\n",
" <td>203</td>\n",
" <td>198</td>\n",
" <td>211</td>\n",
" <td>199</td>\n",
" <td>196</td>\n",
" <td>196</td>\n",
" <td>197</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train4.jpg</th>\n",
" <td>128</td>\n",
" <td>119</td>\n",
" <td>133</td>\n",
" <td>115</td>\n",
" <td>109</td>\n",
" <td>123</td>\n",
" <td>138</td>\n",
" <td>131</td>\n",
" <td>143</td>\n",
" <td>133</td>\n",
" <td>133</td>\n",
" <td>130</td>\n",
" <td>140</td>\n",
" <td>138</td>\n",
" <td>137</td>\n",
" <td>135</td>\n",
" <td>138</td>\n",
" <td>141</td>\n",
" <td>134</td>\n",
" <td>128</td>\n",
" <td>125</td>\n",
" <td>128</td>\n",
" <td>98</td>\n",
" <td>118</td>\n",
" <td>112</td>\n",
" <td>116</td>\n",
" <td>116</td>\n",
" <td>115</td>\n",
" <td>121</td>\n",
" <td>117</td>\n",
" <td>112</td>\n",
" <td>118</td>\n",
" <td>142</td>\n",
" <td>122</td>\n",
" <td>118</td>\n",
" <td>111</td>\n",
" <td>92</td>\n",
" <td>94</td>\n",
" <td>103</td>\n",
" <td>110</td>\n",
" <td>...</td>\n",
" <td>169</td>\n",
" <td>167</td>\n",
" <td>163</td>\n",
" <td>164</td>\n",
" <td>173</td>\n",
" <td>168</td>\n",
" <td>167</td>\n",
" <td>156</td>\n",
" <td>146</td>\n",
" <td>156</td>\n",
" <td>154</td>\n",
" <td>135</td>\n",
" <td>129</td>\n",
" <td>149</td>\n",
" <td>146</td>\n",
" <td>150</td>\n",
" <td>152</td>\n",
" <td>142</td>\n",
" <td>138</td>\n",
" <td>141</td>\n",
" <td>141</td>\n",
" <td>130</td>\n",
" <td>130</td>\n",
" <td>120</td>\n",
" <td>130</td>\n",
" <td>110</td>\n",
" <td>117</td>\n",
" <td>117</td>\n",
" <td>129</td>\n",
" <td>121</td>\n",
" <td>116</td>\n",
" <td>120</td>\n",
" <td>126</td>\n",
" <td>119</td>\n",
" <td>129</td>\n",
" <td>132</td>\n",
" <td>134</td>\n",
" <td>131</td>\n",
" <td>123</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train7691.jpg</th>\n",
" <td>192</td>\n",
" <td>189</td>\n",
" <td>187</td>\n",
" <td>188</td>\n",
" <td>193</td>\n",
" <td>193</td>\n",
" <td>192</td>\n",
" <td>193</td>\n",
" <td>193</td>\n",
" <td>192</td>\n",
" <td>191</td>\n",
" <td>193</td>\n",
" <td>196</td>\n",
" <td>196</td>\n",
" <td>190</td>\n",
" <td>188</td>\n",
" <td>187</td>\n",
" <td>183</td>\n",
" <td>176</td>\n",
" <td>174</td>\n",
" <td>178</td>\n",
" <td>179</td>\n",
" <td>180</td>\n",
" <td>179</td>\n",
" <td>182</td>\n",
" <td>183</td>\n",
" <td>178</td>\n",
" <td>180</td>\n",
" <td>180</td>\n",
" <td>184</td>\n",
" <td>183</td>\n",
" <td>180</td>\n",
" <td>183</td>\n",
" <td>183</td>\n",
" <td>181</td>\n",
" <td>184</td>\n",
" <td>180</td>\n",
" <td>180</td>\n",
" <td>182</td>\n",
" <td>181</td>\n",
" <td>...</td>\n",
" <td>167</td>\n",
" <td>162</td>\n",
" <td>161</td>\n",
" <td>154</td>\n",
" <td>155</td>\n",
" <td>157</td>\n",
" <td>159</td>\n",
" <td>159</td>\n",
" <td>155</td>\n",
" <td>161</td>\n",
" <td>157</td>\n",
" <td>153</td>\n",
" <td>149</td>\n",
" <td>148</td>\n",
" <td>144</td>\n",
" <td>146</td>\n",
" <td>146</td>\n",
" <td>147</td>\n",
" <td>156</td>\n",
" <td>165</td>\n",
" <td>168</td>\n",
" <td>175</td>\n",
" <td>173</td>\n",
" <td>174</td>\n",
" <td>174</td>\n",
" <td>176</td>\n",
" <td>175</td>\n",
" <td>180</td>\n",
" <td>179</td>\n",
" <td>178</td>\n",
" <td>179</td>\n",
" <td>181</td>\n",
" <td>179</td>\n",
" <td>176</td>\n",
" <td>177</td>\n",
" <td>177</td>\n",
" <td>180</td>\n",
" <td>181</td>\n",
" <td>181</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train7692.jpg</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>4</td>\n",
" <td>7</td>\n",
" <td>10</td>\n",
" <td>13</td>\n",
" <td>15</td>\n",
" <td>16</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>16</td>\n",
" <td>14</td>\n",
" <td>11</td>\n",
" <td>8</td>\n",
" <td>5</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>...</td>\n",
" <td>8</td>\n",
" <td>16</td>\n",
" <td>23</td>\n",
" <td>29</td>\n",
" <td>36</td>\n",
" <td>42</td>\n",
" <td>48</td>\n",
" <td>52</td>\n",
" <td>55</td>\n",
" <td>57</td>\n",
" <td>60</td>\n",
" <td>59</td>\n",
" <td>54</td>\n",
" <td>47</td>\n",
" <td>40</td>\n",
" <td>34</td>\n",
" <td>27</td>\n",
" <td>20</td>\n",
" <td>11</td>\n",
" <td>6</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train7693.jpg</th>\n",
" <td>96</td>\n",
" <td>97</td>\n",
" <td>100</td>\n",
" <td>105</td>\n",
" <td>110</td>\n",
" <td>114</td>\n",
" <td>114</td>\n",
" <td>112</td>\n",
" <td>113</td>\n",
" <td>119</td>\n",
" <td>124</td>\n",
" <td>118</td>\n",
" <td>118</td>\n",
" <td>120</td>\n",
" <td>121</td>\n",
" <td>122</td>\n",
" <td>120</td>\n",
" <td>116</td>\n",
" <td>116</td>\n",
" <td>121</td>\n",
" <td>123</td>\n",
" <td>125</td>\n",
" <td>130</td>\n",
" <td>124</td>\n",
" <td>133</td>\n",
" <td>124</td>\n",
" <td>109</td>\n",
" <td>123</td>\n",
" <td>130</td>\n",
" <td>133</td>\n",
" <td>136</td>\n",
" <td>131</td>\n",
" <td>134</td>\n",
" <td>137</td>\n",
" <td>138</td>\n",
" <td>146</td>\n",
" <td>139</td>\n",
" <td>145</td>\n",
" <td>142</td>\n",
" <td>139</td>\n",
" <td>...</td>\n",
" <td>141</td>\n",
" <td>140</td>\n",
" <td>146</td>\n",
" <td>147</td>\n",
" <td>150</td>\n",
" <td>159</td>\n",
" <td>151</td>\n",
" <td>146</td>\n",
" <td>126</td>\n",
" <td>106</td>\n",
" <td>139</td>\n",
" <td>143</td>\n",
" <td>161</td>\n",
" <td>156</td>\n",
" <td>164</td>\n",
" <td>159</td>\n",
" <td>173</td>\n",
" <td>176</td>\n",
" <td>172</td>\n",
" <td>167</td>\n",
" <td>173</td>\n",
" <td>170</td>\n",
" <td>182</td>\n",
" <td>165</td>\n",
" <td>185</td>\n",
" <td>169</td>\n",
" <td>168</td>\n",
" <td>170</td>\n",
" <td>164</td>\n",
" <td>165</td>\n",
" <td>166</td>\n",
" <td>187</td>\n",
" <td>185</td>\n",
" <td>193</td>\n",
" <td>163</td>\n",
" <td>188</td>\n",
" <td>189</td>\n",
" <td>188</td>\n",
" <td>170</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train7694.jpg</th>\n",
" <td>116</td>\n",
" <td>98</td>\n",
" <td>142</td>\n",
" <td>158</td>\n",
" <td>168</td>\n",
" <td>162</td>\n",
" <td>156</td>\n",
" <td>155</td>\n",
" <td>157</td>\n",
" <td>160</td>\n",
" <td>153</td>\n",
" <td>147</td>\n",
" <td>142</td>\n",
" <td>143</td>\n",
" <td>142</td>\n",
" <td>150</td>\n",
" <td>151</td>\n",
" <td>161</td>\n",
" <td>167</td>\n",
" <td>201</td>\n",
" <td>172</td>\n",
" <td>169</td>\n",
" <td>167</td>\n",
" <td>172</td>\n",
" <td>173</td>\n",
" <td>173</td>\n",
" <td>170</td>\n",
" <td>168</td>\n",
" <td>171</td>\n",
" <td>146</td>\n",
" <td>171</td>\n",
" <td>169</td>\n",
" <td>164</td>\n",
" <td>144</td>\n",
" <td>133</td>\n",
" <td>137</td>\n",
" <td>162</td>\n",
" <td>163</td>\n",
" <td>155</td>\n",
" <td>144</td>\n",
" <td>...</td>\n",
" <td>153</td>\n",
" <td>149</td>\n",
" <td>151</td>\n",
" <td>144</td>\n",
" <td>167</td>\n",
" <td>168</td>\n",
" <td>171</td>\n",
" <td>175</td>\n",
" <td>169</td>\n",
" <td>163</td>\n",
" <td>169</td>\n",
" <td>188</td>\n",
" <td>159</td>\n",
" <td>152</td>\n",
" <td>152</td>\n",
" <td>153</td>\n",
" <td>156</td>\n",
" <td>154</td>\n",
" <td>148</td>\n",
" <td>147</td>\n",
" <td>157</td>\n",
" <td>168</td>\n",
" <td>175</td>\n",
" <td>175</td>\n",
" <td>163</td>\n",
" <td>149</td>\n",
" <td>166</td>\n",
" <td>179</td>\n",
" <td>188</td>\n",
" <td>177</td>\n",
" <td>179</td>\n",
" <td>172</td>\n",
" <td>160</td>\n",
" <td>175</td>\n",
" <td>161</td>\n",
" <td>151</td>\n",
" <td>161</td>\n",
" <td>170</td>\n",
" <td>154</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>train7695.jpg</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>4</td>\n",
" <td>19</td>\n",
" <td>38</td>\n",
" <td>56</td>\n",
" <td>70</td>\n",
" <td>85</td>\n",
" <td>96</td>\n",
" <td>107</td>\n",
" <td>115</td>\n",
" <td>123</td>\n",
" <td>125</td>\n",
" <td>130</td>\n",
" <td>132</td>\n",
" <td>135</td>\n",
" <td>135</td>\n",
" <td>135</td>\n",
" <td>139</td>\n",
" <td>140</td>\n",
" <td>138</td>\n",
" <td>137</td>\n",
" <td>135</td>\n",
" <td>133</td>\n",
" <td>130</td>\n",
" <td>127</td>\n",
" <td>125</td>\n",
" <td>120</td>\n",
" <td>114</td>\n",
" <td>104</td>\n",
" <td>93</td>\n",
" <td>80</td>\n",
" <td>...</td>\n",
" <td>151</td>\n",
" <td>154</td>\n",
" <td>158</td>\n",
" <td>159</td>\n",
" <td>161</td>\n",
" <td>161</td>\n",
" <td>160</td>\n",
" <td>161</td>\n",
" <td>163</td>\n",
" <td>163</td>\n",
" <td>162</td>\n",
" <td>162</td>\n",
" <td>162</td>\n",
" <td>162</td>\n",
" <td>160</td>\n",
" <td>158</td>\n",
" <td>156</td>\n",
" <td>153</td>\n",
" <td>151</td>\n",
" <td>147</td>\n",
" <td>143</td>\n",
" <td>138</td>\n",
" <td>133</td>\n",
" <td>127</td>\n",
" <td>119</td>\n",
" <td>107</td>\n",
" <td>93</td>\n",
" <td>74</td>\n",
" <td>55</td>\n",
" <td>30</td>\n",
" <td>9</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>7696 rows × 3137 columns</p>\n",
"</div>"
],
"text/plain": [
" 0 1 2 3 4 ... 3132 3133 3134 3135 label\n",
"image ... \n",
"train0.jpg 165 166 174 174 175 ... 69 79 90 78 0\n",
"train1.jpg 27 44 61 78 96 ... 33 13 2 1 1\n",
"train2.jpg 0 0 0 0 0 ... 0 0 0 0 1\n",
"train3.jpg 197 210 204 199 206 ... 199 196 196 197 2\n",
"train4.jpg 128 119 133 115 109 ... 132 134 131 123 1\n",
"... ... ... ... ... ... ... ... ... ... ... ...\n",
"train7691.jpg 192 189 187 188 193 ... 177 180 181 181 4\n",
"train7692.jpg 0 0 0 0 0 ... 0 0 0 0 3\n",
"train7693.jpg 96 97 100 105 110 ... 188 189 188 170 4\n",
"train7694.jpg 116 98 142 158 168 ... 151 161 170 154 5\n",
"train7695.jpg 0 0 0 1 2 ... 1 1 0 0 1\n",
"\n",
"[7696 rows x 3137 columns]"
]
},
"metadata": {
"tags": []
},
"execution_count": 6
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "mI2aTsIydoJ7",
"colab_type": "code",
"colab": {}
},
"source": [
"for i in range(23):\n",
" po=po.append({'current':df.at[i,\"Current 2\"],'load':df.at[i,\"P_L 2\"],'result':2,'Time':df.at[i,\"Time\"]},ignore_index=True)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "6UzQk6EOdq3Q",
"colab_type": "code",
"colab": {}
},
"source": [
"for i in range(23):\n",
" po=po.append({'current':df.at[i,\"Current 3\"],'load':df.at[i,\"P_L 3\"],'result':3,'Time':df.at[i,\"Time\"]},ignore_index=True)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "DjyG5rm2dz2m",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "4ba00cec-1721-4da0-e0f4-09f6e2a0878a"
},
"source": [
"for i in range(23):\n",
" po=po.append({'current':df.at[i,\"Current Ideal\"],'load':df.at[i,\"P_L Ideal\"],'result':0,'Time':df.at[i,\"Time\"]},ignore_index=True)"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Found 8490 images belonging to 7 classes.\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "r-5cNtPCd2YG",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 122
},
"outputId": "8ad1e5ba-02c1-4bb2-b69e-93516aaabf3a"
},
"source": [
"po"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.\n",
"Instructions for updating:\n",
"If using Keras pass *_constraint arguments to layers.\n",
"Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.6/mobilenet_1_0_224_tf.h5\n",
"17227776/17225924 [==============================] - 3s 0us/step\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "t00qelT1d6lX",
"colab_type": "code",
"colab": {}
},
"source": [
"po = pd.concat([po,pd.get_dummies(po['Time'], prefix='Time',dummy_na=True)],axis=1).drop(['Time'],axis=1)\n"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "GtP2JRm5eBDI",
"colab_type": "code",
"colab": {}
},
"source": [
"po"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "JU9SttS7eC1y",
"colab_type": "code",
"colab": {}
},
"source": [
"poo=po.values"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "6YoYMY0heEkG",
"colab_type": "code",
"colab": {}
},
"source": [
"yy=poo[:,2]\n",
"po.drop(['result'],axis=\"columns\",inplace=True)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "xQnkBOb_eGou",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 360
},
"outputId": "788eb09f-38c6-4068-e3a0-bcf76239f1ea"
},
"source": [
"XX=poo[:,:]\n"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Epoch 1/30\n",
"119/770 [===>..........................] - ETA: 42:32 - loss: 2.5548 - acc: 0.3437"
],
"name": "stdout"
},
{
"output_type": "error",
"ename": "KeyboardInterrupt",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-15-ae4fde9f8cf5>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mhistory\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit_generator\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrain_batches\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msteps_per_epoch\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtrain_steps\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mclass_weight\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mclass_weight\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m30\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/engine/training.py\u001b[0m in \u001b[0;36mfit_generator\u001b[0;34m(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)\u001b[0m\n\u001b[1;32m 1294\u001b[0m \u001b[0mshuffle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mshuffle\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1295\u001b[0m \u001b[0minitial_epoch\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0minitial_epoch\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1296\u001b[0;31m steps_name='steps_per_epoch')\n\u001b[0m\u001b[1;32m 1297\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1298\u001b[0m def evaluate_generator(self,\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/engine/training_generator.py\u001b[0m in \u001b[0;36mmodel_iteration\u001b[0;34m(model, data, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch, mode, batch_size, steps_name, **kwargs)\u001b[0m\n\u001b[1;32m 219\u001b[0m \u001b[0mstep\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 220\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mstep\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0mtarget_steps\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 221\u001b[0;31m \u001b[0mbatch_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_get_next_batch\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgenerator\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 222\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mbatch_data\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 223\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mis_dataset\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/engine/training_generator.py\u001b[0m in \u001b[0;36m_get_next_batch\u001b[0;34m(generator)\u001b[0m\n\u001b[1;32m 361\u001b[0m \u001b[0;34m\"\"\"Retrieves the next batch of input data.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 362\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 363\u001b[0;31m \u001b[0mgenerator_output\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgenerator\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 364\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mStopIteration\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0merrors\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mOutOfRangeError\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 365\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/utils/data_utils.py\u001b[0m in \u001b[0;36mget\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 781\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 782\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_running\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 783\u001b[0;31m \u001b[0minputs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mqueue\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mblock\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 784\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mqueue\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtask_done\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 785\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0minputs\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/lib/python3.6/multiprocessing/pool.py\u001b[0m in \u001b[0;36mget\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 636\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 637\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 638\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 639\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mready\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 640\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mTimeoutError\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/lib/python3.6/multiprocessing/pool.py\u001b[0m in \u001b[0;36mwait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 633\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 634\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mwait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 635\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_event\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 636\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 637\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/lib/python3.6/threading.py\u001b[0m in \u001b[0;36mwait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 549\u001b[0m \u001b[0msignaled\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_flag\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0msignaled\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 551\u001b[0;31m \u001b[0msignaled\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cond\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 552\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0msignaled\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 553\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/lib/python3.6/threading.py\u001b[0m in \u001b[0;36mwait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 293\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# restore state no matter what (e.g., KeyboardInterrupt)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 294\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtimeout\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 295\u001b[0;31m \u001b[0mwaiter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0macquire\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 296\u001b[0m \u001b[0mgotit\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 297\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "LP99lYcEeIhq",
"colab_type": "code",
"colab": {}
},
"source": [
"def neural_net():\n",
" model = Sequential()\n",
" model.add(Dense(16, input_dim=27, kernel_initializer='normal', activation='relu'))\n",
" model.add(Dropout(0.2))\n",
" model.add(Dense(8, kernel_initializer='normal', activation='relu'))\n",
" model.add(Dense(4, kernel_initializer='normal',activation='softmax'))\n",
" model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])\n",
" return model"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "hZb562n-yJzJ",
"colab_type": "code",
"colab": {}
},
"source": [
"from keras.utils import np_utils"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "aVL4rZZDyeuy",
"colab_type": "code",
"colab": {}
},
"source": [
"encoder = LabelEncoder()\n",
"encoder.fit(yy)\n",
"encoded_Y = encoder.transform(yy)\n",
"dummy_y = np_utils.to_categorical(encoded_Y)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "S9LaHICzygN1",
"colab_type": "code",
"colab": {}
},
"source": [
"dummy_y"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "i0oRbw7uyh8N",
"colab_type": "code",
"colab": {}
},
"source": [
"dummy_XX=XX"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "tLdxBr17ylks",
"colab_type": "code",
"colab": {}
},
"source": [
"scaler=StandardScaler()"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "XLkUP8O-ypti",
"colab_type": "code",
"colab": {}
},
"source": [
"dummy_XX=scaler.fit_transform(dummy_XX)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "EQCCA6QkyrvO",
"colab_type": "code",
"colab": {}
},
"source": [
"dummy_XX"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "w-snfrWbytzP",
"colab_type": "code",
"colab": {}
},
"source": [
"mm=neural_net()\n",
"history=mm.fit(XX,dummy_y,epochs=500)"
],
"execution_count": null,
"outputs": []
}
]
}
版权声明:本文为ncusz原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。