{
  "id": 586228,
  "title": "How is your CV score calculated",
  "url": "/competitions/cmi-detect-behavior-with-sensor-data/discussion/586228",
  "author_name": "",
  "post_date": "2025-06-25T15:14:08.884976400Z",
  "votes": 1,
  "comment_count": 10,
  "views": 0,
  "content": "<p>To correctly calculate the CV across 5-folds, should we use the final score for each fold and average them or use the best score for each fold and average?</p>",
  "messages": [
    {
      "id": "3232310",
      "postDate": "06/25/2025 15:14:08",
      "content": "<p>To correctly calculate the CV across 5-folds, should we use the final score for each fold and average them or use the best score for each fold and average?</p>",
      "rawMarkdown": "To correctly calculate the CV across 5-folds, should we use the final score for each fold and average them or use the best score for each fold and average?",
      "votes": null
    },
    {
      "id": "3232325",
      "postDate": "06/25/2025 15:21:27",
      "content": "<p>I usually monitor both, in this competition they are very similar anyway (due to multi classification problem). Example of mine: global oof score 0.75623 ( mean score 0.7564 +-0.0181).</p>",
      "rawMarkdown": "I usually monitor both, in this competition they are very similar anyway (due to multi classification problem). Example of mine: global oof score 0.75623 ( mean score 0.7564 +-0.0181).",
      "votes": null
    },
    {
      "id": "3232337",
      "postDate": "06/25/2025 15:35:12",
      "content": "<p><a href=\"https://www.kaggle.com/georgewang73\" target=\"_blank\">@georgewang73</a> The correct way is to generate OOF (Out Of Fold) predictions and then compute your score based on this dataframe. For example, you split your data into 5 folds, so you will have 5 validation sets. Every time your model's validation score improves you save the validation predictions. You end up with 5 validation predictions (1 for each validation set). You concatenate these 5 prediction dataframes, this gives you the OOF dataframe, which must contain the <code>y_true</code> and <code>y_pred</code> columns. Finally, you compute the score using this OOF.</p>",
      "rawMarkdown": "georgewang73 The correct way is to generate OOF (Out Of Fold) predictions and then compute your score based on this dataframe. For example, you split your data into 5 folds, so you will have 5 validation sets. Every time your model's validation score improves you save the validation predictions. You end up with 5 validation predictions (1 for each validation set). You concatenate these 5 prediction dataframes, this gives you the OOF dataframe, which must contain the `y_true` and `y_pred` columns. Finally, you compute the score using this OOF.",
      "votes": null
    },
    {
      "id": "3232370",
      "postDate": "06/25/2025 16:07:37",
      "content": "<p>Thank you so much! It is a really good advice for me. </p>",
      "rawMarkdown": "Thank you so much! It is a really good advice for me.",
      "votes": null
    },
    {
      "id": "3234222",
      "postDate": "06/27/2025 16:23:31",
      "content": "<p>A follow up question, are you doing the stratification on subject only? I recently did that, and my CV is 0.79, yet I submitted that to the LB, but it was only 0.69, I'm wondering what might caused this issue?</p>",
      "rawMarkdown": "A follow up question, are you doing the stratification on subject only? I recently did that, and my CV is 0.79, yet I submitted that to the LB, but it was only 0.69, I'm wondering what might caused this issue?",
      "votes": null
    },
    {
      "id": "3234245",
      "postDate": "06/27/2025 16:53:51",
      "content": "<p>Group on subject, stratify on gesture seems a reasonnable approach. Several possibilities are discussed <a href=\"https://www.kaggle.com/competitions/cmi-detect-behavior-with-sensor-data/discussion/583023\" target=\"_blank\">here</a>.</p>\n<p>Your CV LB gap seem too high, I would double check my inference pipeline on the train set and make sure that I have the exact same results as in local CV computation.</p>",
      "rawMarkdown": "Group on subject, stratify on gesture seems a reasonnable approach. Several possibilities are discussed [here](https://www.kaggle.com/competitions/cmi-detect-behavior-with-sensor-data/discussion/583023).\n\nYour CV LB gap seem too high, I would double check my inference pipeline on the train set and make sure that I have the exact same results as in local CV computation.",
      "votes": null
    },
    {
      "id": "3234255",
      "postDate": "06/27/2025 17:03:03",
      "content": "<p>Do you think it is possible that I am submitting just 1 fold's model without retraining the model with all the data?</p>",
      "rawMarkdown": "Do you think it is possible that I am submitting just 1 fold's model without retraining the model with all the data?",
      "votes": null
    },
    {
      "id": "3234388",
      "postDate": "06/27/2025 18:53:45",
      "content": "<p>Yes single fold gave me 0.74 for a CV of 0.756.</p>",
      "rawMarkdown": "Yes single fold gave me 0.74 for a CV of 0.756.",
      "votes": null
    },
    {
      "id": "3234407",
      "postDate": "06/27/2025 19:19:28",
      "content": "<p>I think it was my method's problem. In the beginning I thought the phase information would be useful since it could tell the model to distinguish between the transition and gesture phase, since the phase information is not provided in the test, I tried to train a model to detect the boundary when transition change to gesture. The performance of that boundary model was good when I am evaluating that in the validation, so I thought I could directly use that as the input in the final model. However, it seems that the boundary model might not be performing well on the test, leading to some false classification of phases. I then removed the phase as a feature, and the score between the CV and LB become almost identical.</p>",
      "rawMarkdown": "I think it was my method's problem. In the beginning I thought the phase information would be useful since it could tell the model to distinguish between the transition and gesture phase, since the phase information is not provided in the test, I tried to train a model to detect the boundary when transition change to gesture. The performance of that boundary model was good when I am evaluating that in the validation, so I thought I could directly use that as the input in the final model. However, it seems that the boundary model might not be performing well on the test, leading to some false classification of phases. I then removed the phase as a feature, and the score between the CV and LB become almost identical.",
      "votes": null
    },
    {
      "id": "3246088",
      "postDate": "07/10/2025 09:27:16",
      "content": "<p>We can see that the player in the bottom right corner still has a very serious expression.😐😐</p>",
      "rawMarkdown": "We can see that the player in the bottom right corner still has a very serious expression.😐😐",
      "votes": null
    },
    {
      "id": "3246869",
      "postDate": "07/11/2025 17:00:39",
      "content": "<p>真正想赢的人脸上是没有笑容的</p>",
      "rawMarkdown": "真正想赢的人脸上是没有笑容的",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3232325,
      "author_name": "optimo",
      "author_url": "",
      "post_date": "06/25/2025 15:21:27",
      "content": "<p>I usually monitor both, in this competition they are very similar anyway (due to multi classification problem). Example of mine: global oof score 0.75623 ( mean score 0.7564 +-0.0181).</p>",
      "votes": null,
      "replies": [
        {
          "id": 3234222,
          "author_name": "georgewang73",
          "author_url": "",
          "post_date": "06/27/2025 16:23:31",
          "content": "<p>A follow up question, are you doing the stratification on subject only? I recently did that, and my CV is 0.79, yet I submitted that to the LB, but it was only 0.69, I'm wondering what might caused this issue?</p>",
          "votes": null,
          "replies": [
            {
              "id": 3234245,
              "author_name": "optimo",
              "author_url": "",
              "post_date": "06/27/2025 16:53:51",
              "content": "<p>Group on subject, stratify on gesture seems a reasonnable approach. Several possibilities are discussed <a href=\"https://www.kaggle.com/competitions/cmi-detect-behavior-with-sensor-data/discussion/583023\" target=\"_blank\">here</a>.</p>\n<p>Your CV LB gap seem too high, I would double check my inference pipeline on the train set and make sure that I have the exact same results as in local CV computation.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 3234255,
                  "author_name": "georgewang73",
                  "author_url": "",
                  "post_date": "06/27/2025 17:03:03",
                  "content": "<p>Do you think it is possible that I am submitting just 1 fold's model without retraining the model with all the data?</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 3234388,
                      "author_name": "optimo",
                      "author_url": "",
                      "post_date": "06/27/2025 18:53:45",
                      "content": "<p>Yes single fold gave me 0.74 for a CV of 0.756.</p>",
                      "votes": null,
                      "replies": [
                        {
                          "id": 3234407,
                          "author_name": "georgewang73",
                          "author_url": "",
                          "post_date": "06/27/2025 19:19:28",
                          "content": "<p>I think it was my method's problem. In the beginning I thought the phase information would be useful since it could tell the model to distinguish between the transition and gesture phase, since the phase information is not provided in the test, I tried to train a model to detect the boundary when transition change to gesture. The performance of that boundary model was good when I am evaluating that in the validation, so I thought I could directly use that as the input in the final model. However, it seems that the boundary model might not be performing well on the test, leading to some false classification of phases. I then removed the phase as a feature, and the score between the CV and LB become almost identical.</p>",
                          "votes": null,
                          "replies": []
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 3232337,
      "author_name": "alejopaullier",
      "author_url": "",
      "post_date": "06/25/2025 15:35:12",
      "content": "<p><a href=\"https://www.kaggle.com/georgewang73\" target=\"_blank\">@georgewang73</a> The correct way is to generate OOF (Out Of Fold) predictions and then compute your score based on this dataframe. For example, you split your data into 5 folds, so you will have 5 validation sets. Every time your model's validation score improves you save the validation predictions. You end up with 5 validation predictions (1 for each validation set). You concatenate these 5 prediction dataframes, this gives you the OOF dataframe, which must contain the <code>y_true</code> and <code>y_pred</code> columns. Finally, you compute the score using this OOF.</p>",
      "votes": null,
      "replies": [
        {
          "id": 3232370,
          "author_name": "georgewang73",
          "author_url": "",
          "post_date": "06/25/2025 16:07:37",
          "content": "<p>Thank you so much! It is a really good advice for me. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3246088,
      "author_name": "yehongyi",
      "author_url": "",
      "post_date": "07/10/2025 09:27:16",
      "content": "<p>We can see that the player in the bottom right corner still has a very serious expression.😐😐</p>",
      "votes": null,
      "replies": [
        {
          "id": 3246869,
          "author_name": "georgewang73",
          "author_url": "",
          "post_date": "07/11/2025 17:00:39",
          "content": "<p>真正想赢的人脸上是没有笑容的</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3232310": "To correctly calculate the CV across 5-folds, should we use the final score for each fold and average them or use the best score for each fold and average?",
    "3232325": "I usually monitor both, in this competition they are very similar anyway (due to multi classification problem). Example of mine: global oof score 0.75623 ( mean score 0.7564 +-0.0181).",
    "3232337": "georgewang73 The correct way is to generate OOF (Out Of Fold) predictions and then compute your score based on this dataframe. For example, you split your data into 5 folds, so you will have 5 validation sets. Every time your model's validation score improves you save the validation predictions. You end up with 5 validation predictions (1 for each validation set). You concatenate these 5 prediction dataframes, this gives you the OOF dataframe, which must contain the `y_true` and `y_pred` columns. Finally, you compute the score using this OOF.",
    "3232370": "Thank you so much! It is a really good advice for me.",
    "3234222": "A follow up question, are you doing the stratification on subject only? I recently did that, and my CV is 0.79, yet I submitted that to the LB, but it was only 0.69, I'm wondering what might caused this issue?",
    "3234245": "Group on subject, stratify on gesture seems a reasonnable approach. Several possibilities are discussed [here](https://www.kaggle.com/competitions/cmi-detect-behavior-with-sensor-data/discussion/583023).\n\nYour CV LB gap seem too high, I would double check my inference pipeline on the train set and make sure that I have the exact same results as in local CV computation.",
    "3234255": "Do you think it is possible that I am submitting just 1 fold's model without retraining the model with all the data?",
    "3234388": "Yes single fold gave me 0.74 for a CV of 0.756.",
    "3234407": "I think it was my method's problem. In the beginning I thought the phase information would be useful since it could tell the model to distinguish between the transition and gesture phase, since the phase information is not provided in the test, I tried to train a model to detect the boundary when transition change to gesture. The performance of that boundary model was good when I am evaluating that in the validation, so I thought I could directly use that as the input in the final model. However, it seems that the boundary model might not be performing well on the test, leading to some false classification of phases. I then removed the phase as a feature, and the score between the CV and LB become almost identical.",
    "3246088": "We can see that the player in the bottom right corner still has a very serious expression.😐😐",
    "3246869": "真正想赢的人脸上是没有笑容的"
  },
  "source": "meta"
}