{
  "id": 615401,
  "title": "To prevent overfitting, you have to group by Sampling_Date",
  "url": "/competitions/csiro-biomass/discussion/615401",
  "author_name": "EISLab_hwlee",
  "post_date": "2025-11-10T12:26:24.688000",
  "votes": 132,
  "comment_count": 50,
  "views": 0,
  "content": "<p>[reference discussion] : <a href=\"https://www.kaggle.com/competitions/csiro-biomass/discussion/615003\" target=\"_blank\">https://www.kaggle.com/competitions/csiro-biomass/discussion/615003</a></p>\n<p>In the discussion, the competition host stated that while the train and test sets have the same <code>State</code> and <code>Species</code>, the <code>Sampling_Date</code> is not completely the same.\nTherefore, I conducted the experiment by grouping by <code>Sampling_Date</code> and stratifying by <code>State</code>.</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th>Model</th>\n<th>Stratified target</th>\n<th>group target</th>\n<th>CV</th>\n<th>LB</th>\n<th>(CV-LB)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>V1</td>\n<td>ConvNext Tiny</td>\n<td><code>State</code></td>\n<td>-</td>\n<td>0.7189</td>\n<td>0.60</td>\n<td>0.1189</td>\n</tr>\n<tr>\n<td>V2</td>\n<td>ConvNext Tiny</td>\n<td><code>State</code></td>\n<td><code>Sampling_Date</code></td>\n<td>0.5837</td>\n<td>0.55</td>\n<td>0.0337</td>\n</tr>\n<tr>\n<td>V3</td>\n<td>ConvNext Tiny</td>\n<td><code>State</code></td>\n<td><code>Sampling_Date</code></td>\n<td>0.5968</td>\n<td>0.57</td>\n<td>0.0268</td>\n</tr>\n</tbody>\n</table>",
  "messages": [
    {
      "id": 3314932,
      "postDate": "2025-11-10T12:26:24.687Z",
      "content": "<p>[reference discussion] : <a href=\"https://www.kaggle.com/competitions/csiro-biomass/discussion/615003\" target=\"_blank\">https://www.kaggle.com/competitions/csiro-biomass/discussion/615003</a></p>\n<p>In the discussion, the competition host stated that while the train and test sets have the same <code>State</code> and <code>Species</code>, the <code>Sampling_Date</code> is not completely the same.\nTherefore, I conducted the experiment by grouping by <code>Sampling_Date</code> and stratifying by <code>State</code>.</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th>Model</th>\n<th>Stratified target</th>\n<th>group target</th>\n<th>CV</th>\n<th>LB</th>\n<th>(CV-LB)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>V1</td>\n<td>ConvNext Tiny</td>\n<td><code>State</code></td>\n<td>-</td>\n<td>0.7189</td>\n<td>0.60</td>\n<td>0.1189</td>\n</tr>\n<tr>\n<td>V2</td>\n<td>ConvNext Tiny</td>\n<td><code>State</code></td>\n<td><code>Sampling_Date</code></td>\n<td>0.5837</td>\n<td>0.55</td>\n<td>0.0337</td>\n</tr>\n<tr>\n<td>V3</td>\n<td>ConvNext Tiny</td>\n<td><code>State</code></td>\n<td><code>Sampling_Date</code></td>\n<td>0.5968</td>\n<td>0.57</td>\n<td>0.0268</td>\n</tr>\n</tbody>\n</table>",
      "rawMarkdown": "[reference discussion] : https://www.kaggle.com/competitions/csiro-biomass/discussion/615003\n\nIn the discussion, the competition host stated that while the train and test sets have the same `State` and `Species`, the `Sampling_Date` is not completely the same.\nTherefore, I conducted the experiment by grouping by `Sampling_Date` and stratifying by `State`.\n\n|  | Model | Stratified target | group target | CV | LB | (CV-LB) |\n| --- | --- | --- | --- | --- | --- | --- |\n| V1 | ConvNext Tiny | `State` | - | 0.7189 | 0.60 | 0.1189 |\n| V2 | ConvNext Tiny | `State` | `Sampling_Date` | 0.5837 | 0.55 | 0.0337 |\n| V3 | ConvNext Tiny | `State` | `Sampling_Date` | 0.5968 | 0.57 | 0.0268 |\n",
      "votes": 132
    },
    {
      "id": 3347793,
      "postDate": "2025-11-25T12:13:52.683Z",
      "content": "<p>unfortunately using this split led to huge overfitting for me too. I changed to a stricter split (involved hardcoding samples into folds 😂) </p>\n<p>-&gt; CV 0.64 LB 0.68. CV 0.62 LB 0.65. So far its been consistent </p>",
      "rawMarkdown": "unfortunately using this split led to huge overfitting for me too. I changed to a stricter split (involved hardcoding samples into folds 😂) \n\n-> CV 0.64 LB 0.68. CV 0.62 LB 0.65. So far its been consistent ",
      "votes": 8,
      "replies": [
        {
          "id": 3347805,
          "postDate": "2025-11-25T12:24:50.807Z",
          "content": "<p>I tried using the splitting strategy mentioned above, but it actually gave me worse results compared to a standard split. It seems that at this stage of the competition, the data-splitting approach plays a major role in achieving stable performance.</p>\n<p>Right now, I’m using a simple train/validation split and getting around 0.77 CV / 0.63 LB. I also tested K-Fold, but the results were slightly lower and very similar on the LB. So for now, the normal split has been more reliable for me.</p>\n<p>By the way, did you notice the CV–LB gap change only because of the splitting strategy, or did you also modify something in the model or training setup?</p>",
          "rawMarkdown": "I tried using the splitting strategy mentioned above, but it actually gave me worse results compared to a standard split. It seems that at this stage of the competition, the data-splitting approach plays a major role in achieving stable performance.\n\nRight now, I’m using a simple train/validation split and getting around 0.77 CV / 0.63 LB. I also tested K-Fold, but the results were slightly lower and very similar on the LB. So for now, the normal split has been more reliable for me.\n\nBy the way, did you notice the CV–LB gap change only because of the splitting strategy, or did you also modify something in the model or training setup?",
          "votes": 1,
          "replies": [
            {
              "id": 3347993,
              "postDate": "2025-11-25T14:32:09.830Z",
              "content": "<p>Changing the data split alone affects the leaderboard score because each model ends up training on a different subset of an already small dataset. In my case, stratifying by state gives me a score of 0.61, but switching to the split mentioned above drops it to 0.56 with the exact same model.</p>",
              "rawMarkdown": "Changing the data split alone affects the leaderboard score because each model ends up training on a different subset of an already small dataset. In my case, stratifying by state gives me a score of 0.61, but switching to the split mentioned above drops it to 0.56 with the exact same model.",
              "votes": 5
            },
            {
              "id": 3348098,
              "postDate": "2025-11-25T15:47:23.443Z",
              "content": "<p>Hmm my team hasn't observed changing CV split alone can swing scores by that much.</p>",
              "rawMarkdown": "Hmm my team hasn't observed changing CV split alone can swing scores by that much.",
              "votes": 2
            },
            {
              "id": 3348170,
              "postDate": "2025-11-25T16:38:24.610Z",
              "content": "<p>too much overfitting in the training CV score though… 😓</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5256933%2F224a761faf0c3f0fec564e95d93b969e%2FScreenshot%202025-11-26%20at%2012.37.45AM.png?generation=1764088687508531&amp;alt=media\" alt=\"\"></p>",
              "rawMarkdown": "too much overfitting in the training CV score though... 😓\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5256933%2F224a761faf0c3f0fec564e95d93b969e%2FScreenshot%202025-11-26%20at%2012.37.45AM.png?generation=1764088687508531&alt=media)\n\n"
            },
            {
              "id": 3348367,
              "postDate": "2025-11-25T19:14:45.673Z",
              "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F10701376%2F8e022fb94ddf0a7005c2672cbb302a50%2F__results___0_1511.png?generation=1764098034722578&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F10701376%2F504c8605893d45c110668fb61c8265bc%2FScreenshot%202025-11-25%20201208.png?generation=1764098061188223&amp;alt=media\" alt=\"\"></p>\n<p>same here !</p>",
              "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F10701376%2F8e022fb94ddf0a7005c2672cbb302a50%2F__results___0_1511.png?generation=1764098034722578&alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F10701376%2F504c8605893d45c110668fb61c8265bc%2FScreenshot%202025-11-25%20201208.png?generation=1764098061188223&alt=media)\n\nsame here !"
            },
            {
              "id": 3349287,
              "postDate": "2025-11-26T15:28:45.813Z",
              "content": "<p>yup that has been the most worrying factor here , maybe folds should be conservative and with most variability . but some folding strategies do help on Public LB .</p>",
              "rawMarkdown": "yup that has been the most worrying factor here , maybe folds should be conservative and with most variability . but some folding strategies do help on Public LB .",
              "votes": 1
            },
            {
              "id": 3352438,
              "postDate": "2025-11-29T07:37:15.130Z",
              "content": "<p>Same here, my CV-LB is all over the place. I doubt that the public leaderboard has a greater representation from 1 state and a smaller representation from another state causing this problem. Also, the training data is very small and such datasets usually create such problems <a href=\"https://www.kaggle.com/nizarcharrada\" target=\"_blank\">@nizarcharrada</a> </p>",
              "rawMarkdown": "Same here, my CV-LB is all over the place. I doubt that the public leaderboard has a greater representation from 1 state and a smaller representation from another state causing this problem. Also, the training data is very small and such datasets usually create such problems @nizarcharrada ",
              "votes": 1
            },
            {
              "id": 3352444,
              "postDate": "2025-11-29T07:40:00.913Z",
              "content": "<p>This is another worry as the public and private LB may not be in sync causing an <a href=\"https://www.kaggle.com/competitions/icr-identify-age-related-conditions\" target=\"_blank\">ICR-like problem</a></p>",
              "rawMarkdown": "This is another worry as the public and private LB may not be in sync causing an [ICR-like problem](https://www.kaggle.com/competitions/icr-identify-age-related-conditions)"
            },
            {
              "id": 3352963,
              "postDate": "2025-11-29T13:53:47.480Z",
              "content": "<p>Your CV-LB gap is relatable, I am also having 3-4 submissions like this\nCV 0.75   LB 0.59\nCV 0.765 LB 0.60\nCV 0.77   LB 0.62</p>",
              "rawMarkdown": "Your CV-LB gap is relatable, I am also having 3-4 submissions like this\nCV 0.75   LB 0.59\nCV 0.765 LB 0.60\nCV 0.77   LB 0.62"
            }
          ]
        },
        {
          "id": 3348510,
          "postDate": "2025-11-26T00:55:42.427Z",
          "content": "<p>Just wondering if your CV is calculated using the global metric. I think some people use a metric that is not the same as the competition metric and end up with a CV that is close to their LB, which confused me.</p>\n<p>Also, may I ask if your CV is always below 0.70? No matter what split I try, my 5-fold average CV is always above 0.70.</p>",
          "rawMarkdown": "Just wondering if your CV is calculated using the global metric. I think some people use a metric that is not the same as the competition metric and end up with a CV that is close to their LB, which confused me.\n\nAlso, may I ask if your CV is always below 0.70? No matter what split I try, my 5-fold average CV is always above 0.70.",
          "votes": 1
        },
        {
          "id": 3352440,
          "postDate": "2025-11-29T07:38:48.867Z",
          "content": "<p>This is a good way to handle this problem, I think relying on seeds / scikit-learn for model selection is a sub-optimal process given the data-size and the overall fluctuation. \nMy train-loss curves are quite worrying as I am 100% sure I have a bad overfitting there <a href=\"https://www.kaggle.com/yeoyunsianggeremie\" target=\"_blank\">@yeoyunsianggeremie</a> </p>",
          "rawMarkdown": "This is a good way to handle this problem, I think relying on seeds / scikit-learn for model selection is a sub-optimal process given the data-size and the overall fluctuation. \nMy train-loss curves are quite worrying as I am 100% sure I have a bad overfitting there @yeoyunsianggeremie "
        },
        {
          "id": 3393430,
          "postDate": "2026-01-19T02:43:58.703Z",
          "rawMarkdown": "",
          "votes": -1,
          "isDeleted": true
        }
      ]
    },
    {
      "id": 3320361,
      "postDate": "2025-11-12T13:24:02.180Z",
      "content": "<p><strong>Monte Carlo Seed Search Strategy Results</strong><br>\n<em>State Stratified GroupKFold on Sampling Dates</em></p>\n<blockquote>\n  <p>Earlier, I tried this seed searching strategy but for GroupKFold on both State and Sampling_date because someone mentioned that there are unseen states in the test set. Later, in some other discussion, the competition host clarified that all states are present in the test set; hence indicating that only the sites/places might be unseen.</p>\n</blockquote>\n<p>Then I moved on to this strategy.</p>\n<p><strong>CV Fold Results</strong></p>\n<table>\n<thead>\n<tr>\n<th>Fold</th>\n<th>R² Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0</td>\n<td>0.6779</td>\n</tr>\n<tr>\n<td>1</td>\n<td>0.6387</td>\n</tr>\n<tr>\n<td>2</td>\n<td>0.6214</td>\n</tr>\n<tr>\n<td>3</td>\n<td>0.5963</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Mean R²:</strong> 0.6336<br>\n<strong>Std R²:</strong> 0.0297  </p>\n<p><strong>Leaderboard Score (LB):</strong> 0.63<br>\n<strong>Summary:</strong><br>\n<em>CV ≈ LB!</em></p>\n<p>But actually, I used #folds = 4 because that gave me slightly better stratification score (I made a simple metric to calculate the goodness of stratification on State) than the best split I got with %folds = 5. But I think this small difference in the Stratification score was relatively and I should have used %folds = 5 so as to get 5 models instead of 4. This increase in the number of models would have been better.  </p>",
      "rawMarkdown": "**Monte Carlo Seed Search Strategy Results**  \n*State Stratified GroupKFold on Sampling Dates*\n\n> Earlier, I tried this seed searching strategy but for GroupKFold on both State and Sampling_date because someone mentioned that there are unseen states in the test set. Later, in some other discussion, the competition host clarified that all states are present in the test set; hence indicating that only the sites/places might be unseen.\n\nThen I moved on to this strategy.\n\n**CV Fold Results**\n\n| Fold | R² Score |\n|---|---|\n| 0 | 0.6779 |\n| 1 | 0.6387 |\n| 2 | 0.6214 |\n| 3 | 0.5963 |\n\n\n**Mean R²:** 0.6336  \n**Std R²:** 0.0297  \n\n**Leaderboard Score (LB):** 0.63  \n**Summary:**  \n*CV ≈ LB!*\n\nBut actually, I used #folds = 4 because that gave me slightly better stratification score (I made a simple metric to calculate the goodness of stratification on State) than the best split I got with %folds = 5. But I think this small difference in the Stratification score was relatively and I should have used %folds = 5 so as to get 5 models instead of 4. This increase in the number of models would have been better.  ",
      "votes": 8,
      "replies": [
        {
          "id": 3338173,
          "postDate": "2025-11-18T22:51:09.427Z",
          "content": "<p>May I ask whether you used strong augmentation to keep the CV quite low, or if you selected a specific seed? I tried this split method, and my CV easily went above 0.70.</p>",
          "rawMarkdown": "May I ask whether you used strong augmentation to keep the CV quite low, or if you selected a specific seed? I tried this split method, and my CV easily went above 0.70.",
          "replies": [
            {
              "id": 3339254,
              "postDate": "2025-11-19T01:56:43.840Z",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/lizhecheng\" target=\"_blank\">@lizhecheng</a>. I have indeed done a Seed Search as specified. However, the seed I got is no lucky seed. I have tried using the 2nd best and 3rd best seed (according to my metric) and have got nearly identical results.</p>\n<p>I am not using any strong augmentations as they doesn't seem to give a good gain/compute ratio. Geometric transforms like Flipping, Rotation are already providing a good amount of additional data to work with, with a pinch of ColorJitter.</p>\n<p>Also, My CV and LB are still nearly identical at 0.68.</p>",
              "rawMarkdown": "Hi @lizhecheng. I have indeed done a Seed Search as specified. However, the seed I got is no lucky seed. I have tried using the 2nd best and 3rd best seed (according to my metric) and have got nearly identical results.\n\nI am not using any strong augmentations as they doesn't seem to give a good gain/compute ratio. Geometric transforms like Flipping, Rotation are already providing a good amount of additional data to work with, with a pinch of ColorJitter.\n\nAlso, My CV and LB are still nearly identical at 0.68.",
              "votes": 4
            },
            {
              "id": 3339523,
              "postDate": "2025-11-19T05:32:10.113Z",
              "content": "<p>Thanks for your detailed reply! You’ve come up with a great splitting method!</p>",
              "rawMarkdown": "Thanks for your detailed reply! You’ve come up with a great splitting method!"
            },
            {
              "id": 3340071,
              "postDate": "2025-11-19T11:39:31.340Z",
              "content": "<p>May I ask whether you’re calculating the globally weighted R² (the competition metric) or the weighted mean of the R² values?</p>",
              "rawMarkdown": "May I ask whether you’re calculating the globally weighted R² (the competition metric) or the weighted mean of the R² values?"
            },
            {
              "id": 3340105,
              "postDate": "2025-11-19T11:55:01.540Z",
              "content": "<p>I use both.</p>\n<ol>\n<li>For checkpointing I mainly use the competition metric.</li>\n<li>However, that metric is hard to interpret easily. So when I am comparing models, and even the tiniest changes in the architecture, I use the per target R2 scores to interpret and compare them better. </li>\n</ol>",
              "rawMarkdown": "I use both.\n1. For checkpointing I mainly use the competition metric.\n2. However, that metric is hard to interpret easily. So when I am comparing models, and even the tiniest changes in the architecture, I use the per target R2 scores to interpret and compare them better. "
            }
          ]
        }
      ]
    },
    {
      "id": 3347157,
      "postDate": "2025-11-25T02:01:16.503Z",
      "content": "<p>I tried this split and got an interesting result:</p>\n<p>CV: ~0.63\nLB: 0.73</p>\n<p>I think public LB is very deceptive.</p>",
      "rawMarkdown": "I tried this split and got an interesting result:\n\nCV: ~0.63\nLB: 0.73\n\nI think public LB is very deceptive.",
      "votes": 4,
      "replies": [
        {
          "id": 3347531,
          "postDate": "2025-11-25T08:18:23.080Z",
          "content": "<p>cv:0.82 , lb:0.66 . It makes me mad.Why it would like this.Is the reason of overfitting ?</p>",
          "rawMarkdown": "cv:0.82 , lb:0.66 . It makes me mad.Why it would like this.Is the reason of overfitting ?",
          "votes": 1,
          "replies": [
            {
              "id": 3347766,
              "postDate": "2025-11-25T11:53:16.913Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 3348105,
              "postDate": "2025-11-25T15:55:10.700Z",
              "content": "<p>At least for me, CV can't build a solid method to eval model's performance. For this model and this split method, as CV gets higher, its score goes down continuously on LB.</p>",
              "rawMarkdown": "At least for me, CV can't build a solid method to eval model's performance. For this model and this split method, as CV gets higher, its score goes down continuously on LB.",
              "votes": 2
            },
            {
              "id": 3352637,
              "postDate": "2025-11-29T10:20:07.047Z",
              "content": "<p>I have this feeling .I tried a lot of methods to find a sold eval.but it doesn't work.I decide to be based on the public test </p>",
              "rawMarkdown": "I have this feeling .I tried a lot of methods to find a sold eval.but it doesn't work.I decide to be based on the public test "
            },
            {
              "id": 3352958,
              "postDate": "2025-11-29T13:50:58.887Z",
              "content": "<p>Same for me, increased CV == reduced LB beyond a point <a href=\"https://www.kaggle.com/linkinpony\" target=\"_blank\">@linkinpony</a> </p>",
              "rawMarkdown": "Same for me, increased CV == reduced LB beyond a point @linkinpony ",
              "votes": 3
            },
            {
              "id": 3387488,
              "postDate": "2026-01-07T05:55:06.400Z",
              "content": "<blockquote>\n  <p>At least for me, CV can't build a solid method to eval model's performance. For this model and this split method, as CV gets higher, its score goes down continuously on LB.</p>\n</blockquote>\n<p>Same 😭</p>",
              "rawMarkdown": "> At least for me, CV can't build a solid method to eval model's performance. For this model and this split method, as CV gets higher, its score goes down continuously on LB.\n\nSame 😭"
            },
            {
              "id": 3387492,
              "postDate": "2026-01-07T06:07:00.397Z",
              "content": "<p>cv 0.67 lb 0.66</p>\n<p>cv 0.69 lb 0.67</p>\n<p>cv 0.73 lb 0.69</p>\n<p>cv 0.75 lb 0.70</p>\n<p>cv 0.76 lb 0.72</p>",
              "rawMarkdown": "cv 0.67 lb 0.66\n\ncv 0.69 lb 0.67\n\ncv 0.73 lb 0.69\n\ncv 0.75 lb 0.70\n\ncv 0.76 lb 0.72",
              "votes": 2
            }
          ]
        }
      ]
    },
    {
      "id": 3315438,
      "postDate": "2025-11-10T15:52:30.980Z",
      "content": "<p>I am seeing much better correlation with StratifiedKFold by <code>State and Sampling_Date (Month)</code> too - but not better than the split shared here. Thanks 👍</p>",
      "rawMarkdown": "I am seeing much better correlation with StratifiedKFold by `State and Sampling_Date (Month)` too - but not better than the split shared here. Thanks 👍",
      "votes": 1,
      "replies": [
        {
          "id": 3319921,
          "postDate": "2025-11-12T05:47:54.777Z",
          "content": "<p>StratifiedKFold? <a href=\"https://www.kaggle.com/yeoyunsianggeremie\" target=\"_blank\">@yeoyunsianggeremie</a> </p>",
          "rawMarkdown": "StratifiedKFold? @yeoyunsianggeremie ",
          "votes": -3
        }
      ]
    },
    {
      "id": 3315400,
      "postDate": "2025-11-10T15:32:38.583Z",
      "content": "<p>Thanks for the insight! </p>\n<p>I didn't do stratify. I only did group by <code>sampling_date</code></p>\n<p>CV 0.6369 - LB 0.61<br>\nCV 0.6932 - LB 0.59  </p>\n<p>I'll try stratify by <code>state</code> now. Will share the update here. I hope we will finally see some correlation</p>",
      "rawMarkdown": "Thanks for the insight! \n\nI didn't do stratify. I only did group by `sampling_date`\n\nCV 0.6369 - LB 0.61  \nCV 0.6932 - LB 0.59  \n\nI'll try stratify by `state` now. Will share the update here. I hope we will finally see some correlation\n\n",
      "votes": 2,
      "replies": [
        {
          "id": 3315531,
          "postDate": "2025-11-10T16:45:44.717Z",
          "content": "<p>I recommend setting <code>State</code> to Stratified target because the distribution of target is different for each <code>State</code>.</p>\n<p>(mean±std)</p>\n<table>\n<thead>\n<tr>\n<th>State</th>\n<th>Dry_Clover_g</th>\n<th>Dry_Dead_g</th>\n<th>Dry_Green_g</th>\n<th>Dry_Total_g</th>\n<th>GDM_g</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Tas</td>\n<td>6.24 ± 11.61</td>\n<td>15.23 ± 12.43</td>\n<td>15.33 ± 13.11</td>\n<td>36.80 ± 20.70</td>\n<td>21.57 ± 14.36</td>\n</tr>\n<tr>\n<td>NSW</td>\n<td>0.13 ± 1.17</td>\n<td>14.20 ± 15.63</td>\n<td>56.56 ± 31.23</td>\n<td>70.90 ± 35.58</td>\n<td>56.69 ± 31.26</td>\n</tr>\n<tr>\n<td>WA</td>\n<td>22.09 ± 20.21</td>\n<td>0.00 ± 0.00</td>\n<td>9.30 ± 18.79</td>\n<td>31.39 ± 19.62</td>\n<td>31.39 ± 19.62</td>\n</tr>\n<tr>\n<td>Vic</td>\n<td>7.11 ± 9.57</td>\n<td>10.11 ± 8.86</td>\n<td>25.45 ± 16.02</td>\n<td>42.67 ± 20.89</td>\n<td>32.56 ± 20.93</td>\n</tr>\n</tbody>\n</table>",
          "rawMarkdown": "I recommend setting `State` to Stratified target because the distribution of target is different for each `State`.\n\n(mean±std)\n| State| Dry_Clover_g | Dry_Dead_g | Dry_Green_g | Dry_Total_g | GDM_g |\n| --- | --- | --- | --- | --- | --- |\n| Tas | 6.24 ± 11.61 | 15.23 ± 12.43 | 15.33 ± 13.11 | 36.80 ± 20.70 | 21.57 ± 14.36 |\n| NSW | 0.13 ± 1.17 | 14.20 ± 15.63 | 56.56 ± 31.23 | 70.90 ± 35.58 | 56.69 ± 31.26 |\n| WA | 22.09 ± 20.21 | 0.00 ± 0.00 | 9.30 ± 18.79 | 31.39 ± 19.62 | 31.39 ± 19.62 |\n| Vic | 7.11 ± 9.57 | 10.11 ± 8.86 | 25.45 ± 16.02 | 42.67 ± 20.89 | 32.56 ± 20.93 |",
          "votes": 10
        }
      ]
    },
    {
      "id": 3319023,
      "postDate": "2025-11-11T14:21:24.683Z",
      "content": "<p>The best post in this competitions for now.😎</p>",
      "rawMarkdown": "The best post in this competitions for now.😎",
      "votes": -2
    },
    {
      "id": 3320050,
      "postDate": "2025-11-12T07:44:58.727Z",
      "content": "<p>The best in the competition </p>",
      "rawMarkdown": "The best in the competition ",
      "votes": -3
    },
    {
      "id": 3395391,
      "postDate": "2026-01-22T22:10:46.783Z",
      "content": "<p>use seed 29570</p>",
      "rawMarkdown": "use seed 29570",
      "replies": [
        {
          "id": 3395415,
          "postDate": "2026-01-22T23:43:51.597Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 3318255,
      "postDate": "2025-11-11T04:51:06.810Z",
      "content": "<p>Appreciate yours insight ! Can you share yours metric code you use ? I also use ConvnextTiny.</p>\n<p>My gap between CV and LB is very high: </p>\n<p>CV. 0.73334 - LB: 0.59 </p>",
      "rawMarkdown": "Appreciate yours insight ! Can you share yours metric code you use ? I also use ConvnextTiny.\n\nMy gap between CV and LB is very high: \n\nCV. 0.73334 - LB: 0.59 ",
      "replies": [
        {
          "id": 3318460,
          "postDate": "2025-11-11T07:17:32.613Z",
          "content": "<p>here!</p>\n<pre><code> ():\n    \n    pred_total = all_preds_3[]\n    pred_gdm = all_preds_3[]\n    pred_green = all_preds_3[]\n\n    \n    pred_clover = np.maximum(, pred_gdm - pred_green)\n    pred_dead = np.maximum(, pred_total - pred_gdm)\n\n    \n    y_pred = np.stack([\n        pred_green,\n        pred_dead,\n        pred_clover,\n        pred_gdm,\n        pred_total\n    ], axis=)  \n\n    y_true = all_targets_5  \n\n    weights = np.array([, , , , ])\n    r2_scores = []\n\n     i  ():\n        y_t = y_true[:, i]\n        y_p = y_pred[:, i]\n\n        ss_res = np.((y_t - y_p) ** )\n        ss_tot = np.((y_t - np.mean(y_t)) ** )\n        r2 =  - ss_res / ss_tot  ss_tot &gt;   \n\n        r2_scores.append(r2)\n\n    r2_scores = np.array(r2_scores)\n    weighted_r2 = np.(r2_scores * weights) / np.(weights)\n\n     weighted_r2\n</code></pre>",
          "rawMarkdown": "here!\n\n```python\ndef calculate_competition_score(all_preds_3, all_targets_5):\n    # 1. Reconstruct 5 predictions from 3 outputs\n    pred_total = all_preds_3['total']\n    pred_gdm = all_preds_3['gdm']\n    pred_green = all_preds_3['green']\n    \n    # Ensure no negative values\n    pred_clover = np.maximum(0, pred_gdm - pred_green)\n    pred_dead = np.maximum(0, pred_total - pred_gdm)\n    \n    # Stack 5 predictions (must match order of CFG.ALL_TARGET_COLS)\n    y_pred = np.stack([\n        pred_green,\n        pred_dead,\n        pred_clover,\n        pred_gdm,\n        pred_total\n    ], axis=1)  # Shape: [N, 5]\n    \n    y_true = all_targets_5  # Shape: [N, 5]\n\n    weights = np.array([0.1, 0.1, 0.1, 0.2, 0.5])\n    r2_scores = []\n\n    for i in range(5):\n        y_t = y_true[:, i]\n        y_p = y_pred[:, i]\n\n        ss_res = np.sum((y_t - y_p) ** 2)\n        ss_tot = np.sum((y_t - np.mean(y_t)) ** 2)\n        r2 = 1 - ss_res / ss_tot if ss_tot > 0 else 0.0\n\n        r2_scores.append(r2)\n\n    r2_scores = np.array(r2_scores)\n    weighted_r2 = np.sum(r2_scores * weights) / np.sum(weights)\n    \n    return weighted_r2\n```",
          "votes": 3,
          "replies": [
            {
              "id": 3319600,
              "postDate": "2025-11-11T22:41:25.217Z",
              "content": "<p>your metric calculates R² separately for each of the 5 targets then averages them, so its different from the competition metric.\nThe competition actual metric calculates a single global R² across all rows at once, with per-row weights.</p>\n<p>Interestingly, some people find the per-target approach gives better CV-LB correlation anyway, so it might still be useful for model selection! But just wanted to flag the difference.</p>",
              "rawMarkdown": "your metric calculates R² separately for each of the 5 targets then averages them, so its different from the competition metric.\nThe competition actual metric calculates a single global R² across all rows at once, with per-row weights.\n\nInterestingly, some people find the per-target approach gives better CV-LB correlation anyway, so it might still be useful for model selection! But just wanted to flag the difference.",
              "votes": 10
            }
          ]
        }
      ]
    },
    {
      "id": 3316903,
      "postDate": "2025-11-10T20:55:25.967Z",
      "content": "<p>Thanks for sharing these valuable insights! I just wonder if you mean <code>StratifiedGroupKFold</code>. I implement it based on your ideas using 5 folds and find that, in some folds, the ratio of train data to validation data is much larger than 5. I understand this makes sense because of many constraints in the split, just to confirm if my implementation is correct.</p>",
      "rawMarkdown": "Thanks for sharing these valuable insights! I just wonder if you mean ``StratifiedGroupKFold``. I implement it based on your ideas using 5 folds and find that, in some folds, the ratio of train data to validation data is much larger than 5. I understand this makes sense because of many constraints in the split, just to confirm if my implementation is correct.",
      "replies": [
        {
          "id": 3316927,
          "postDate": "2025-11-10T21:30:03.487Z",
          "content": "<p>I also encountered the same issue with <code>StratifiedGroupKFold</code>. So I changed the random seed until I obtained an appropriate ratio.</p>",
          "rawMarkdown": "I also encountered the same issue with `StratifiedGroupKFold`. So I changed the random seed until I obtained an appropriate ratio.",
          "votes": 1,
          "replies": [
            {
              "id": 3316934,
              "postDate": "2025-11-10T21:37:42.947Z",
              "content": "<p>Let the guessing game begin!</p>",
              "rawMarkdown": "Let the guessing game begin!",
              "votes": -2
            },
            {
              "id": 3316936,
              "postDate": "2025-11-10T21:39:07.920Z",
              "content": "<p>Thanks for your answer! Just wondering, do different seeds make a big difference between CV and LB?</p>",
              "rawMarkdown": "Thanks for your answer! Just wondering, do different seeds make a big difference between CV and LB?"
            },
            {
              "id": 3317960,
              "postDate": "2025-11-10T22:43:18.713Z",
              "content": "<p>I'm not really sure about that…</p>",
              "rawMarkdown": "I'm not really sure about that..."
            }
          ]
        }
      ]
    },
    {
      "id": 3315747,
      "postDate": "2025-11-10T18:43:40.400Z",
      "content": "<p>I try it but still get a huge gap between LB and CV?</p>",
      "rawMarkdown": "I try it but still get a huge gap between LB and CV?",
      "replies": [
        {
          "id": 3315752,
          "postDate": "2025-11-10T18:45:05.790Z",
          "content": "<p>This is not a silver bullet on its own but one of several required techniques that are needed to try and ensure that your model is being \"fair\" to itself during training. If your model overfits or cannot generalize for any other reason a change to fold is unlikely to fix everything.</p>",
          "rawMarkdown": "This is not a silver bullet on its own but one of several required techniques that are needed to try and ensure that your model is being \"fair\" to itself during training. If your model overfits or cannot generalize for any other reason a change to fold is unlikely to fix everything.",
          "votes": 2
        }
      ]
    },
    {
      "id": 3386544,
      "postDate": "2026-01-05T13:36:52.733Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 3320392,
      "postDate": "2025-11-12T13:54:28.173Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 3315615,
      "postDate": "2025-11-10T17:30:38.700Z",
      "content": "<p>Interesting, thanks for the share!</p>",
      "rawMarkdown": "Interesting, thanks for the share!",
      "votes": 1
    },
    {
      "id": 3357414,
      "postDate": "2025-12-01T08:50:36.720Z",
      "content": "<p>Thank you for sharing. I understand.</p>",
      "rawMarkdown": "Thank you for sharing. I understand."
    },
    {
      "id": 3315511,
      "postDate": "2025-11-10T16:36:18.250Z",
      "content": "<p>Thank you very much!</p>",
      "rawMarkdown": "Thank you very much!"
    }
  ],
  "comments": [
    {
      "id": 3347793,
      "author_name": "Geremie Yeo",
      "author_url": "",
      "post_date": "2025-11-25T12:13:52.683000",
      "content": "<p>unfortunately using this split led to huge overfitting for me too. I changed to a stricter split (involved hardcoding samples into folds 😂) </p>\n<p>-&gt; CV 0.64 LB 0.68. CV 0.62 LB 0.65. So far its been consistent </p>",
      "votes": 8,
      "replies": [
        {
          "id": 3347805,
          "author_name": "ZAID",
          "author_url": "",
          "post_date": "2025-11-25T12:24:50.807000",
          "content": "<p>I tried using the splitting strategy mentioned above, but it actually gave me worse results compared to a standard split. It seems that at this stage of the competition, the data-splitting approach plays a major role in achieving stable performance.</p>\n<p>Right now, I’m using a simple train/validation split and getting around 0.77 CV / 0.63 LB. I also tested K-Fold, but the results were slightly lower and very similar on the LB. So for now, the normal split has been more reliable for me.</p>\n<p>By the way, did you notice the CV–LB gap change only because of the splitting strategy, or did you also modify something in the model or training setup?</p>",
          "votes": 1,
          "replies": [
            {
              "id": 3347993,
              "author_name": "Nizar Charrada",
              "author_url": "",
              "post_date": "2025-11-25T14:32:09.830000",
              "content": "<p>Changing the data split alone affects the leaderboard score because each model ends up training on a different subset of an already small dataset. In my case, stratifying by state gives me a score of 0.61, but switching to the split mentioned above drops it to 0.56 with the exact same model.</p>",
              "votes": 5,
              "replies": []
            },
            {
              "id": 3348098,
              "author_name": "Geremie Yeo",
              "author_url": "",
              "post_date": "2025-11-25T15:47:23.443000",
              "content": "<p>Hmm my team hasn't observed changing CV split alone can swing scores by that much.</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 3348170,
              "author_name": "Geremie Yeo",
              "author_url": "",
              "post_date": "2025-11-25T16:38:24.610000",
              "content": "<p>too much overfitting in the training CV score though… 😓</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5256933%2F224a761faf0c3f0fec564e95d93b969e%2FScreenshot%202025-11-26%20at%2012.37.45AM.png?generation=1764088687508531&amp;alt=media\" alt=\"\"></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3348367,
              "author_name": "ZAID",
              "author_url": "",
              "post_date": "2025-11-25T19:14:45.673000",
              "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F10701376%2F8e022fb94ddf0a7005c2672cbb302a50%2F__results___0_1511.png?generation=1764098034722578&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F10701376%2F504c8605893d45c110668fb61c8265bc%2FScreenshot%202025-11-25%20201208.png?generation=1764098061188223&amp;alt=media\" alt=\"\"></p>\n<p>same here !</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3349287,
              "author_name": "Gaurav Rawat",
              "author_url": "",
              "post_date": "2025-11-26T15:28:45.813000",
              "content": "<p>yup that has been the most worrying factor here , maybe folds should be conservative and with most variability . but some folding strategies do help on Public LB .</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3352438,
              "author_name": "Ravi Ramakrishnan",
              "author_url": "",
              "post_date": "2025-11-29T07:37:15.130000",
              "content": "<p>Same here, my CV-LB is all over the place. I doubt that the public leaderboard has a greater representation from 1 state and a smaller representation from another state causing this problem. Also, the training data is very small and such datasets usually create such problems <a href=\"https://www.kaggle.com/nizarcharrada\" target=\"_blank\">@nizarcharrada</a> </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3352444,
              "author_name": "Ravi Ramakrishnan",
              "author_url": "",
              "post_date": "2025-11-29T07:40:00.913000",
              "content": "<p>This is another worry as the public and private LB may not be in sync causing an <a href=\"https://www.kaggle.com/competitions/icr-identify-age-related-conditions\" target=\"_blank\">ICR-like problem</a></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3352963,
              "author_name": "Ravi Ramakrishnan",
              "author_url": "",
              "post_date": "2025-11-29T13:53:47.480000",
              "content": "<p>Your CV-LB gap is relatable, I am also having 3-4 submissions like this\nCV 0.75   LB 0.59\nCV 0.765 LB 0.60\nCV 0.77   LB 0.62</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 3348510,
          "author_name": "Zhecheng Li",
          "author_url": "",
          "post_date": "2025-11-26T00:55:42.427000",
          "content": "<p>Just wondering if your CV is calculated using the global metric. I think some people use a metric that is not the same as the competition metric and end up with a CV that is close to their LB, which confused me.</p>\n<p>Also, may I ask if your CV is always below 0.70? No matter what split I try, my 5-fold average CV is always above 0.70.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 3352440,
          "author_name": "Ravi Ramakrishnan",
          "author_url": "",
          "post_date": "2025-11-29T07:38:48.867000",
          "content": "<p>This is a good way to handle this problem, I think relying on seeds / scikit-learn for model selection is a sub-optimal process given the data-size and the overall fluctuation. \nMy train-loss curves are quite worrying as I am 100% sure I have a bad overfitting there <a href=\"https://www.kaggle.com/yeoyunsianggeremie\" target=\"_blank\">@yeoyunsianggeremie</a> </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 3393430,
          "author_name": "",
          "author_url": "",
          "post_date": "2026-01-19T02:43:58.703000",
          "content": "",
          "votes": -1,
          "replies": []
        }
      ]
    },
    {
      "id": 3320361,
      "author_name": "Komil Parmar",
      "author_url": "",
      "post_date": "2025-11-12T13:24:02.180000",
      "content": "<p><strong>Monte Carlo Seed Search Strategy Results</strong><br>\n<em>State Stratified GroupKFold on Sampling Dates</em></p>\n<blockquote>\n  <p>Earlier, I tried this seed searching strategy but for GroupKFold on both State and Sampling_date because someone mentioned that there are unseen states in the test set. Later, in some other discussion, the competition host clarified that all states are present in the test set; hence indicating that only the sites/places might be unseen.</p>\n</blockquote>\n<p>Then I moved on to this strategy.</p>\n<p><strong>CV Fold Results</strong></p>\n<table>\n<thead>\n<tr>\n<th>Fold</th>\n<th>R² Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0</td>\n<td>0.6779</td>\n</tr>\n<tr>\n<td>1</td>\n<td>0.6387</td>\n</tr>\n<tr>\n<td>2</td>\n<td>0.6214</td>\n</tr>\n<tr>\n<td>3</td>\n<td>0.5963</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Mean R²:</strong> 0.6336<br>\n<strong>Std R²:</strong> 0.0297  </p>\n<p><strong>Leaderboard Score (LB):</strong> 0.63<br>\n<strong>Summary:</strong><br>\n<em>CV ≈ LB!</em></p>\n<p>But actually, I used #folds = 4 because that gave me slightly better stratification score (I made a simple metric to calculate the goodness of stratification on State) than the best split I got with %folds = 5. But I think this small difference in the Stratification score was relatively and I should have used %folds = 5 so as to get 5 models instead of 4. This increase in the number of models would have been better.  </p>",
      "votes": 8,
      "replies": [
        {
          "id": 3338173,
          "author_name": "Zhecheng Li",
          "author_url": "",
          "post_date": "2025-11-18T22:51:09.427000",
          "content": "<p>May I ask whether you used strong augmentation to keep the CV quite low, or if you selected a specific seed? I tried this split method, and my CV easily went above 0.70.</p>",
          "votes": 0,
          "replies": [
            {
              "id": 3339254,
              "author_name": "Komil Parmar",
              "author_url": "",
              "post_date": "2025-11-19T01:56:43.840000",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/lizhecheng\" target=\"_blank\">@lizhecheng</a>. I have indeed done a Seed Search as specified. However, the seed I got is no lucky seed. I have tried using the 2nd best and 3rd best seed (according to my metric) and have got nearly identical results.</p>\n<p>I am not using any strong augmentations as they doesn't seem to give a good gain/compute ratio. Geometric transforms like Flipping, Rotation are already providing a good amount of additional data to work with, with a pinch of ColorJitter.</p>\n<p>Also, My CV and LB are still nearly identical at 0.68.</p>",
              "votes": 4,
              "replies": []
            },
            {
              "id": 3339523,
              "author_name": "Zhecheng Li",
              "author_url": "",
              "post_date": "2025-11-19T05:32:10.113000",
              "content": "<p>Thanks for your detailed reply! You’ve come up with a great splitting method!</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3340071,
              "author_name": "Nizar Charrada",
              "author_url": "",
              "post_date": "2025-11-19T11:39:31.340000",
              "content": "<p>May I ask whether you’re calculating the globally weighted R² (the competition metric) or the weighted mean of the R² values?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3340105,
              "author_name": "Komil Parmar",
              "author_url": "",
              "post_date": "2025-11-19T11:55:01.540000",
              "content": "<p>I use both.</p>\n<ol>\n<li>For checkpointing I mainly use the competition metric.</li>\n<li>However, that metric is hard to interpret easily. So when I am comparing models, and even the tiniest changes in the architecture, I use the per target R2 scores to interpret and compare them better. </li>\n</ol>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3347157,
      "author_name": "Sayaka Miki",
      "author_url": "",
      "post_date": "2025-11-25T02:01:16.503000",
      "content": "<p>I tried this split and got an interesting result:</p>\n<p>CV: ~0.63\nLB: 0.73</p>\n<p>I think public LB is very deceptive.</p>",
      "votes": 4,
      "replies": [
        {
          "id": 3347531,
          "author_name": "",
          "author_url": "",
          "post_date": "2025-11-25T08:18:23.080000",
          "content": "<p>cv:0.82 , lb:0.66 . It makes me mad.Why it would like this.Is the reason of overfitting ?</p>",
          "votes": 1,
          "replies": [
            {
              "id": 3347766,
              "author_name": "",
              "author_url": "",
              "post_date": "2025-11-25T11:53:16.913000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3348105,
              "author_name": "Sayaka Miki",
              "author_url": "",
              "post_date": "2025-11-25T15:55:10.700000",
              "content": "<p>At least for me, CV can't build a solid method to eval model's performance. For this model and this split method, as CV gets higher, its score goes down continuously on LB.</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 3352637,
              "author_name": "",
              "author_url": "",
              "post_date": "2025-11-29T10:20:07.047000",
              "content": "<p>I have this feeling .I tried a lot of methods to find a sold eval.but it doesn't work.I decide to be based on the public test </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3352958,
              "author_name": "Ravi Ramakrishnan",
              "author_url": "",
              "post_date": "2025-11-29T13:50:58.887000",
              "content": "<p>Same for me, increased CV == reduced LB beyond a point <a href=\"https://www.kaggle.com/linkinpony\" target=\"_blank\">@linkinpony</a> </p>",
              "votes": 3,
              "replies": []
            },
            {
              "id": 3387488,
              "author_name": "Geremie Yeo",
              "author_url": "",
              "post_date": "2026-01-07T05:55:06.400000",
              "content": "<blockquote>\n  <p>At least for me, CV can't build a solid method to eval model's performance. For this model and this split method, as CV gets higher, its score goes down continuously on LB.</p>\n</blockquote>\n<p>Same 😭</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3387492,
              "author_name": "Mohamed Eltayeb",
              "author_url": "",
              "post_date": "2026-01-07T06:07:00.397000",
              "content": "<p>cv 0.67 lb 0.66</p>\n<p>cv 0.69 lb 0.67</p>\n<p>cv 0.73 lb 0.69</p>\n<p>cv 0.75 lb 0.70</p>\n<p>cv 0.76 lb 0.72</p>",
              "votes": 2,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3315438,
      "author_name": "Geremie Yeo",
      "author_url": "",
      "post_date": "2025-11-10T15:52:30.980000",
      "content": "<p>I am seeing much better correlation with StratifiedKFold by <code>State and Sampling_Date (Month)</code> too - but not better than the split shared here. Thanks 👍</p>",
      "votes": 1,
      "replies": [
        {
          "id": 3319921,
          "author_name": "Navneet",
          "author_url": "",
          "post_date": "2025-11-12T05:47:54.777000",
          "content": "<p>StratifiedKFold? <a href=\"https://www.kaggle.com/yeoyunsianggeremie\" target=\"_blank\">@yeoyunsianggeremie</a> </p>",
          "votes": -3,
          "replies": []
        }
      ]
    },
    {
      "id": 3315400,
      "author_name": "MD Mushfirat Mohaimin",
      "author_url": "",
      "post_date": "2025-11-10T15:32:38.583000",
      "content": "<p>Thanks for the insight! </p>\n<p>I didn't do stratify. I only did group by <code>sampling_date</code></p>\n<p>CV 0.6369 - LB 0.61<br>\nCV 0.6932 - LB 0.59  </p>\n<p>I'll try stratify by <code>state</code> now. Will share the update here. I hope we will finally see some correlation</p>",
      "votes": 2,
      "replies": [
        {
          "id": 3315531,
          "author_name": "EISLab_hwlee",
          "author_url": "",
          "post_date": "2025-11-10T16:45:44.717000",
          "content": "<p>I recommend setting <code>State</code> to Stratified target because the distribution of target is different for each <code>State</code>.</p>\n<p>(mean±std)</p>\n<table>\n<thead>\n<tr>\n<th>State</th>\n<th>Dry_Clover_g</th>\n<th>Dry_Dead_g</th>\n<th>Dry_Green_g</th>\n<th>Dry_Total_g</th>\n<th>GDM_g</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Tas</td>\n<td>6.24 ± 11.61</td>\n<td>15.23 ± 12.43</td>\n<td>15.33 ± 13.11</td>\n<td>36.80 ± 20.70</td>\n<td>21.57 ± 14.36</td>\n</tr>\n<tr>\n<td>NSW</td>\n<td>0.13 ± 1.17</td>\n<td>14.20 ± 15.63</td>\n<td>56.56 ± 31.23</td>\n<td>70.90 ± 35.58</td>\n<td>56.69 ± 31.26</td>\n</tr>\n<tr>\n<td>WA</td>\n<td>22.09 ± 20.21</td>\n<td>0.00 ± 0.00</td>\n<td>9.30 ± 18.79</td>\n<td>31.39 ± 19.62</td>\n<td>31.39 ± 19.62</td>\n</tr>\n<tr>\n<td>Vic</td>\n<td>7.11 ± 9.57</td>\n<td>10.11 ± 8.86</td>\n<td>25.45 ± 16.02</td>\n<td>42.67 ± 20.89</td>\n<td>32.56 ± 20.93</td>\n</tr>\n</tbody>\n</table>",
          "votes": 10,
          "replies": []
        }
      ]
    },
    {
      "id": 3319023,
      "author_name": "ForcewithMe",
      "author_url": "",
      "post_date": "2025-11-11T14:21:24.683000",
      "content": "<p>The best post in this competitions for now.😎</p>",
      "votes": -2,
      "replies": []
    },
    {
      "id": 3320050,
      "author_name": "Shanks_777",
      "author_url": "",
      "post_date": "2025-11-12T07:44:58.727000",
      "content": "<p>The best in the competition </p>",
      "votes": -3,
      "replies": []
    },
    {
      "id": 3395391,
      "author_name": "Ali Ozan Memetoglu",
      "author_url": "",
      "post_date": "2026-01-22T22:10:46.783000",
      "content": "<p>use seed 29570</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3395415,
          "author_name": "",
          "author_url": "",
          "post_date": "2026-01-22T23:43:51.597000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 3318255,
      "author_name": "Long Nguyễn Hoàng",
      "author_url": "",
      "post_date": "2025-11-11T04:51:06.810000",
      "content": "<p>Appreciate yours insight ! Can you share yours metric code you use ? I also use ConvnextTiny.</p>\n<p>My gap between CV and LB is very high: </p>\n<p>CV. 0.73334 - LB: 0.59 </p>",
      "votes": 0,
      "replies": [
        {
          "id": 3318460,
          "author_name": "EISLab_hwlee",
          "author_url": "",
          "post_date": "2025-11-11T07:17:32.613000",
          "content": "<p>here!</p>\n<pre><code> ():\n    \n    pred_total = all_preds_3[]\n    pred_gdm = all_preds_3[]\n    pred_green = all_preds_3[]\n\n    \n    pred_clover = np.maximum(, pred_gdm - pred_green)\n    pred_dead = np.maximum(, pred_total - pred_gdm)\n\n    \n    y_pred = np.stack([\n        pred_green,\n        pred_dead,\n        pred_clover,\n        pred_gdm,\n        pred_total\n    ], axis=)  \n\n    y_true = all_targets_5  \n\n    weights = np.array([, , , , ])\n    r2_scores = []\n\n     i  ():\n        y_t = y_true[:, i]\n        y_p = y_pred[:, i]\n\n        ss_res = np.((y_t - y_p) ** )\n        ss_tot = np.((y_t - np.mean(y_t)) ** )\n        r2 =  - ss_res / ss_tot  ss_tot &gt;   \n\n        r2_scores.append(r2)\n\n    r2_scores = np.array(r2_scores)\n    weighted_r2 = np.(r2_scores * weights) / np.(weights)\n\n     weighted_r2\n</code></pre>",
          "votes": 3,
          "replies": [
            {
              "id": 3319600,
              "author_name": "Nizar Charrada",
              "author_url": "",
              "post_date": "2025-11-11T22:41:25.217000",
              "content": "<p>your metric calculates R² separately for each of the 5 targets then averages them, so its different from the competition metric.\nThe competition actual metric calculates a single global R² across all rows at once, with per-row weights.</p>\n<p>Interestingly, some people find the per-target approach gives better CV-LB correlation anyway, so it might still be useful for model selection! But just wanted to flag the difference.</p>",
              "votes": 10,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3316903,
      "author_name": "Zhecheng Li",
      "author_url": "",
      "post_date": "2025-11-10T20:55:25.967000",
      "content": "<p>Thanks for sharing these valuable insights! I just wonder if you mean <code>StratifiedGroupKFold</code>. I implement it based on your ideas using 5 folds and find that, in some folds, the ratio of train data to validation data is much larger than 5. I understand this makes sense because of many constraints in the split, just to confirm if my implementation is correct.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3316927,
          "author_name": "EISLab_hwlee",
          "author_url": "",
          "post_date": "2025-11-10T21:30:03.487000",
          "content": "<p>I also encountered the same issue with <code>StratifiedGroupKFold</code>. So I changed the random seed until I obtained an appropriate ratio.</p>",
          "votes": 1,
          "replies": [
            {
              "id": 3316934,
              "author_name": "Tim Krige",
              "author_url": "",
              "post_date": "2025-11-10T21:37:42.947000",
              "content": "<p>Let the guessing game begin!</p>",
              "votes": -2,
              "replies": []
            },
            {
              "id": 3316936,
              "author_name": "Zhecheng Li",
              "author_url": "",
              "post_date": "2025-11-10T21:39:07.920000",
              "content": "<p>Thanks for your answer! Just wondering, do different seeds make a big difference between CV and LB?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3317960,
              "author_name": "EISLab_hwlee",
              "author_url": "",
              "post_date": "2025-11-10T22:43:18.713000",
              "content": "<p>I'm not really sure about that…</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3315747,
      "author_name": "Forrest_xlz",
      "author_url": "",
      "post_date": "2025-11-10T18:43:40.400000",
      "content": "<p>I try it but still get a huge gap between LB and CV?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3315752,
          "author_name": "Tim Krige",
          "author_url": "",
          "post_date": "2025-11-10T18:45:05.790000",
          "content": "<p>This is not a silver bullet on its own but one of several required techniques that are needed to try and ensure that your model is being \"fair\" to itself during training. If your model overfits or cannot generalize for any other reason a change to fold is unlikely to fix everything.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 3386544,
      "author_name": "",
      "author_url": "",
      "post_date": "2026-01-05T13:36:52.733000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3320392,
      "author_name": "",
      "author_url": "",
      "post_date": "2025-11-12T13:54:28.173000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3315615,
      "author_name": "evnsnclr",
      "author_url": "",
      "post_date": "2025-11-10T17:30:38.700000",
      "content": "<p>Interesting, thanks for the share!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 3357414,
      "author_name": "Kango",
      "author_url": "",
      "post_date": "2025-12-01T08:50:36.720000",
      "content": "<p>Thank you for sharing. I understand.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3315511,
      "author_name": "Forrest_xlz",
      "author_url": "",
      "post_date": "2025-11-10T16:36:18.250000",
      "content": "<p>Thank you very much!</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3314932": "[reference discussion] : https://www.kaggle.com/competitions/csiro-biomass/discussion/615003\n\nIn the discussion, the competition host stated that while the train and test sets have the same `State` and `Species`, the `Sampling_Date` is not completely the same.\nTherefore, I conducted the experiment by grouping by `Sampling_Date` and stratifying by `State`.\n\n|  | Model | Stratified target | group target | CV | LB | (CV-LB) |\n| --- | --- | --- | --- | --- | --- | --- |\n| V1 | ConvNext Tiny | `State` | - | 0.7189 | 0.60 | 0.1189 |\n| V2 | ConvNext Tiny | `State` | `Sampling_Date` | 0.5837 | 0.55 | 0.0337 |\n| V3 | ConvNext Tiny | `State` | `Sampling_Date` | 0.5968 | 0.57 | 0.0268 |\n",
    "3347793": "unfortunately using this split led to huge overfitting for me too. I changed to a stricter split (involved hardcoding samples into folds 😂) \n\n-> CV 0.64 LB 0.68. CV 0.62 LB 0.65. So far its been consistent ",
    "3320361": "**Monte Carlo Seed Search Strategy Results**  \n*State Stratified GroupKFold on Sampling Dates*\n\n> Earlier, I tried this seed searching strategy but for GroupKFold on both State and Sampling_date because someone mentioned that there are unseen states in the test set. Later, in some other discussion, the competition host clarified that all states are present in the test set; hence indicating that only the sites/places might be unseen.\n\nThen I moved on to this strategy.\n\n**CV Fold Results**\n\n| Fold | R² Score |\n|---|---|\n| 0 | 0.6779 |\n| 1 | 0.6387 |\n| 2 | 0.6214 |\n| 3 | 0.5963 |\n\n\n**Mean R²:** 0.6336  \n**Std R²:** 0.0297  \n\n**Leaderboard Score (LB):** 0.63  \n**Summary:**  \n*CV ≈ LB!*\n\nBut actually, I used #folds = 4 because that gave me slightly better stratification score (I made a simple metric to calculate the goodness of stratification on State) than the best split I got with %folds = 5. But I think this small difference in the Stratification score was relatively and I should have used %folds = 5 so as to get 5 models instead of 4. This increase in the number of models would have been better.  ",
    "3347157": "I tried this split and got an interesting result:\n\nCV: ~0.63\nLB: 0.73\n\nI think public LB is very deceptive.",
    "3315438": "I am seeing much better correlation with StratifiedKFold by `State and Sampling_Date (Month)` too - but not better than the split shared here. Thanks 👍",
    "3315400": "Thanks for the insight! \n\nI didn't do stratify. I only did group by `sampling_date`\n\nCV 0.6369 - LB 0.61  \nCV 0.6932 - LB 0.59  \n\nI'll try stratify by `state` now. Will share the update here. I hope we will finally see some correlation\n\n",
    "3319023": "The best post in this competitions for now.😎",
    "3320050": "The best in the competition ",
    "3395391": "use seed 29570",
    "3318255": "Appreciate yours insight ! Can you share yours metric code you use ? I also use ConvnextTiny.\n\nMy gap between CV and LB is very high: \n\nCV. 0.73334 - LB: 0.59 ",
    "3316903": "Thanks for sharing these valuable insights! I just wonder if you mean ``StratifiedGroupKFold``. I implement it based on your ideas using 5 folds and find that, in some folds, the ratio of train data to validation data is much larger than 5. I understand this makes sense because of many constraints in the split, just to confirm if my implementation is correct.",
    "3315747": "I try it but still get a huge gap between LB and CV?",
    "3386544": "",
    "3320392": "",
    "3315615": "Interesting, thanks for the share!",
    "3357414": "Thank you for sharing. I understand.",
    "3315511": "Thank you very much!"
  }
}