{
  "id": 590696,
  "title": "Left/right handedness subjects will affect the score?",
  "url": "/competitions/cmi-detect-behavior-with-sensor-data/discussion/590696",
  "author_name": "I2nfinit3y",
  "post_date": "2025-07-22T08:36:03.081000",
  "votes": 22,
  "comment_count": 23,
  "views": 0,
  "content": "<p>The left handedness subjects in the training data are just about 10, so there is much score gap between left handedness subjects and right handedness subjects (about 0.08~0.1). </p>\n<p>One of our model's cv is 0.8421, but score of left/right handedness subject is (left : 0.7622, right : 0.8665), so its lb is just 0.83.  Our another model's LB is 0.84 with cv of 0.8387, and its socre of left/right handedness subject is (left : 0.7850, right : 0.8598). </p>\n<p>I guess there may be more left handedness subjects than right handedness subjects in public leaderboard?</p>",
  "messages": [
    {
      "id": 3252221,
      "postDate": "2025-07-22T08:36:03.083Z",
      "content": "<p>The left handedness subjects in the training data are just about 10, so there is much score gap between left handedness subjects and right handedness subjects (about 0.08~0.1). </p>\n<p>One of our model's cv is 0.8421, but score of left/right handedness subject is (left : 0.7622, right : 0.8665), so its lb is just 0.83.  Our another model's LB is 0.84 with cv of 0.8387, and its socre of left/right handedness subject is (left : 0.7850, right : 0.8598). </p>\n<p>I guess there may be more left handedness subjects than right handedness subjects in public leaderboard?</p>",
      "rawMarkdown": "The left handedness subjects in the training data are just about 10, so there is much score gap between left handedness subjects and right handedness subjects (about 0.08~0.1). \n\nOne of our model's cv is 0.8421, but score of left/right handedness subject is (left : 0.7622, right : 0.8665), so its lb is just 0.83.  Our another model's LB is 0.84 with cv of 0.8387, and its socre of left/right handedness subject is (left : 0.7850, right : 0.8598). \n\nI guess there may be more left handedness subjects than right handedness subjects in public leaderboard?",
      "votes": 22
    },
    {
      "id": 3253171,
      "postDate": "2025-07-24T06:35:33.813Z",
      "content": "<p>I'm really curious about it.<br>\nI tried to flip acc_x, acc_y, rot_x, and rot_y, but the score decreased somehow.<br>\nI wonder whether left-handed subjects really wear on the left hand.</p>\n<p>This is the average of acc_x and acc_y. Red points -&gt; right handed, Blue points -&gt; left handed.<br>\nFrom the point of this image, it seems the way to flip x, y works.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F25976934%2Fa4d1d425596e558338294c09ecd58853%2Fdownload.png?generation=1753338767672187&amp;alt=media\" alt=\"\"></p>\n<p>I tried this code, but it didn't improve the score.</p>\n<pre><code> ():\n\n    \n    df[] = -df[]  \n    df[] = -df[]  \n    \n\n    df[] = -df[]  \n    df[] = -df[]  \n    \n\n\n     df\n</code></pre>\n<p>If some method improve your score and share the method, I will really appreciate it.</p>",
      "rawMarkdown": "I'm really curious about it.\nI tried to flip acc_x, acc_y, rot_x, and rot_y, but the score decreased somehow.\nI wonder whether left-handed subjects really wear on the left hand.\n\nThis is the average of acc_x and acc_y. Red points -> right handed, Blue points -> left handed.\nFrom the point of this image, it seems the way to flip x, y works.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F25976934%2Fa4d1d425596e558338294c09ecd58853%2Fdownload.png?generation=1753338767672187&alt=media)\n\n\nI tried this code, but it didn't improve the score.\n```python\ndef convert_left_to_right_coordinates(df):\n\n    # Apply transformations\n    df['acc_x'] = -df['acc_x']  # Flip X acceleration\n    df['acc_y'] = -df['acc_y']  # Flip Y acceleration\n    # acc_z stays the same\n    \n    df['rot_x'] = -df['rot_x']  # Flip X rotation\n    df['rot_y'] = -df['rot_y']  # Flip Y rotation\n    # rot_z and rot_w stay the same\n\n    \n    return df\n```\n\n\nIf some method improve your score and share the method, I will really appreciate it.",
      "votes": 6,
      "replies": [
        {
          "id": 3253216,
          "postDate": "2025-07-24T08:42:26.103Z",
          "content": "<p>I think it is enough to change x axis. (-x)<br>\nIt is because the longitudinal direction and gravity direction remain unchanged, and only the inside and outside are reversed if the device is worn in the same orientation.<br>\nIn my case IMU only prediction slightly improved , but in case IMU +ToF model ,there was almost no change.<br>\nI'm glad if you try and give me your opinion.</p>",
          "rawMarkdown": "I think it is enough to change x axis. (-x)\nIt is because the longitudinal direction and gravity direction remain unchanged, and only the inside and outside are reversed if the device is worn in the same orientation.\nIn my case IMU only prediction slightly improved , but in case IMU +ToF model ,there was almost no change.\nI'm glad if you try and give me your opinion.",
          "votes": 1,
          "replies": [
            {
              "id": 3253219,
              "postDate": "2025-07-24T08:53:57.743Z",
              "content": "<p>Thank you!<br>\nI really appreciate it, I will try it soon!<br>\nI'll write the cv and lb changes here later soon.</p>",
              "rawMarkdown": "Thank you!\nI really appreciate it, I will try it soon!\nI'll write the cv and lb changes here later soon."
            },
            {
              "id": 3253336,
              "postDate": "2025-07-24T13:37:37.447Z",
              "content": "<p>I tried this code thanks to your suggestion.<br>\nSo I ran this code in the inference notebook with my model (without retraining with flipping).<br>\nHowever, unfortunately the lb score was 0.83. (the lb score without flipping is high 0.84)</p>\n<p>If flipping works in your case, the reason why the score of IMU only improved and the score of IMU&amp;TOF was almost no change is because the effect of acc and rot of IMU&amp;TOF is low due to many other parameters (thm, tof1, tof2, etc) compared to IMU only, I guess.</p>\n<p>I will try to train my model with flipping to check cv later.</p>\n<pre><code> ():\n    df[] = -df[]  \n    df[] = -df[]  \n     df\n\n () -&gt; :\n    df_test = sequence.to_pandas()\n    handedness = demographics[][]\n     handedness == :\n        df_test = convert_left_to_right_coordinates(df_test)\n\n    prediction = predict_imu_tof(df_test, demographics)\n     prediction\n</code></pre>",
              "rawMarkdown": "I tried this code thanks to your suggestion.\nSo I ran this code in the inference notebook with my model (without retraining with flipping).\nHowever, unfortunately the lb score was 0.83. (the lb score without flipping is high 0.84)\n\nIf flipping works in your case, the reason why the score of IMU only improved and the score of IMU&TOF was almost no change is because the effect of acc and rot of IMU&TOF is low due to many other parameters (thm, tof1, tof2, etc) compared to IMU only, I guess.\n\nI will try to train my model with flipping to check cv later.\n\n```python\ndef convert_left_to_right_coordinates(df):\n    df['acc_x'] = -df['acc_x']  # Flip X acceleration\n    df['rot_x'] = -df['rot_x']  # Flip X rotation\n    return df\n\ndef predict(sequence: pl.DataFrame, demographics: pl.DataFrame) -> str:\n    df_test = sequence.to_pandas()\n    handedness = demographics['handedness'][0]\n    if handedness == 0:\n        df_test = convert_left_to_right_coordinates(df_test)\n        \n    prediction = predict_imu_tof(df_test, demographics)\n    return prediction\n```"
            }
          ]
        },
        {
          "id": 3253239,
          "postDate": "2025-07-24T10:04:29.590Z",
          "content": "<p>did flip make it worse?</p>",
          "rawMarkdown": "did flip make it worse?",
          "replies": [
            {
              "id": 3253333,
              "postDate": "2025-07-24T13:24:54.240Z",
              "content": "<p>In my case, flipping acc_x/rot_x made the score worse somehow. (LB high 0.84 -&gt; 0.83)</p>",
              "rawMarkdown": "In my case, flipping acc_x/rot_x made the score worse somehow. (LB high 0.84 -> 0.83)",
              "votes": 1
            },
            {
              "id": 3253412,
              "postDate": "2025-07-24T16:17:40.410Z",
              "content": "<p>How was CV impacted? </p>",
              "rawMarkdown": "How was CV impacted? "
            },
            {
              "id": 3253624,
              "postDate": "2025-07-25T02:26:07.377Z",
              "content": "<p>Unfortunately, my cv score drops by 0.05~0.1.</p>",
              "rawMarkdown": "Unfortunately, my cv score drops by 0.05~0.1."
            }
          ]
        },
        {
          "id": 3253317,
          "postDate": "2025-07-24T12:56:33.463Z",
          "content": "<p>Thanks for your sharing. But it didn't improve my score, too. And if we use some features like linear acceleration without gravity or angular velocity, we may need to recalculate them after flipping.</p>",
          "rawMarkdown": "Thanks for your sharing. But it didn't improve my score, too. And if we use some features like linear acceleration without gravity or angular velocity, we may need to recalculate them after flipping.",
          "votes": 1
        },
        {
          "id": 3254058,
          "postDate": "2025-07-25T18:20:45.480Z",
          "content": "<p>Do we know that the left handed subjects in the test set actually wear the device on their left hand? Transforming the left handed subjects increases my CV by ~0.005 but hurts my LB score. It seems like at least in the training set all of the subjects do wear the device on the wrist defined by handedness. The data description is a bit ambiguous \"handedness: Dominant hand used by the participant, 0 = left-handed, 1 = right-handed.\" Here are a few visuals of how much transforming left handed subjects improves the axis alignment at least on the subjects in the training set.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3278346%2Fd5069935dce5374186559951397ec295%2FScreenshot%202025-07-25%20111452.png?generation=1753467497853122&amp;alt=media\" alt=\"\"></p>",
          "rawMarkdown": "Do we know that the left handed subjects in the test set actually wear the device on their left hand? Transforming the left handed subjects increases my CV by ~0.005 but hurts my LB score. It seems like at least in the training set all of the subjects do wear the device on the wrist defined by handedness. The data description is a bit ambiguous \"handedness: Dominant hand used by the participant, 0 = left-handed, 1 = right-handed.\" Here are a few visuals of how much transforming left handed subjects improves the axis alignment at least on the subjects in the training set.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3278346%2Fd5069935dce5374186559951397ec295%2FScreenshot%202025-07-25%20111452.png?generation=1753467497853122&alt=media)",
          "replies": [
            {
              "id": 3254065,
              "postDate": "2025-07-25T18:39:01.587Z",
              "content": "<p>From the data page: \"This dataset contains sensor recordings taken while participants performed 8 BFRB-like gestures and 10 non-BFRB-like gestures while wearing the Helios device on the wrist of their dominant arm.\" Up to you if you want to trust that or not though. </p>",
              "rawMarkdown": "From the data page: \"This dataset contains sensor recordings taken while participants performed 8 BFRB-like gestures and 10 non-BFRB-like gestures while wearing the Helios device on the wrist of their dominant arm.\" Up to you if you want to trust that or not though. "
            },
            {
              "id": 3254183,
              "postDate": "2025-07-26T01:27:28.140Z",
              "content": "<p>can you share the code  if possible?</p>",
              "rawMarkdown": "can you share the code  if possible?"
            },
            {
              "id": 3254200,
              "postDate": "2025-07-26T02:35:06.257Z",
              "content": "<p>I just negated acc_x for the left handed subjects, similar to the code others posted above. I tried negating rot_x as well but the correlation isn't nearly as strong. </p>",
              "rawMarkdown": "I just negated acc_x for the left handed subjects, similar to the code others posted above. I tried negating rot_x as well but the correlation isn't nearly as strong. "
            },
            {
              "id": 3254236,
              "postDate": "2025-07-26T04:29:30.277Z",
              "content": "<p>I meant for the visualization but nvm</p>",
              "rawMarkdown": "I meant for the visualization but nvm"
            },
            {
              "id": 3254245,
              "postDate": "2025-07-26T04:58:10.530Z",
              "content": "<p>Oh my bad. The code is a bit long but here is the gist of it.</p>\n<pre><code>lefty_data = main_df == ]()\nrighty_data = main_df == ]()\n\nlefty_mirrored = lefty_data()\nlefty_mirrored *= -\n\nsample_size = (, (lefty_data), (righty_data))\nquantiles = np(, , )\n\nlefty_sample = lefty_data(sample_size, random_state=)()\nlefty_mirrored_sample = lefty_mirrored(sample_size, random_state=)()\nrighty_sample = righty_data(sample_size, random_state=)()\n\nlefty_quantiles = np(lefty_sample, quantiles)\nmirrored_quantiles = np(lefty_mirrored_sample, quantiles)\nrighty_quantiles = np(righty_sample, quantiles)\n\ncorr_original = stats(righty_quantiles, lefty_quantiles)\ncorr_mirrored = stats(righty_quantiles, mirrored_quantiles)\n</code></pre>",
              "rawMarkdown": "Oh my bad. The code is a bit long but here is the gist of it.\n```\nlefty_data = main_df[main_df['handedness'] == 0].copy()\nrighty_data = main_df[main_df['handedness'] == 1].copy()\n\nlefty_mirrored = lefty_data.copy()\nlefty_mirrored['acc_x'] *= -1\n\nsample_size = min(50000, len(lefty_data), len(righty_data))\nquantiles = np.linspace(0.01, 0.99, 100)\n\nlefty_sample = lefty_data['acc_x'].sample(sample_size, random_state=42).sort_values()\nlefty_mirrored_sample = lefty_mirrored['acc_x'].sample(sample_size, random_state=42).sort_values()\nrighty_sample = righty_data['acc_x'].sample(sample_size, random_state=42).sort_values()\n\nlefty_quantiles = np.quantile(lefty_sample, quantiles)\nmirrored_quantiles = np.quantile(lefty_mirrored_sample, quantiles)\nrighty_quantiles = np.quantile(righty_sample, quantiles)\n\ncorr_original = stats.pearsonr(righty_quantiles, lefty_quantiles)[0]\ncorr_mirrored = stats.pearsonr(righty_quantiles, mirrored_quantiles)[0]\n```"
            }
          ]
        }
      ]
    },
    {
      "id": 3252785,
      "postDate": "2025-07-23T11:59:17.417Z",
      "content": "<p>That’s a really interesting observation—and it definitely raises a valid point about data imbalance and subgroup performance. With only ~10 left-handed subjects in the training set, it's quite possible that the model generalizes less effectively to that subgroup, especially if their patterns differ in subtle ways (e.g., brain activity, behavior, or sensor alignment, depending on the task domain.</p>",
      "rawMarkdown": "That’s a really interesting observation—and it definitely raises a valid point about data imbalance and subgroup performance. With only ~10 left-handed subjects in the training set, it's quite possible that the model generalizes less effectively to that subgroup, especially if their patterns differ in subtle ways (e.g., brain activity, behavior, or sensor alignment, depending on the task domain.",
      "votes": -5
    },
    {
      "id": 3253098,
      "postDate": "2025-07-24T02:52:38.850Z",
      "content": "<p>How about trying mirror transformation as a preprocessing？<br>\nThe intent is to treat all data as if it were measured in same hand.</p>",
      "rawMarkdown": "How about trying mirror transformation as a preprocessing？\nThe intent is to treat all data as if it were measured in same hand.",
      "replies": [
        {
          "id": 3255212,
          "postDate": "2025-07-28T07:39:49.790Z",
          "content": "<p>it breaks physics features,the main thing is that  left-handed gesture patterns are not just mirrored right handed ones , they have different trajectories and contact points, so the mirror transformation could make cv worse as people have mentioned above ,fliping causing issues</p>",
          "rawMarkdown": " it breaks physics features,the main thing is that  left-handed gesture patterns are not just mirrored right handed ones , they have different trajectories and contact points, so the mirror transformation could make cv worse as people have mentioned above ,fliping causing issues\n"
        }
      ]
    },
    {
      "id": 3252714,
      "postDate": "2025-07-23T08:43:33.883Z",
      "content": "<p>Have you tried to use two model to handle this two situation?</p>",
      "rawMarkdown": "Have you tried to use two model to handle this two situation?",
      "replies": [
        {
          "id": 3252759,
          "postDate": "2025-07-23T11:08:45.507Z",
          "content": "<p>Yes, but its performance is worse than using one model.</p>",
          "rawMarkdown": "Yes, but its performance is worse than using one model.",
          "votes": 1
        }
      ]
    },
    {
      "id": 3252237,
      "postDate": "2025-07-22T09:22:00.170Z",
      "content": "<p>Have you tried to oversampling the left hand? Is it effective?</p>",
      "rawMarkdown": "Have you tried to oversampling the left hand? Is it effective?\n",
      "replies": [
        {
          "id": 3252239,
          "postDate": "2025-07-22T09:26:48.837Z",
          "content": "<p>I have tried oversampling and weighted loss, but there is no obvious boost.</p>",
          "rawMarkdown": "I have tried oversampling and weighted loss, but there is no obvious boost."
        }
      ]
    },
    {
      "id": 3254519,
      "postDate": "2025-07-26T16:57:58.923Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 3253171,
      "author_name": "Himeno",
      "author_url": "",
      "post_date": "2025-07-24T06:35:33.813000",
      "content": "<p>I'm really curious about it.<br>\nI tried to flip acc_x, acc_y, rot_x, and rot_y, but the score decreased somehow.<br>\nI wonder whether left-handed subjects really wear on the left hand.</p>\n<p>This is the average of acc_x and acc_y. Red points -&gt; right handed, Blue points -&gt; left handed.<br>\nFrom the point of this image, it seems the way to flip x, y works.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F25976934%2Fa4d1d425596e558338294c09ecd58853%2Fdownload.png?generation=1753338767672187&amp;alt=media\" alt=\"\"></p>\n<p>I tried this code, but it didn't improve the score.</p>\n<pre><code> ():\n\n    \n    df[] = -df[]  \n    df[] = -df[]  \n    \n\n    df[] = -df[]  \n    df[] = -df[]  \n    \n\n\n     df\n</code></pre>\n<p>If some method improve your score and share the method, I will really appreciate it.</p>",
      "votes": 6,
      "replies": [
        {
          "id": 3253216,
          "author_name": "hyoko19",
          "author_url": "",
          "post_date": "2025-07-24T08:42:26.103000",
          "content": "<p>I think it is enough to change x axis. (-x)<br>\nIt is because the longitudinal direction and gravity direction remain unchanged, and only the inside and outside are reversed if the device is worn in the same orientation.<br>\nIn my case IMU only prediction slightly improved , but in case IMU +ToF model ,there was almost no change.<br>\nI'm glad if you try and give me your opinion.</p>",
          "votes": 1,
          "replies": [
            {
              "id": 3253219,
              "author_name": "Himeno",
              "author_url": "",
              "post_date": "2025-07-24T08:53:57.743000",
              "content": "<p>Thank you!<br>\nI really appreciate it, I will try it soon!<br>\nI'll write the cv and lb changes here later soon.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3253336,
              "author_name": "Himeno",
              "author_url": "",
              "post_date": "2025-07-24T13:37:37.447000",
              "content": "<p>I tried this code thanks to your suggestion.<br>\nSo I ran this code in the inference notebook with my model (without retraining with flipping).<br>\nHowever, unfortunately the lb score was 0.83. (the lb score without flipping is high 0.84)</p>\n<p>If flipping works in your case, the reason why the score of IMU only improved and the score of IMU&amp;TOF was almost no change is because the effect of acc and rot of IMU&amp;TOF is low due to many other parameters (thm, tof1, tof2, etc) compared to IMU only, I guess.</p>\n<p>I will try to train my model with flipping to check cv later.</p>\n<pre><code> ():\n    df[] = -df[]  \n    df[] = -df[]  \n     df\n\n () -&gt; :\n    df_test = sequence.to_pandas()\n    handedness = demographics[][]\n     handedness == :\n        df_test = convert_left_to_right_coordinates(df_test)\n\n    prediction = predict_imu_tof(df_test, demographics)\n     prediction\n</code></pre>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 3253239,
          "author_name": "yuanzhe zhou",
          "author_url": "",
          "post_date": "2025-07-24T10:04:29.590000",
          "content": "<p>did flip make it worse?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 3253333,
              "author_name": "Himeno",
              "author_url": "",
              "post_date": "2025-07-24T13:24:54.240000",
              "content": "<p>In my case, flipping acc_x/rot_x made the score worse somehow. (LB high 0.84 -&gt; 0.83)</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3253412,
              "author_name": "Jack",
              "author_url": "",
              "post_date": "2025-07-24T16:17:40.410000",
              "content": "<p>How was CV impacted? </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3253624,
              "author_name": "Himeno",
              "author_url": "",
              "post_date": "2025-07-25T02:26:07.377000",
              "content": "<p>Unfortunately, my cv score drops by 0.05~0.1.</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 3253317,
          "author_name": "I2nfinit3y",
          "author_url": "",
          "post_date": "2025-07-24T12:56:33.463000",
          "content": "<p>Thanks for your sharing. But it didn't improve my score, too. And if we use some features like linear acceleration without gravity or angular velocity, we may need to recalculate them after flipping.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 3254058,
          "author_name": "Jack Vittimberga",
          "author_url": "",
          "post_date": "2025-07-25T18:20:45.480000",
          "content": "<p>Do we know that the left handed subjects in the test set actually wear the device on their left hand? Transforming the left handed subjects increases my CV by ~0.005 but hurts my LB score. It seems like at least in the training set all of the subjects do wear the device on the wrist defined by handedness. The data description is a bit ambiguous \"handedness: Dominant hand used by the participant, 0 = left-handed, 1 = right-handed.\" Here are a few visuals of how much transforming left handed subjects improves the axis alignment at least on the subjects in the training set.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3278346%2Fd5069935dce5374186559951397ec295%2FScreenshot%202025-07-25%20111452.png?generation=1753467497853122&amp;alt=media\" alt=\"\"></p>",
          "votes": 0,
          "replies": [
            {
              "id": 3254065,
              "author_name": "Jack",
              "author_url": "",
              "post_date": "2025-07-25T18:39:01.587000",
              "content": "<p>From the data page: \"This dataset contains sensor recordings taken while participants performed 8 BFRB-like gestures and 10 non-BFRB-like gestures while wearing the Helios device on the wrist of their dominant arm.\" Up to you if you want to trust that or not though. </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3254183,
              "author_name": "Taha_Alshatiri",
              "author_url": "",
              "post_date": "2025-07-26T01:27:28.140000",
              "content": "<p>can you share the code  if possible?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3254200,
              "author_name": "Jack Vittimberga",
              "author_url": "",
              "post_date": "2025-07-26T02:35:06.257000",
              "content": "<p>I just negated acc_x for the left handed subjects, similar to the code others posted above. I tried negating rot_x as well but the correlation isn't nearly as strong. </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3254236,
              "author_name": "Taha_Alshatiri",
              "author_url": "",
              "post_date": "2025-07-26T04:29:30.277000",
              "content": "<p>I meant for the visualization but nvm</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3254245,
              "author_name": "Jack Vittimberga",
              "author_url": "",
              "post_date": "2025-07-26T04:58:10.530000",
              "content": "<p>Oh my bad. The code is a bit long but here is the gist of it.</p>\n<pre><code>lefty_data = main_df == ]()\nrighty_data = main_df == ]()\n\nlefty_mirrored = lefty_data()\nlefty_mirrored *= -\n\nsample_size = (, (lefty_data), (righty_data))\nquantiles = np(, , )\n\nlefty_sample = lefty_data(sample_size, random_state=)()\nlefty_mirrored_sample = lefty_mirrored(sample_size, random_state=)()\nrighty_sample = righty_data(sample_size, random_state=)()\n\nlefty_quantiles = np(lefty_sample, quantiles)\nmirrored_quantiles = np(lefty_mirrored_sample, quantiles)\nrighty_quantiles = np(righty_sample, quantiles)\n\ncorr_original = stats(righty_quantiles, lefty_quantiles)\ncorr_mirrored = stats(righty_quantiles, mirrored_quantiles)\n</code></pre>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3252785,
      "author_name": "Erigitola Wahab Olatunji",
      "author_url": "",
      "post_date": "2025-07-23T11:59:17.417000",
      "content": "<p>That’s a really interesting observation—and it definitely raises a valid point about data imbalance and subgroup performance. With only ~10 left-handed subjects in the training set, it's quite possible that the model generalizes less effectively to that subgroup, especially if their patterns differ in subtle ways (e.g., brain activity, behavior, or sensor alignment, depending on the task domain.</p>",
      "votes": -5,
      "replies": []
    },
    {
      "id": 3253098,
      "author_name": "hyoko19",
      "author_url": "",
      "post_date": "2025-07-24T02:52:38.850000",
      "content": "<p>How about trying mirror transformation as a preprocessing？<br>\nThe intent is to treat all data as if it were measured in same hand.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3255212,
          "author_name": "kalix,a  Kreator",
          "author_url": "",
          "post_date": "2025-07-28T07:39:49.790000",
          "content": "<p>it breaks physics features,the main thing is that  left-handed gesture patterns are not just mirrored right handed ones , they have different trajectories and contact points, so the mirror transformation could make cv worse as people have mentioned above ,fliping causing issues</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 3252714,
      "author_name": "Kurise",
      "author_url": "",
      "post_date": "2025-07-23T08:43:33.883000",
      "content": "<p>Have you tried to use two model to handle this two situation?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3252759,
          "author_name": "I2nfinit3y",
          "author_url": "",
          "post_date": "2025-07-23T11:08:45.507000",
          "content": "<p>Yes, but its performance is worse than using one model.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 3252237,
      "author_name": "那个男人",
      "author_url": "",
      "post_date": "2025-07-22T09:22:00.170000",
      "content": "<p>Have you tried to oversampling the left hand? Is it effective?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3252239,
          "author_name": "I2nfinit3y",
          "author_url": "",
          "post_date": "2025-07-22T09:26:48.837000",
          "content": "<p>I have tried oversampling and weighted loss, but there is no obvious boost.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 3254519,
      "author_name": "",
      "author_url": "",
      "post_date": "2025-07-26T16:57:58.923000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3252221": "The left handedness subjects in the training data are just about 10, so there is much score gap between left handedness subjects and right handedness subjects (about 0.08~0.1). \n\nOne of our model's cv is 0.8421, but score of left/right handedness subject is (left : 0.7622, right : 0.8665), so its lb is just 0.83.  Our another model's LB is 0.84 with cv of 0.8387, and its socre of left/right handedness subject is (left : 0.7850, right : 0.8598). \n\nI guess there may be more left handedness subjects than right handedness subjects in public leaderboard?",
    "3253171": "I'm really curious about it.\nI tried to flip acc_x, acc_y, rot_x, and rot_y, but the score decreased somehow.\nI wonder whether left-handed subjects really wear on the left hand.\n\nThis is the average of acc_x and acc_y. Red points -> right handed, Blue points -> left handed.\nFrom the point of this image, it seems the way to flip x, y works.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F25976934%2Fa4d1d425596e558338294c09ecd58853%2Fdownload.png?generation=1753338767672187&alt=media)\n\n\nI tried this code, but it didn't improve the score.\n```python\ndef convert_left_to_right_coordinates(df):\n\n    # Apply transformations\n    df['acc_x'] = -df['acc_x']  # Flip X acceleration\n    df['acc_y'] = -df['acc_y']  # Flip Y acceleration\n    # acc_z stays the same\n    \n    df['rot_x'] = -df['rot_x']  # Flip X rotation\n    df['rot_y'] = -df['rot_y']  # Flip Y rotation\n    # rot_z and rot_w stay the same\n\n    \n    return df\n```\n\n\nIf some method improve your score and share the method, I will really appreciate it.",
    "3252785": "That’s a really interesting observation—and it definitely raises a valid point about data imbalance and subgroup performance. With only ~10 left-handed subjects in the training set, it's quite possible that the model generalizes less effectively to that subgroup, especially if their patterns differ in subtle ways (e.g., brain activity, behavior, or sensor alignment, depending on the task domain.",
    "3253098": "How about trying mirror transformation as a preprocessing？\nThe intent is to treat all data as if it were measured in same hand.",
    "3252714": "Have you tried to use two model to handle this two situation?",
    "3252237": "Have you tried to oversampling the left hand? Is it effective?\n",
    "3254519": ""
  }
}