Commit 173ae855 authored by Boteju W.J.M.'s avatar Boteju W.J.M.

API

parent bc9e61b5
Pipeline #2033 failed with stages
......@@ -35,11 +35,11 @@ int16_t AccelX, AccelY, AccelZ, Temperature, GyroX, GyroY, GyroZ;
//const char* ssid = "CommercePromote"; // Enter SSID here
//const char* password = "Salsa@4321"; //Enter Password here
//const char* ssid = "SLT_FIBRE@jayamini";
//const char* password = "adsl54321";
const char* ssid = "Dialog 4G";
const char* password = "DEY3FFR37DH";
const char* ssid = "SLT_FIBRE@jayamini";
const char* password = "adsl54321";
//
//const char* ssid = "Dialog 4G";
//const char* password = "DEY3FFR37DH";
//const char* ssid = "Nana";
......
......@@ -33,7 +33,7 @@
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="last_opened_file_path" value="$USER_HOME$/Desktop/Akki/2020-045-IT16175426/2020-045-IT16175426" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
......@@ -142,80 +142,14 @@
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state x="2610" y="268" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1599456440610">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state x="2610" y="268" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1599456440610" />
<state x="549" y="171" key="FileChooserDialogImpl" timestamp="1602930405766">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="549" y="171" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1597313444704" />
<state x="2606" y="216" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1600070372859" />
<state x="549" y="171" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1602930405766" />
<state x="2000" y="0" key="FileDocumentManager.FileCacheConflict" timestamp="1599458251559">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state x="2000" y="0" key="FileDocumentManager.FileCacheConflict/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1599458251559" />
<state width="1877" height="347" key="GridCell.Tab.0.bottom" timestamp="1595420765831">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1493" height="261" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308211085" />
<state width="1877" height="347" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595420765831" />
<state width="1877" height="347" key="GridCell.Tab.0.center" timestamp="1595420765831">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1493" height="261" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308211085" />
<state width="1877" height="347" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595420765831" />
<state width="1877" height="347" key="GridCell.Tab.0.left" timestamp="1595420765821">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1493" height="261" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308211084" />
<state width="1877" height="347" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595420765821" />
<state width="1877" height="347" key="GridCell.Tab.0.right" timestamp="1595420765831">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1493" height="261" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308211085" />
<state width="1877" height="347" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595420765831" />
<state width="1877" height="347" key="GridCell.Tab.1.bottom" timestamp="1595420765831">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1493" height="261" key="GridCell.Tab.1.bottom/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308211085" />
<state width="1877" height="347" key="GridCell.Tab.1.bottom/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595420765831" />
<state width="1877" height="347" key="GridCell.Tab.1.center" timestamp="1595420765831">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1493" height="261" key="GridCell.Tab.1.center/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308211085" />
<state width="1877" height="347" key="GridCell.Tab.1.center/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595420765831" />
<state width="1877" height="347" key="GridCell.Tab.1.left" timestamp="1595420765831">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1493" height="261" key="GridCell.Tab.1.left/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308211085" />
<state width="1877" height="347" key="GridCell.Tab.1.left/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595420765831" />
<state width="1877" height="347" key="GridCell.Tab.1.right" timestamp="1595420765831">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1493" height="261" key="GridCell.Tab.1.right/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308211085" />
<state width="1877" height="347" key="GridCell.Tab.1.right/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595420765831" />
<state x="-162" y="98" key="SettingsEditor" timestamp="1597320661738">
<state x="549" y="171" key="FileChooserDialogImpl" timestamp="1609314118570">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="-162" y="98" key="SettingsEditor/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1597320661738" />
<state x="2383" y="166" key="SettingsEditor/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1597053750811" />
<state x="549" y="171" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1609314118570" />
<state x="545" y="207" width="534" height="416" key="StructurePopup" timestamp="1600834193918">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="2601" y="261" width="540" height="524" key="StructurePopup/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1600149249330" />
<state x="545" y="207" width="534" height="416" key="StructurePopup/0.0.1536.824@0.0.1536.824" timestamp="1600834193918" />
<state x="477" y="241" key="com.intellij.ide.util.TipDialog" timestamp="1595569410321">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="477" y="241" key="com.intellij.ide.util.TipDialog/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595569410321" />
<state x="2516" y="304" key="com.intellij.ide.util.TipDialog/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1595479440640" />
<state x="477" y="241" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1595347996096" />
<state x="330" y="149" key="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory$2" timestamp="1595308182182">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="330" y="149" key="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory$2/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1595308182182" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
......
AccXmin,AccYmin,AccZmin,AccXmax,AccYmax,AccZmax,AccXmean,AccYmean,AccZmean,GyrXmin,GyrYmin,GyrZmin,GyrXmax,GyrYmax,GyrZmax,GyrXmean,GyrYmean,GyrZmean,StartTime,EndTime
1.64,-1.89,-0.26,1.67,-1.88,-0.23,1.659666667,-1.880666667,-0.241,-8.25,0.38,3.19,-7.88,1.09,3.63,-8.092666667,0.810666667,3.404666667,18:44.3,30:24.4
1.65,-1.89,-0.25,1.68,-1.87,-0.23,1.6599999999999997,-1.8800000000000003,-0.24000000000000013,-8.29,0.41,3.18,-7.91,1.34,3.6,-8.119000000000002,0.7969999999999999,3.4080000000000004,2021-01-02 17:30:28.409297,2021-01-02 17:33:02.630227
1.64,-1.89,-0.25,1.68,-1.87,-0.23,1.658,-1.880333333333334,-0.24166666666666678,-8.27,0.23,3.22,-7.88,1.18,3.58,-8.082666666666668,0.8386666666666667,3.403,2021-01-02 17:33:06.606580,2021-01-02 17:34:04.604416
1.65,-1.89,-0.25,1.7,-1.87,-0.23,1.6616666666666664,-1.879333333333334,-0.24333333333333343,-8.28,0.34,3.21,-7.92,1.14,3.74,-8.106333333333334,0.8223333333333334,3.386666666666667,2021-01-02 17:34:08.617894,2021-01-02 17:35:06.604983
1.64,-1.89,-0.25,1.68,-1.87,-0.23,1.6579999999999997,-1.8803333333333339,-0.24100000000000013,-8.25,0.56,3.21,-7.91,1.09,3.66,-8.109333333333334,0.8413333333333333,3.417666666666667,2021-01-02 17:35:10.604318,2021-01-02 17:36:24.605541
1.65,-1.89,-0.25,1.67,-1.87,-0.23,1.659666666666666,-1.8800000000000001,-0.2406666666666668,-8.27,0.59,3.22,-7.9,1.15,3.63,-8.104333333333333,0.8353333333333334,3.401333333333334,2021-01-02 17:36:28.605728,2021-01-02 17:37:26.609971
1.54,-1.91,-0.52,1.69,-1.87,-0.23,1.635333333333333,-1.886666666666666,-0.2993333333333334,-33.83,-43.63,3.28,-7.89,1.26,17.71,-8.956666666666667,-0.6363333333333333,3.8560000000000016,2021-01-02 17:37:30.637289,2021-01-02 17:38:28.616500
1.56,-1.92,-0.5,1.58,-1.9,-0.48,1.5673333333333337,-1.9089999999999985,-0.4880000000000002,-8.31,0.39,3.23,-7.72,1.28,3.66,-8.112666666666668,0.8669999999999998,3.4216666666666673,2021-01-02 17:38:32.623838,2021-01-02 17:39:30.610262
1.56,-1.92,-0.5,1.58,-1.9,-0.47,1.5680000000000003,-1.9096666666666653,-0.48466666666666686,-8.3,0.19,3.21,-7.91,1.24,3.56,-8.072333333333335,0.7366666666666669,3.3873333333333333,2021-01-02 17:39:34.612618,2021-01-02 17:40:32.617227
1.56,-1.92,-0.5,1.58,-1.9,-0.47,1.5703333333333334,-1.907666666666665,-0.4836666666666669,-8.3,0.52,3.16,-7.92,1.25,3.58,-8.062333333333335,0.8593333333333336,3.3843333333333327,2021-01-02 17:40:36.607651,2021-01-02 17:41:34.611744
1.56,-1.91,-0.49,1.67,-1.87,-0.23,1.594666666666666,-1.9009999999999998,-0.4203333333333335,-8.34,0.18,3.25,-7.97,1.33,3.63,-8.100666666666667,0.8196666666666667,3.4566666666666674,2021-01-02 17:41:38.610490,2021-01-02 17:42:36.614949
1.64,-1.89,-0.29,1.68,-1.87,-0.23,1.6589999999999996,-1.8810000000000007,-0.24433333333333343,-8.31,-17.1,3.21,0.33,1.15,7.25,-7.811999999999999,0.2240000000000001,3.549333333333333,2021-01-02 17:42:40.608825,2021-01-02 17:43:38.606381
1.65,-1.89,-0.25,1.68,-1.88,-0.23,1.6583333333333325,-1.8820000000000006,-0.23900000000000016,-8.38,0.69,3.2,-7.93,1.09,3.6,-8.132000000000001,0.8646666666666667,3.393666666666667,2021-01-02 17:43:42.607435,2021-01-02 17:44:40.609139
......@@ -385,3 +385,5 @@ AccXmin,AccYmin,AccZmin,AccXmax,AccYmax,AccZmax,AccXmean,AccYmean,AccZmean,GyrXm
1.64,-1.89,0.01,1.71,-1.86,0.06,1.681666666666667,-1.8770000000000002,0.031000000000000014,-9.71,-2.57,0.92,-5.79,11.65,5.8,-7.994333333333333,0.8513333333333328,3.564666666666667,2020-10-17 14:17:34.901380,2020-10-17 14:18:32.909937
1.64,-1.9,0.01,1.7,-1.81,0.05,1.6833333333333333,-1.8670000000000004,0.027333333333333345,-9.58,-6.12,1.36,4.34,6.28,9.61,-8.092999999999998,0.996,3.480666666666667,2020-10-17 14:18:37.086780,2020-10-17 14:19:34.945598
1.31,-1.82,-0.11,1.66,-1.13,0.12,1.3586666666666667,-1.1996666666666664,-0.06933333333333337,-13.94,-0.95,-17.24,-7.18,3.37,4.68,-8.590666666666666,0.9379999999999998,2.8426666666666667,2020-10-17 14:19:38.962684,2020-10-17 14:20:42.933571
1.32,-2.0,-0.32,1.7,-1.14,0.73,1.620999999999999,-1.8983333333333343,-0.13100000000000003,-39.11,-32.37,-21.18,2.28,57.84,12.86,-9.219666666666665,4.371333333333334,0.24766666666666676,2020-10-17 14:20:46.931101,2021-01-02 17:17:38.290687
1.65,-1.89,-0.26,1.67,-1.87,-0.23,1.658999999999999,-1.8803333333333339,-0.24133333333333343,-8.37,0.59,3.25,-7.97,1.01,3.66,-8.106666666666667,0.8106666666666666,3.3939999999999992,2021-01-02 17:17:42.269273,2021-01-02 17:18:40.267373
......@@ -18,3 +18,18 @@ StartTime,EndTime,Date,Activity
2020-12-22 11:26:22.581231,2020-12-22 11:27:20.584085,2020-12-22 11:27:20.584085,0
2020-12-22 11:27:24.575634,2020-12-22 11:28:22.582638,2020-12-22 11:28:22.582638,0
2020-12-22 11:28:26.577434,2020-12-22 11:29:26.585793,2020-12-22 11:29:26.585793,0
2020-12-22 11:29:30.576503,2020-12-28 16:34:42.668471,2020-12-28 16:34:42.668471,0
2020-12-28 16:34:48.659392,2020-12-28 16:41:25.310848,2020-12-28 16:41:25.310848,1
2020-12-28 16:41:29.314765,2020-12-28 16:49:41.886859,2020-12-28 16:49:41.886859,1
2020-12-28 16:49:45.893722,2020-12-28 16:51:12.186970,2020-12-28 16:51:12.186970,0
2020-12-28 16:51:16.180784,2020-12-28 16:52:14.183024,2020-12-28 16:52:14.183024,0
2020-12-28 16:52:18.184240,2020-12-28 16:54:22.182766,2020-12-28 16:54:22.182766,0
2020-12-28 16:54:26.188809,2020-12-28 16:55:24.182273,2020-12-28 16:55:24.182273,0
2020-12-28 16:55:28.192160,2020-12-28 16:56:26.182000,2020-12-28 16:56:26.182000,0
2020-12-28 16:56:30.192438,2020-12-28 16:57:28.187905,2020-12-28 16:57:28.187905,0
2020-12-28 16:57:32.214890,2020-12-28 16:58:30.181965,2020-12-28 16:58:30.181965,0
2020-12-28 16:58:34.184130,2021-01-02 17:54:31.371831,2021-01-02 17:54:31.371831,1
2021-01-02 17:54:35.364078,2021-01-02 18:01:39.910226,2021-01-02 18:01:39.910226,0
2021-01-02 18:01:43.906355,2021-01-02 18:05:51.207782,2021-01-02 18:05:51.207782,0
2021-01-02 18:05:55.202170,2021-01-02 18:06:53.222102,2021-01-02 18:06:53.222102,2
2021-01-02 18:06:57.223679,2021-01-02 18:08:39.207123,2021-01-02 18:08:39.207123,2
timestamp,accelerometer_X,accelerometer_Y,accelerometer_Z,gyroscope_X,gyroscope_Y,gyroscope_Z
2020-12-22 11:29:30.576503,1.63,-1.90,-0.36,-7.86,1.09,3.37
2020-12-22 11:29:32.582814,1.63,-1.90,-0.35,-7.98,0.94,3.32
2020-12-22 11:29:34.576200,1.62,-1.90,-0.35,-8.08,1.18,3.46
2020-12-22 11:29:36.582383,1.62,-1.90,-0.36,-7.98,0.84,3.17
2020-12-22 11:29:38.584128,1.63,-1.90,-0.35,-7.95,1.15,3.22
2020-12-22 11:29:40.577163,1.63,-1.90,-0.35,-8.05,1.10,3.37
2020-12-22 11:29:42.581749,1.63,-1.90,-0.35,-8.18,1.04,3.27
2020-12-22 11:29:44.593365,1.63,-1.90,-0.35,-8.04,0.95,3.50
2021-01-02 18:08:43.363179,1.66,-1.91,-0.25,-8.05,0.87,3.50
2021-01-02 18:08:45.206113,1.65,-1.92,-0.25,-8.17,0.66,3.45
timestamp,accelerometer_X,accelerometer_Y,accelerometer_Z,gyroscope_X,gyroscope_Y,gyroscope_Z
2020-10-17 14:20:46.931101,1.32,-1.14,-0.08,-8.49,0.69,3.08
2020-10-17 14:27:14.669893,1.32,-2.00,-0.32,-39.11,57.84,-21.18
2020-10-17 14:27:17.740863,1.58,-2.00,-0.02,2.28,43.97,12.86
2020-10-17 14:27:19.426294,1.64,-2.00,0.25,-7.38,2.08,-2.75
2020-10-17 14:27:21.478086,1.55,-2.00,0.73,-5.30,19.21,-18.47
2020-10-17 14:27:26.427878,1.53,-2.00,-0.04,-7.17,1.01,6.34
2020-10-17 14:27:27.429818,1.53,-2.00,-0.21,-16.14,3.82,-2.83
2020-10-17 14:27:29.391623,1.63,-2.00,0.01,-6.98,2.71,-16.69
2020-10-17 14:27:31.410446,1.70,-2.00,-0.09,-15.06,10.08,-7.44
2020-10-17 14:27:35.468687,1.66,-2.00,0.06,-7.86,5.63,-12.52
2020-10-17 14:27:45.086700,1.65,-1.94,0.07,-8.55,1.95,2.93
2020-10-17 14:27:45.413037,1.64,-2.00,0.06,-11.32,-32.37,2.86
2021-01-02 17:44:44.605715,1.65,-1.87,-0.24,-8.02,0.86,3.44
2021-01-02 17:44:46.608596,1.66,-1.88,-0.23,-7.93,1.62,3.27
2021-01-02 17:44:48.640160,1.68,-1.88,-0.24,-8.22,0.71,3.35
......@@ -28,7 +28,7 @@ SECRET_KEY = '^^46u_fc$#)x5ji*s#l3p6igr9*6fwknxevip$ozw8#-m=*#f0'
DEBUG = True
ALLOWED_HOSTS = ['192.168.8.103', 'localhost', '127.0.0.1']
ALLOWED_HOSTS = ['192.168.1.7', 'localhost', '127.0.0.1']
CORS_ORIGIN_ALLOW_ALL = False
......@@ -165,6 +165,13 @@ STATICFILES_DIRS = [
]
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.Argon2PasswordHasher',
]
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
......
......@@ -32,7 +32,7 @@ import numpy as np
from sympy import fft
from datetime import datetime
from rest_framework.authtoken.models import Token
from django_file_md5 import calculate_md5
from django.contrib.auth.hashers import make_password
def index(request):
......@@ -48,8 +48,8 @@ def register(request):
password = form.cleaned_data['password1']
user = authenticate(username=username, password=password)
login(request, user)
return redirect('user_example/index.html')
# return redirect('user_example/index.html')
return JsonResponse({'user': user, 'error': 'No error'}, safe=False, status=status.HTTP_201_CREATED)
else:
form = UserCreationForm()
context = {'form': form}
......@@ -65,11 +65,11 @@ def registerUser(request):
userObject = User.objects.create(
username=payload["username"],
password=payload['password'],
password=make_password(payload['password']),
email=payload["email"]
)
serializer = UserSerializer(userObject)
user = authenticate(username=payload['username'], password=payload['password'])
user = authenticate(username=payload['username'], password=make_password(payload['password']))
login(request, user)
return JsonResponse({'user': 'data', 'error': 'No'}, safe=False, status=status.HTTP_201_CREATED)
except ObjectDoesNotExist as e:
......@@ -677,7 +677,7 @@ def readings(request):
def getReadings():
ReadingsArray = []
responseObtained = requests.get('http://192.168.8.105/getReadings')
responseObtained = requests.get('http://192.168.1.7/getReadings')
# if(responseObtained):
# print("Successfully Obtaining readings from ... http://192.168.1.6/getReadings")
......@@ -1005,7 +1005,7 @@ class Test:
dictionary = []
# load the Gaussian Bayes Model from disk
filename = 'FinalModel.sav'
filename = 'Janadi.sav'
model = joblib.load(filename)
prediction = model.predict(X_test)
activityPrediction = prediction.tolist().pop()
......@@ -1246,7 +1246,7 @@ def getTrainingReadings():
ReadingsArray = []
responseObtained = requests.get('http://192.168.1.9/getReadings')
responseObtained = requests.get('http://192.168.1.7/getReadings')
result = responseObtained.text
Array = result.split(",")
length = len(Array)
......@@ -1258,23 +1258,24 @@ def getTrainingReadings():
finalArray = obtainReadings(ReadingsArray)
print(finalArray)
file = open("TrainingRunReadings.csv")
file = open("TrainingRestReadings.csv")
numline = len(file.readlines())
if numline < 31:
append_list_as_row('TrainingRunReadings.csv', finalArray)
append_list_as_row('TrainingRestReadings.csv', finalArray)
else:
# trying to get the prediction
MainTraining()
with open("TrainingRunReadings.csv", 'r') as f:
with open("TrainingRunReadings.csv", 'w') as f1:
with open("TrainingRestReadings.csv", 'r') as f:
with open("TrainingRestReadings.csv", 'w') as f1:
next(f, None)
for line in f:
f1.close()
append_list_as_row('TrainingRunReadings.csv', ['timestamp', 'accelerometer_X', 'accelerometer_Y',
append_list_as_row('TrainingRestReadings.csv', ['timestamp', 'accelerometer_X', 'accelerometer_Y',
'accelerometer_Z', 'gyroscope_X', 'gyroscope_Y', 'gyroscope_Z'])
return HttpResponse(response)
def trainingReadings(request):
sched = BackgroundScheduler()
# seconds can be replaced with minutes, hours, or days
......@@ -1283,11 +1284,10 @@ def trainingReadings(request):
return JsonResponse({'data': "Training Data obtained"}, safe=False, status=status.HTTP_201_CREATED)
class MainTraining:
def __init__(self):
d = Data('TrainingRunReadings.csv')
d = Data('TrainingRestReadings.csv')
data = d.ReadData()
i, j = 0, 0
length = len(data)
......@@ -1307,7 +1307,7 @@ class MainTraining:
f = FeatureExtraction(gd1)
FeatureVector = f.getSmallTestFeatureSingle(dataset)
d.append_list_as_row('FeatureVectorsRunTrain.csv', FeatureVector)
d.append_list_as_row('FeatureVectorsRest2Train.csv', FeatureVector)
else:
break
i = i + 30
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment