Skip to content

Commit

Permalink
Remove unnecessary things
Browse files Browse the repository at this point in the history
  • Loading branch information
Am-Coder committed May 28, 2019
1 parent eb9ffdb commit 9afbfad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 48 deletions.
34 changes: 4 additions & 30 deletions Augmentation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"from scipy import signal\n",
"import matplotlib.pyplot as plt\n",
"import csv"
]
},
Expand All @@ -19,23 +17,16 @@
"metadata": {},
"outputs": [],
"source": [
"source = 'E:/games/IISc-May-2019/HAPT Data Set/SpectroSet/'\n",
"dest = 'E:/games/IISc-May-2019/HAPT Data Set/AugmentedData/'\n",
"source = 'E:/games/IISc-May-2019/HAPT Data Set/SpectroSet/200feature/'\n",
"dest = 'E:/games/IISc-May-2019/HAPT Data Set/AugmentedData/200feature/'\n",
"fs = 50"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n"
]
},
{
"name": "stderr",
"output_type": "stream",
Expand All @@ -48,28 +39,11 @@
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"2\n",
"3\n",
"4\n",
"5\n",
"6\n",
"7\n",
"8\n",
"9\n",
"10\n",
"11\n",
"12\n"
]
}
],
"source": [
"for i in range(1,13):\n",
" print(i)\n",
"# print(i)\n",
" file = source + str(i) + '_SpectroFeatures.csv'\n",
" df = pd.read_csv(file,header=None)\n",
"# print(df.shape)\n",
Expand Down
17 changes: 6 additions & 11 deletions DatasetGenerator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,33 @@
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"from scipy import signal\n",
"import matplotlib.pyplot as plt\n",
"import csv"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"source = 'E:/games/IISc-May-2019/HAPT Data Set/AugmentedData/'\n",
"source = 'E:/games/IISc-May-2019/HAPT Data Set/AugmentedData/200feature/'\n",
"dest = 'E:/games/IISc-May-2019/HAPT Data Set/FeatureSet/'\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"for i in range(1,7):\n",
"for i in range(1,13):\n",
" target = source + str(i) + '_AugSpectroFeatures.csv'\n",
"# df = pd.read()\n",
"\n",
" with open (dest+'1to6_Dataset.csv','a',newline='') as out_file:\n",
" with open (dest+'200feature_Dataset.csv','a',newline='') as out_file:\n",
" writer = csv.writer(out_file)\n",
" reader = csv.reader(open(target, 'r'))\n",
" for row in reader:\n",
Expand Down
16 changes: 9 additions & 7 deletions LabelSpectroGenerator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -15,20 +15,20 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"acc = '_acc'\n",
"gyro = '_gyro'\n",
"source = 'E:/games/IISc-May-2019/HAPT Data Set/MyLab/'\n",
"dest = 'E:/games/IISc-May-2019/HAPT Data Set/SpectroSet/'\n",
"dest = 'E:/games/IISc-May-2019/HAPT Data Set/SpectroSet/200feature/'\n",
"fs = 50"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -66,8 +66,8 @@
" for j in range(resA.shape[0]):\n",
" sA = sorted(resA[j])\n",
" sW = sorted(resW[j])\n",
" featureAcc = sA[0:25] + sA[resA.shape[1]-25:resA.shape[1]]\n",
" featureGyr = sW[0:25] + sW[resA.shape[1]-25:resA.shape[1]]\n",
" featureAcc = sA[0:50] + sA[resA.shape[1]-50:resA.shape[1]] #For 100 features set 50 to 25\n",
" featureGyr = sW[0:50] + sW[resA.shape[1]-50:resA.shape[1]] #For 100 features set 50 to 25\n",
" final = np.concatenate((featureAcc,featureGyr))\n",
"# final.append(i)\n",
"# print(len(final))\n",
Expand All @@ -81,7 +81,9 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"#Creating sklearn transformers"
]
}
],
"metadata": {
Expand Down

0 comments on commit 9afbfad

Please sign in to comment.