{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.11","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":102335,"databundleVersionId":12518947,"sourceType":"competition"}],"dockerImageVersionId":31040,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"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)\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\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\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","trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:17:58.67332Z","iopub.execute_input":"2025-06-03T08:17:58.674634Z","iopub.status.idle":"2025-06-03T08:17:58.711067Z","shell.execute_reply.started":"2025-06-03T08:17:58.674578Z","shell.execute_reply":"2025-06-03T08:17:58.710159Z"}},"outputs":[{"name":"stdout","text":"/kaggle/input/cmi-detect-behavior-with-sensor-data/train_demographics.csv\n/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv\n/kaggle/input/cmi-detect-behavior-with-sensor-data/train.csv\n/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/cmi_inference_server.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/cmi_gateway.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/__init__.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/core/templates.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/core/base_gateway.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/core/relay.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/core/kaggle_evaluation.proto\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/core/__init__.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/core/generated/kaggle_evaluation_pb2.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/core/generated/kaggle_evaluation_pb2_grpc.py\n/kaggle/input/cmi-detect-behavior-with-sensor-data/kaggle_evaluation/core/generated/__init__.py\n","output_type":"stream"}],"execution_count":16},{"cell_type":"code","source":"import pandas as pd\n\n# Dosya yolları (Kaggle ortamında '../input/' altındaki dizine göre)\ntrain_df = pd.read_csv('/kaggle/input/cmi-detect-behavior-with-sensor-data/train.csv')\ntest_df = pd.read_csv('/kaggle/input/cmi-detect-behavior-with-sensor-data/test.csv')\ntrain_demo = pd.read_csv('/kaggle/input/cmi-detect-behavior-with-sensor-data/train_demographics.csv')\ntest_demo = pd.read_csv('/kaggle/input/cmi-detect-behavior-with-sensor-data/test_demographics.csv')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:17:58.712476Z","iopub.execute_input":"2025-06-03T08:17:58.71279Z","iopub.status.idle":"2025-06-03T08:18:32.14113Z","shell.execute_reply.started":"2025-06-03T08:17:58.712769Z","shell.execute_reply":"2025-06-03T08:18:32.14026Z"}},"outputs":[],"execution_count":17},{"cell_type":"code","source":"print(train_df.head())\nprint(test_df.head())\nprint(train_demo.head())\nprint(test_demo.head())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:18:32.141999Z","iopub.execute_input":"2025-06-03T08:18:32.142332Z","iopub.status.idle":"2025-06-03T08:18:32.170442Z","shell.execute_reply.started":"2025-06-03T08:18:32.142288Z","shell.execute_reply":"2025-06-03T08:18:32.169412Z"}},"outputs":[{"name":"stdout","text":"              row_id sequence_type sequence_id  sequence_counter      subject  \\\n0  SEQ_000007_000000        Target  SEQ_000007                 0  SUBJ_059520   \n1  SEQ_000007_000001        Target  SEQ_000007                 1  SUBJ_059520   \n2  SEQ_000007_000002        Target  SEQ_000007                 2  SUBJ_059520   \n3  SEQ_000007_000003        Target  SEQ_000007                 3  SUBJ_059520   \n4  SEQ_000007_000004        Target  SEQ_000007                 4  SUBJ_059520   \n\n                       orientation                                   behavior  \\\n0  Seated Lean Non Dom - FACE DOWN  Relaxes and moves hand to target location   \n1  Seated Lean Non Dom - FACE DOWN  Relaxes and moves hand to target location   \n2  Seated Lean Non Dom - FACE DOWN  Relaxes and moves hand to target location   \n3  Seated Lean Non Dom - FACE DOWN  Relaxes and moves hand to target location   \n4  Seated Lean Non Dom - FACE DOWN  Relaxes and moves hand to target location   \n\n        phase             gesture     acc_x  ...  tof_5_v54  tof_5_v55  \\\n0  Transition  Cheek - pinch skin  6.683594  ...       -1.0       -1.0   \n1  Transition  Cheek - pinch skin  6.949219  ...       -1.0       -1.0   \n2  Transition  Cheek - pinch skin  5.722656  ...       -1.0       -1.0   \n3  Transition  Cheek - pinch skin  6.601562  ...       -1.0       -1.0   \n4  Transition  Cheek - pinch skin  5.566406  ...       -1.0       -1.0   \n\n   tof_5_v56  tof_5_v57  tof_5_v58  tof_5_v59  tof_5_v60  tof_5_v61  \\\n0       -1.0       -1.0       -1.0       -1.0       -1.0       -1.0   \n1       -1.0       -1.0       -1.0       -1.0       -1.0       -1.0   \n2      112.0      119.0       -1.0       -1.0       -1.0       -1.0   \n3      101.0      111.0       -1.0       -1.0       -1.0       -1.0   \n4      101.0      109.0      125.0       -1.0       -1.0       -1.0   \n\n   tof_5_v62  tof_5_v63  \n0       -1.0       -1.0  \n1       -1.0       -1.0  \n2       -1.0       -1.0  \n3       -1.0       -1.0  \n4       -1.0       -1.0  \n\n[5 rows x 341 columns]\n              row_id sequence_id  sequence_counter      subject      acc_x  \\\n0  SEQ_000001_000000  SEQ_000001                 0  SUBJ_055840   9.039062   \n1  SEQ_000001_000001  SEQ_000001                 1  SUBJ_055840   9.421875   \n2  SEQ_000001_000002  SEQ_000001                 2  SUBJ_055840  10.160156   \n3  SEQ_000001_000003  SEQ_000001                 3  SUBJ_055840   9.773438   \n4  SEQ_000001_000004  SEQ_000001                 4  SUBJ_055840   9.195312   \n\n      acc_y     acc_z     rot_w     rot_x     rot_y  ...  tof_5_v54  \\\n0  5.261719  0.800781  0.367188 -0.397400 -0.629028  ...       97.0   \n1  3.460938 -1.113281  0.353882 -0.507141 -0.652710  ...      175.0   \n2  2.082031 -3.871094  0.384094 -0.532104 -0.639648  ...       -1.0   \n3  1.355469 -4.371094  0.387756 -0.531982 -0.634033  ...       -1.0   \n4  1.011719 -3.222656  0.382751 -0.534180 -0.638367  ...       -1.0   \n\n   tof_5_v55  tof_5_v56  tof_5_v57  tof_5_v58  tof_5_v59  tof_5_v60  \\\n0       87.0      206.0       -1.0      195.0       -1.0       -1.0   \n1      158.0       -1.0       -1.0       -1.0       -1.0       -1.0   \n2      160.0       -1.0       -1.0       -1.0       -1.0       -1.0   \n3      160.0       -1.0       -1.0       -1.0       -1.0       -1.0   \n4      163.0       -1.0       -1.0       -1.0       -1.0       -1.0   \n\n   tof_5_v61  tof_5_v62  tof_5_v63  \n0       -1.0      111.0       -1.0  \n1      211.0      187.0      178.0  \n2       -1.0      197.0      177.0  \n3       -1.0      197.0      183.0  \n4       -1.0      200.0      173.0  \n\n[5 rows x 336 columns]\n       subject  adult_child  age  sex  handedness  height_cm  \\\n0  SUBJ_000206            1   41    1           1      172.0   \n1  SUBJ_001430            0   11    0           1      167.0   \n2  SUBJ_002923            1   28    1           0      164.0   \n3  SUBJ_003328            1   33    1           1      171.0   \n4  SUBJ_004117            0   15    0           1      184.0   \n\n   shoulder_to_wrist_cm  elbow_to_wrist_cm  \n0                    50               25.0  \n1                    51               27.0  \n2                    54               26.0  \n3                    52               25.0  \n4                    54               28.0  \n       subject  adult_child  age  sex  handedness  height_cm  \\\n0  SUBJ_016452            1   25    1           1      165.0   \n1  SUBJ_055840            0   13    0           1      177.0   \n\n   shoulder_to_wrist_cm  elbow_to_wrist_cm  \n0                    52               23.0  \n1                    52               27.0  \n","output_type":"stream"}],"execution_count":18},{"cell_type":"code","source":"# Boyut bilgisi\nprint(f\"train_df boyut: {train_df.shape}\")      # (satır sayısı, sütun sayısı)\nprint(\"---------------------------------\")\nprint(f\"test_df boyut:  {test_df.shape}\")\nprint(\"---------------------------------\")\nprint(f\"train_demo boyut: {train_demo.shape}\")\nprint(\"---------------------------------\")\nprint(f\"test_demo boyut:  {test_demo.shape}\")\nprint(\"---------------------------------\")\n\n# Sütun adları ve tipleri\nprint(train_df.info())\nprint(\"---------------------------------\")\nprint(test_df.info())\nprint(\"---------------------------------\")\nprint(train_demo.info())\nprint(\"---------------------------------\")\nprint(test_demo.info())\nprint(\"---------------------------------\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:18:32.172116Z","iopub.execute_input":"2025-06-03T08:18:32.172511Z","iopub.status.idle":"2025-06-03T08:18:32.216032Z","shell.execute_reply.started":"2025-06-03T08:18:32.172461Z","shell.execute_reply":"2025-06-03T08:18:32.215151Z"}},"outputs":[{"name":"stdout","text":"train_df boyut: (574945, 341)\n---------------------------------\ntest_df boyut:  (107, 336)\n---------------------------------\ntrain_demo boyut: (81, 8)\n---------------------------------\ntest_demo boyut:  (2, 8)\n---------------------------------\n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 574945 entries, 0 to 574944\nColumns: 341 entries, row_id to tof_5_v63\ndtypes: float64(332), int64(1), object(8)\nmemory usage: 1.5+ GB\nNone\n---------------------------------\n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 107 entries, 0 to 106\nColumns: 336 entries, row_id to tof_5_v63\ndtypes: float64(332), int64(1), object(3)\nmemory usage: 281.0+ KB\nNone\n---------------------------------\n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 81 entries, 0 to 80\nData columns (total 8 columns):\n #   Column                Non-Null Count  Dtype  \n---  ------                --------------  -----  \n 0   subject               81 non-null     object \n 1   adult_child           81 non-null     int64  \n 2   age                   81 non-null     int64  \n 3   sex                   81 non-null     int64  \n 4   handedness            81 non-null     int64  \n 5   height_cm             81 non-null     float64\n 6   shoulder_to_wrist_cm  81 non-null     int64  \n 7   elbow_to_wrist_cm     81 non-null     float64\ndtypes: float64(2), int64(5), object(1)\nmemory usage: 5.2+ KB\nNone\n---------------------------------\n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 2 entries, 0 to 1\nData columns (total 8 columns):\n #   Column                Non-Null Count  Dtype  \n---  ------                --------------  -----  \n 0   subject               2 non-null      object \n 1   adult_child           2 non-null      int64  \n 2   age                   2 non-null      int64  \n 3   sex                   2 non-null      int64  \n 4   handedness            2 non-null      int64  \n 5   height_cm             2 non-null      float64\n 6   shoulder_to_wrist_cm  2 non-null      int64  \n 7   elbow_to_wrist_cm     2 non-null      float64\ndtypes: float64(2), int64(5), object(1)\nmemory usage: 260.0+ bytes\nNone\n---------------------------------\n","output_type":"stream"}],"execution_count":19},{"cell_type":"code","source":"# Özniteliklerin açıklamaları:\n# subject, adult_child, age, sex, handedness, height_cm, shoulder_to_wrist_cm, elbow_to_wrist_cm\n\n# Kaç farklı katılımcı var?\nprint(\"Train demo - unique subject sayısı:\", train_demo['subject'].nunique())\nprint(\"---------------------------------\")\nprint(\"Test demo  - unique subject sayısı:\", test_demo['subject'].nunique())\nprint(\"---------------------------------\")\n# Temel istatistikler (sayısal sütunlar için)\nprint(train_demo.describe())\nprint(\"---------------------------------\")\nprint(test_demo.describe())\n\n# Kategorik sütunların (örneğin sex, adult_child gibi) dağılımı\nprint(train_demo['sex'].value_counts())\nprint(\"---------------------------------\")\nprint(train_demo['adult_child'].value_counts())\nprint(\"---------------------------------\")\nprint(train_demo['handedness'].value_counts())\nprint(\"---------------------------------\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:18:32.21772Z","iopub.execute_input":"2025-06-03T08:18:32.217987Z","iopub.status.idle":"2025-06-03T08:18:32.258131Z","shell.execute_reply.started":"2025-06-03T08:18:32.217969Z","shell.execute_reply":"2025-06-03T08:18:32.25731Z"}},"outputs":[{"name":"stdout","text":"Train demo - unique subject sayısı: 81\n---------------------------------\nTest demo  - unique subject sayısı: 2\n---------------------------------\n       adult_child        age        sex  handedness   height_cm  \\\ncount    81.000000  81.000000  81.000000   81.000000   81.000000   \nmean      0.518519  21.814815   0.617284    0.876543  167.993827   \nstd       0.502770  10.289693   0.489078    0.331010   10.605863   \nmin       0.000000  10.000000   0.000000    0.000000  135.000000   \n25%       0.000000  13.000000   0.000000    1.000000  163.000000   \n50%       1.000000  22.000000   1.000000    1.000000  170.000000   \n75%       1.000000  27.000000   1.000000    1.000000  174.000000   \nmax       1.000000  53.000000   1.000000    1.000000  190.500000   \n\n       shoulder_to_wrist_cm  elbow_to_wrist_cm  \ncount             81.000000          81.000000  \nmean              51.580247          25.469136  \nstd                4.888415           3.025254  \nmin               41.000000          18.000000  \n25%               49.000000          24.000000  \n50%               52.000000          25.000000  \n75%               55.000000          27.000000  \nmax               71.000000          44.000000  \n---------------------------------\n       adult_child        age       sex  handedness   height_cm  \\\ncount     2.000000   2.000000  2.000000         2.0    2.000000   \nmean      0.500000  19.000000  0.500000         1.0  171.000000   \nstd       0.707107   8.485281  0.707107         0.0    8.485281   \nmin       0.000000  13.000000  0.000000         1.0  165.000000   \n25%       0.250000  16.000000  0.250000         1.0  168.000000   \n50%       0.500000  19.000000  0.500000         1.0  171.000000   \n75%       0.750000  22.000000  0.750000         1.0  174.000000   \nmax       1.000000  25.000000  1.000000         1.0  177.000000   \n\n       shoulder_to_wrist_cm  elbow_to_wrist_cm  \ncount                   2.0           2.000000  \nmean                   52.0          25.000000  \nstd                     0.0           2.828427  \nmin                    52.0          23.000000  \n25%                    52.0          24.000000  \n50%                    52.0          25.000000  \n75%                    52.0          26.000000  \nmax                    52.0          27.000000  \nsex\n1    50\n0    31\nName: count, dtype: int64\n---------------------------------\nadult_child\n1    42\n0    39\nName: count, dtype: int64\n---------------------------------\nhandedness\n1    71\n0    10\nName: count, dtype: int64\n---------------------------------\n","output_type":"stream"}],"execution_count":20},{"cell_type":"code","source":"# Kaç farklı sequence_id var?\nprint(\"Unique sequence_id sayısı:\", train_df['sequence_id'].nunique())\nprint(\"---------------------------------\")\n\n# Kaç farklı subject var?\nprint(\"Unique subject sayısı (train):\", train_df['subject'].nunique())\nprint(\"---------------------------------\")\n\n# Kaç farklı gesture (hareket) var?\nprint(\"Unique gesture sayısı:\", train_df['gesture'].nunique())\nprint(\"---------------------------------\")\nprint(\"Gesture örnekleri:\", train_df['gesture'].unique())\nprint(\"---------------------------------\")\n\n# Kaç farklı behavior (Geçiş, Duraklama, Hareket) var ve dağılımı\nprint(\"Behavior dağılımı:\\n\", train_df['behavior'].value_counts())\nprint(\"---------------------------------\")\n\n# sequence_type sütunu: Hangi türler var?\nprint(\"sequence_type dağılımı:\\n\", train_df['sequence_type'].value_counts())\nprint(\"---------------------------------\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:18:32.25898Z","iopub.execute_input":"2025-06-03T08:18:32.259228Z","iopub.status.idle":"2025-06-03T08:18:32.485923Z","shell.execute_reply.started":"2025-06-03T08:18:32.259204Z","shell.execute_reply":"2025-06-03T08:18:32.484998Z"}},"outputs":[{"name":"stdout","text":"Unique sequence_id sayısı: 8151\n---------------------------------\nUnique subject sayısı (train): 81\n---------------------------------\nUnique gesture sayısı: 18\n---------------------------------\nGesture örnekleri: ['Cheek - pinch skin' 'Forehead - pull hairline' 'Write name on leg'\n 'Feel around in tray and pull out an object' 'Neck - scratch'\n 'Neck - pinch skin' 'Eyelash - pull hair' 'Eyebrow - pull hair'\n 'Forehead - scratch' 'Above ear - pull hair' 'Wave hello'\n 'Write name in air' 'Text on phone' 'Pull air toward your face'\n 'Pinch knee/leg skin' 'Scratch knee/leg skin' 'Drink from bottle/cup'\n 'Glasses on/off']\n---------------------------------\nBehavior dağılımı:\n behavior\nPerforms gesture                             255817\nMoves hand to target location                156474\nHand at target location                       95173\nRelaxes and moves hand to target location     67481\nName: count, dtype: int64\n---------------------------------\nsequence_type dağılımı:\n sequence_type\nTarget        344058\nNon-Target    230887\nName: count, dtype: int64\n---------------------------------\n","output_type":"stream"}],"execution_count":21},{"cell_type":"code","source":"# Gesture dağılımına hızlı bakış\nprint(train_df['gesture'].value_counts(normalize=True).head(10))  # yüzde olarak en sık ilk 10 hareket","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:21:36.012611Z","iopub.execute_input":"2025-06-03T08:21:36.012947Z","iopub.status.idle":"2025-06-03T08:21:36.023614Z","shell.execute_reply.started":"2025-06-03T08:21:36.012925Z","shell.execute_reply":"2025-06-03T08:21:36.022627Z"}},"outputs":[{"name":"stdout","text":"gesture\n15    0.101683\n11    0.098477\n3     0.077060\n7     0.071177\n6     0.070967\n0     0.070546\n9     0.070454\n4     0.069951\n10    0.069788\n16    0.059755\nName: proportion, dtype: float64\n","output_type":"stream"}],"execution_count":31},{"cell_type":"code","source":"# Her sütunda kaç NaN var?\nprint(train_df.isnull().sum().sort_values(ascending=False).head(20))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:22:36.381178Z","iopub.execute_input":"2025-06-03T08:22:36.381556Z","iopub.status.idle":"2025-06-03T08:22:37.239288Z","shell.execute_reply.started":"2025-06-03T08:22:36.381527Z","shell.execute_reply":"2025-06-03T08:22:37.238432Z"}},"outputs":[{"name":"stdout","text":"thm_5        33286\ntof_5_v63    30142\ntof_5_v24    30142\ntof_5_v19    30142\ntof_5_v20    30142\ntof_5_v21    30142\ntof_5_v22    30142\ntof_5_v23    30142\ntof_5_v25    30142\ntof_5_v17    30142\ntof_5_v26    30142\ntof_5_v27    30142\ntof_5_v28    30142\ntof_5_v29    30142\ntof_5_v30    30142\ntof_5_v31    30142\ntof_5_v18    30142\ntof_5_v16    30142\ntof_5_v33    30142\ntof_5_v6     30142\ndtype: int64\n","output_type":"stream"}],"execution_count":32},{"cell_type":"code","source":"# İlk 5 ToF sütunu adı\ntof_sutunlar = [col for col in train_df.columns if col.startswith('tof_')]\nprint(\"Toplam ToF sütunu sayısı:\", len(tof_sutunlar))\nprint(\"ToF sütunlarına kısa bakış:\", tof_sutunlar[:5])\n\n# Bu sütunlardaki -1 değerlerinin sayısı\nfor col in tof_sutunlar[:5]:\n    print(col, \"içindeki -1 sayısı:\", (train_df[col] == -1).sum())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:25:05.848995Z","iopub.execute_input":"2025-06-03T08:25:05.849306Z","iopub.status.idle":"2025-06-03T08:25:05.864313Z","shell.execute_reply.started":"2025-06-03T08:25:05.849283Z","shell.execute_reply":"2025-06-03T08:25:05.863241Z"}},"outputs":[{"name":"stdout","text":"Toplam ToF sütunu sayısı: 320\nToF sütunlarına kısa bakış: ['tof_1_v0', 'tof_1_v1', 'tof_1_v2', 'tof_1_v3', 'tof_1_v4']\ntof_1_v0 içindeki -1 sayısı: 289963\ntof_1_v1 içindeki -1 sayısı: 294126\ntof_1_v2 içindeki -1 sayısı: 292777\ntof_1_v3 içindeki -1 sayısı: 288300\ntof_1_v4 içindeki -1 sayısı: 282406\n","output_type":"stream"}],"execution_count":36},{"cell_type":"code","source":"# Train sensör verisi ile demografik veriyi subject üzerinden birleştir\nmerged_train = train_df.merge(train_demo, on='subject', how='left')\nprint(\"----------------------------------------------------------\")\n# Artık merged_train DataFrame’inde acc_x, acc_y, ... sütunlarının yanı sıra katılımcı yaşı, cinsiyet vs. var\nprint(merged_train.info())\nprint(\"----------------------------------------------------------\")\n# Örneğin yaşa göre ortalama acc_x değeri\nprint(merged_train.groupby('age')['acc_x'].mean().head())\nprint(\"----------------------------------------------------------\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:28:06.83134Z","iopub.execute_input":"2025-06-03T08:28:06.83169Z","iopub.status.idle":"2025-06-03T08:28:08.292355Z","shell.execute_reply.started":"2025-06-03T08:28:06.831668Z","shell.execute_reply":"2025-06-03T08:28:08.291482Z"}},"outputs":[{"name":"stdout","text":"----------------------------------------------------------\n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 574945 entries, 0 to 574944\nColumns: 348 entries, row_id to elbow_to_wrist_cm\ndtypes: float64(334), int64(7), object(7)\nmemory usage: 1.5+ GB\nNone\n----------------------------------------------------------\nage\n10    2.669667\n11    0.303552\n12    1.975159\n13    2.188627\n14    2.991528\nName: acc_x, dtype: float64\n----------------------------------------------------------\n","output_type":"stream"}],"execution_count":38},{"cell_type":"code","source":"import matplotlib.pyplot as plt \nörnek_seq = train_df['sequence_id'].value_counts().idxmax()\nörnek_df = train_df[train_df['sequence_id'] == örnek_seq]\nörnek_movement = örnek_df[örnek_df['behavior'] == 'gesture']\n\nplt.figure(figsize=(12, 4))\nfor col in thm_sutunlar:\n    plt.plot(örnek_movement['sequence_counter'], örnek_movement[col], label=col)\nplt.title(f\"Sequence ID {örnek_seq}: Termopil Sensörlerinin Zamanla Değişimi\")\nplt.xlabel(\"sequence_counter\")\nplt.ylabel(\"Sıcaklık (°C)\")\nplt.legend(loc='upper right', ncol=3, fontsize=8)\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-03T08:31:17.648032Z","iopub.execute_input":"2025-06-03T08:31:17.648316Z","iopub.status.idle":"2025-06-03T08:31:17.84148Z","shell.execute_reply.started":"2025-06-03T08:31:17.648298Z","shell.execute_reply":"2025-06-03T08:31:17.840433Z"}},"outputs":[{"traceback":["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)","\u001b[0;32m/tmp/ipykernel_35/1029349732.py\u001b[0m in \u001b[0;36m<cell line: 0>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      6\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfigure\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfigsize\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m12\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m4\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----> 7\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mcol\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mthm_sutunlar\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      8\u001b[0m     \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mörnek_movement\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'sequence_counter'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mörnek_movement\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mcol\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlabel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      9\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"Sequence ID {örnek_seq}: Termopil Sensörlerinin Zamanla Değişimi\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;31mNameError\u001b[0m: name 'thm_sutunlar' is not defined"],"ename":"NameError","evalue":"name 'thm_sutunlar' is not defined","output_type":"error"},{"output_type":"display_data","data":{"text/plain":"<Figure size 1200x400 with 0 Axes>"},"metadata":{}}],"execution_count":42},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}