{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"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\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\n\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-04-05T15:57:46.873423Z","iopub.execute_input":"2023-04-05T15:57:46.873834Z","iopub.status.idle":"2023-04-05T15:57:46.911551Z","shell.execute_reply.started":"2023-04-05T15:57:46.873797Z","shell.execute_reply":"2023-04-05T15:57:46.909518Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_accel(example1):\n    plt.figure(figsize=(15,4))\n    plt.xlabel('Time')\n    plt.plot(example1.iloc[:,0],example1.iloc[:,1], color='blue')\n    plt.plot(example1.iloc[:,0],example1.iloc[:,2], color='green')\n    plt.plot(example1.iloc[:,0],example1.iloc[:,3]+5, color='orange')\n    plt.plot(example1.iloc[:,0],example1.iloc[:,4]+10, color='red', lw=2)\n    plt.plot(example1.iloc[:,0],example1.iloc[:,5]+15, color='red', lw=2, linestyle='-.')\n    plt.plot(example1.iloc[:,0],example1.iloc[:,6]+20, color='red', lw=2, linestyle='--')\n    plt.legend(['AccV', 'AccML+5', 'AccAP+8', 'StartHesitation','Turn','Walking'])\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2023-04-05T15:57:51.480529Z","iopub.execute_input":"2023-04-05T15:57:51.482119Z","iopub.status.idle":"2023-04-05T15:57:51.495150Z","shell.execute_reply.started":"2023-04-05T15:57:51.482061Z","shell.execute_reply":"2023-04-05T15:57:51.493671Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"my_sequences = os.listdir('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/train/tdcsfog')","metadata":{"execution":{"iopub.status.busy":"2023-04-05T15:57:57.688983Z","iopub.execute_input":"2023-04-05T15:57:57.689419Z","iopub.status.idle":"2023-04-05T15:57:57.757954Z","shell.execute_reply.started":"2023-04-05T15:57:57.689374Z","shell.execute_reply":"2023-04-05T15:57:57.756222Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"AccV, AccML, and AccAP Acceleration from a lower-back sensor on three axes: V - vertical, ML - mediolateral, AP - anteroposterior. Data is in units of m/s^2 for tdcsfog/ \n\nStartHesitation (S) Turn (T) and Walking (W) are the labels to be predicted","metadata":{}},{"cell_type":"code","source":"#example1 = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/train/tdcsfog/'+my_sequences[15])\n# shows S, T and W\n#example1 = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/train/tdcsfog/'+my_sequences[0])\n# shows T\nexample1 = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/train/tdcsfog/'+my_sequences[112])\n# shows S,T,W\nexample1.describe()","metadata":{"execution":{"iopub.status.busy":"2023-04-05T17:25:31.453331Z","iopub.execute_input":"2023-04-05T17:25:31.453999Z","iopub.status.idle":"2023-04-05T17:25:31.539556Z","shell.execute_reply.started":"2023-04-05T17:25:31.453956Z","shell.execute_reply":"2023-04-05T17:25:31.538117Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_accel(example1)","metadata":{"execution":{"iopub.status.busy":"2023-04-03T16:43:11.776785Z","iopub.execute_input":"2023-04-03T16:43:11.777277Z","iopub.status.idle":"2023-04-03T16:43:13.195918Z","shell.execute_reply.started":"2023-04-03T16:43:11.777233Z","shell.execute_reply":"2023-04-03T16:43:13.194658Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}