{"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":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-03-23T03:46:24.045488Z","iopub.execute_input":"2023-03-23T03:46:24.046159Z","iopub.status.idle":"2023-03-23T03:46:24.068187Z","shell.execute_reply.started":"2023-03-23T03:46:24.046121Z","shell.execute_reply":"2023-03-23T03:46:24.067143Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Defog Pre-Processing","metadata":{}},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"defog_metadata = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/defog_metadata.csv')\ndefog_metadata.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.069800Z","iopub.execute_input":"2023-03-23T03:46:24.070064Z","iopub.status.idle":"2023-03-23T03:46:24.083629Z","shell.execute_reply.started":"2023-03-23T03:46:24.070037Z","shell.execute_reply":"2023-03-23T03:46:24.082894Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"defog_metadata['Subject'].isna().sum()\ndefog_metadata['Subject'].duplicated()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.084596Z","iopub.execute_input":"2023-03-23T03:46:24.085462Z","iopub.status.idle":"2023-03-23T03:46:24.098631Z","shell.execute_reply.started":"2023-03-23T03:46:24.085433Z","shell.execute_reply":"2023-03-23T03:46:24.097401Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"defog_metadata.count()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.100969Z","iopub.execute_input":"2023-03-23T03:46:24.101966Z","iopub.status.idle":"2023-03-23T03:46:24.110943Z","shell.execute_reply.started":"2023-03-23T03:46:24.101915Z","shell.execute_reply":"2023-03-23T03:46:24.109707Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Events Pre-processing\n","metadata":{}},{"cell_type":"code","source":"event = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/events.csv')\nevent.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.112339Z","iopub.execute_input":"2023-03-23T03:46:24.112902Z","iopub.status.idle":"2023-03-23T03:46:24.128824Z","shell.execute_reply.started":"2023-03-23T03:46:24.112863Z","shell.execute_reply":"2023-03-23T03:46:24.127874Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"event['Completion'].mean()\nevent['Init'].mean()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.130510Z","iopub.execute_input":"2023-03-23T03:46:24.130959Z","iopub.status.idle":"2023-03-23T03:46:24.139289Z","shell.execute_reply.started":"2023-03-23T03:46:24.130920Z","shell.execute_reply":"2023-03-23T03:46:24.138293Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"event.isna().sum().sum()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.140207Z","iopub.execute_input":"2023-03-23T03:46:24.140651Z","iopub.status.idle":"2023-03-23T03:46:24.150983Z","shell.execute_reply.started":"2023-03-23T03:46:24.140624Z","shell.execute_reply":"2023-03-23T03:46:24.150045Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\n\n# An \"interface\" to matplotlib.axes.Axes.hist() method\nn, bins, patches = plt.hist(x=event['Type'].astype(str), bins='auto', color='#0504aa',)\nplt.xlabel('Type')\nplt.ylabel('Frequency')\nplt.title('Type of Events Frequency')\nmaxfreq = n.max()\n","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.152500Z","iopub.execute_input":"2023-03-23T03:46:24.153845Z","iopub.status.idle":"2023-03-23T03:46:24.303357Z","shell.execute_reply.started":"2023-03-23T03:46:24.153784Z","shell.execute_reply":"2023-03-23T03:46:24.302516Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Tasks Pre-Processing","metadata":{}},{"cell_type":"code","source":"tasks = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/tasks.csv')\ntasks.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.305517Z","iopub.execute_input":"2023-03-23T03:46:24.306414Z","iopub.status.idle":"2023-03-23T03:46:24.322193Z","shell.execute_reply.started":"2023-03-23T03:46:24.306380Z","shell.execute_reply":"2023-03-23T03:46:24.321303Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"subjects = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/subjects.csv')\nsubjects.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.324549Z","iopub.execute_input":"2023-03-23T03:46:24.325112Z","iopub.status.idle":"2023-03-23T03:46:24.342325Z","shell.execute_reply.started":"2023-03-23T03:46:24.325083Z","shell.execute_reply":"2023-03-23T03:46:24.341314Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Showing just one user","metadata":{}},{"cell_type":"code","source":"userId = \"02ea782681\"\ntrain_defog = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/train/defog/'+userId+'.csv')\ntrain_defog.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.343458Z","iopub.execute_input":"2023-03-23T03:46:24.343858Z","iopub.status.idle":"2023-03-23T03:46:24.452269Z","shell.execute_reply.started":"2023-03-23T03:46:24.343795Z","shell.execute_reply":"2023-03-23T03:46:24.451015Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_defog.describe()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:24.453419Z","iopub.execute_input":"2023-03-23T03:46:24.453812Z","iopub.status.idle":"2023-03-23T03:46:24.500149Z","shell.execute_reply.started":"2023-03-23T03:46:24.453772Z","shell.execute_reply":"2023-03-23T03:46:24.499008Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"userId = \"003f117e14\"\ntrain_tdcsfog = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/train/tdcsfog/'+userId+'.csv')\ntrain_tdcsfog.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-23T03:46:48.223172Z","iopub.execute_input":"2023-03-23T03:46:48.223561Z","iopub.status.idle":"2023-03-23T03:46:48.248020Z","shell.execute_reply.started":"2023-03-23T03:46:48.223527Z","shell.execute_reply":"2023-03-23T03:46:48.247096Z"},"trusted":true},"execution_count":null,"outputs":[]}]}