{
  "id": 127332,
  "title": "10th place Solution",
  "content": "<p>First, thanks kaggle team for a exciting competition, and congratulations to all winning teams and good result teams.\nI joined this competition solely, so it was hard but very interesting competition.</p>\n\n<p>1 year ago, I have experienced very big shake down(2th =&gt; about 1500th) at Microsoft Malware Competition.\n<a href=\"https://www.kaggle.com/c/microsoft-malware-prediction/discussion/83950\">https://www.kaggle.com/c/microsoft-malware-prediction/discussion/83950</a></p>\n\n<p>From this experience, I made effort to validation strategy and public/private analysis.\nAs a result I got my first Gold Medal by shake up.</p>\n\n<p>Here is my solution. (I am sorry for my poor English.)</p>\n\n<h2>Results</h2>\n\n<p>10th(solo Gold) / 3523</p>\n\n<h2>Model</h2>\n\n<ul>\n<li>LightGBM x 6 average\n<ul><li>CV seed snd some hyper parameters is changed per model</li>\n<li>After averaging regression value, transform to integer accuracy_group by threshold.</li></ul></li>\n</ul>\n\n<h2>Validation</h2>\n\n<ul>\n<li>Stratified Group KFold 10fold</li>\n<li>All Validation score is calculated by truncated validation.\n<ul><li>random sample assessment each installation_id</li></ul></li>\n<li>Each fold, I use 51 truncated validation set.\n<ul><li>1 set is used for early stopping</li>\n<li>50 set is used for validation score by averaging qwk.</li></ul></li>\n</ul>\n\n<h2>Public vs Private</h2>\n\n<p>I think public dataset is not good distribution for validation because there are only 1000 records.\nI calculated by 1000 times the average of train oof prediction which is truncated and randomly sampling 1000 rows.\nThe histgram is as follows.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1305588%2F03a952505303120659eb4ec830ad0ab0%2Ftruncated_oof_prediction_average.png?generation=1579774962577581&amp;alt=media\" alt=\"\"></p>\n\n<p>From this histgram, It seems that the public dataset is rare case.</p>\n\n<p>Therefore I trust CV (ignore LB) and use threshold of CV best (explain detail in next).</p>\n\n<h2>QWK threshold</h2>\n\n<p>Finaly I used constant threshold [1.04, 1.76, 2.18].\nThis threshold is calculated by OptimizedRounder's threshold average in 500 truncated oof validation.</p>\n\n<p>I tryed many methods, but I believed maximum threshold in local CV prediction is most reliable.</p>\n\n<p>Some public kernels decided threshold by target distribution.\nIn my experiment, the method is good for public LB than other methods, but I think this method is overfitting to Public LB because the distribution is not equal to the truncated target distribution and not best distribution for QWK.</p>\n\n<h2>Feature</h2>\n\n<p>I made 3000~5000 features overall, but I think there are no magic features.\n(Finaly I used about 300 features.)</p>\n\n<p>Good features for me is as follows.</p>\n\n<ul>\n<li>Normalized Accuracy feature\n<ul><li>I normalized accuracy features because the difficulty of assessments and games are different per title.</li>\n<li>(Accuracy - Accuracy_mean_per_title) / Feature_std_per_title</li>\n<li>accuracy features means accuracy_group, n_true_attempts/all_attempts, correct/event_num and corret/(correct+false) etc...</li></ul></li>\n<li>Feature per title\n<ul><li>I make feature per title because the difference of level in a game is difficult to find common columns in event data.</li>\n<li>Ex : target_distances length in Air Show</li>\n<li>However it spends a lot of time, so I make only abount 10 titles(game, assessment) and gave up...</li></ul></li>\n<li>Relative feature\n<ul><li>Ex: event_code: 4020_count / 4070_count, last_accuracy / all_accuracy_mean</li></ul></li>\n</ul>\n\n<h2>Feature Selection</h2>\n\n<p>To evaluate features effect in truncated validation, I use LGB feature importance by truncated training data.\nIn each fold, I make 50 truncated datasets, and change dataset per 5 iteration by using lightgbm init_model params.</p>\n\n<p>I use top 300 features (the number is feeling).</p>\n\n<h2>Others</h2>\n\n<ul>\n<li>LightGBM parameter feature fraction =&gt; 1.0\n<ul><li>Feature fraction change (0.8 =&gt; 1.0) make improvement my CV about 0.005</li>\n<li>I think that the model should use assessment_title for every tree because the title has big effect on the target value, and the role of other features is change by the title feature.\n(It is hypothesis. I don't know it is correct)</li></ul></li>\n<li>model per game session\n<ul><li>Ubove Transformer model, I make lightgbm model per game session (predict next assessment result).</li>\n<li>The model is not used for the main model, but it is useful for find good feature in game eventdata speedy.</li></ul></li>\n<li>Use test dataset for training\n<ul><li>I don't know it made improvement.</li></ul></li>\n</ul>\n\n<h2>Not Work</h2>\n\n<ul>\n<li>NN regressor (MLP)\n<ul><li>Though NN sometimes has good score, but not stable.</li>\n<li>I have no time to tuning.</li></ul></li>\n<li>NN EventCode Transformer\n<ul><li>I regard one session as one sentence, and event codes as words.</li>\n<li>Prediction next assessment per session, and use it as feature</li>\n<li>A little improvement but consuming long time, so I do not use it.</li></ul></li>\n<li>Word2Vec Feature\n<ul><li>Similar to Transformer, I regard one session as one sentense.</li>\n<li>No improvement.</li></ul></li>\n<li>Predicting normalized accuracy group\n<ul><li>No improvement.</li></ul></li>\n<li>Training redidual error per title\n<ul><li>No improvement</li></ul></li>\n</ul>",
  "comments": [
    {
      "id": 733273,
      "author_name": "corochann",
      "author_url": "",
      "post_date": "2020-01-30T23:05:20.830000",
      "content": "<p>Congrats for your first solo gold and thank you for sharing 🎉 </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 727287,
      "author_name": "Massoud Hosseinali",
      "author_url": "",
      "post_date": "2020-01-23T15:56:01.230000",
      "content": "<p>Congrats Pao.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 727110,
      "author_name": "IGreen",
      "author_url": "",
      "post_date": "2020-01-23T13:17:58.833000",
      "content": "<p>Congratulations! Thank you so much for sharing your solutions.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 727082,
      "author_name": "zakopuro",
      "author_url": "",
      "post_date": "2020-01-23T12:54:37.430000",
      "content": "<p>Congratulations!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 726971,
      "author_name": "Ailurophile",
      "author_url": "",
      "post_date": "2020-01-23T10:46:32.770000",
      "content": "<p>Congratulations\nGreat Write-Up\nThanks for Sharing your Approach &amp; Insights!! <a href=\"/go5kuramubon\">@go5kuramubon</a> </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 726959,
      "author_name": "Hanjoon Choe",
      "author_url": "",
      "post_date": "2020-01-23T10:39:58.897000",
      "content": "<p>Congratulations!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 726955,
      "author_name": "davidlee0314",
      "author_url": "",
      "post_date": "2020-01-23T10:36:46.767000",
      "content": "<p>Congratulations! Your features seem well preprocessed</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 726952,
      "author_name": "T.Ito",
      "author_url": "",
      "post_date": "2020-01-23T10:35:08.367000",
      "content": "<p>Congratulations and thanks for sharing your solution!!!!!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 727862,
      "author_name": "umut",
      "author_url": "",
      "post_date": "2020-01-24T06:07:32.203000",
      "content": "<p>One more question on the topic of weights in xgboost. I added the completed assessments in test.csv to the training data and thinking that those are better data than train (because they are same IDs as the users for which we need to predict, I put a larger weight for them, I tried putting weight=1 for train.csv rows and weight=3 for test.csv rows but my score decreased. Can anyone comment why? Is there an obvious flaw with this line of thinking? Maybe 3 was too hight, would it have made sense to try some smaller numbers like 1.5?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 729991,
          "author_name": "pao",
          "author_url": "",
          "post_date": "2020-01-27T00:19:06.387000",
          "content": "<p>I don't know the best weigh but I think we should keep the test weight lower because the count of assessment in test data for train is lower than test for LB.\nIt makes the training data distribution different from test for LB though increasing train\ndata is good for model accuracy.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 727860,
      "author_name": "umut",
      "author_url": "",
      "post_date": "2020-01-24T06:02:39.207000",
      "content": "<p>I did a similar test as you did in Public vs. Private. My conclusion was different, I thought that the IDs in test.csv are more successful so  I did this: I computed probability of getting a 3 in Cauldron Filler in train data and in test data, then I took the ratios. Let's say ratio is 1.2, that means the IDs in test.csv were x1.2 better so I put that as the weight column (xgboost allows for a weight parameter) for all rows in train where title==Cauldron Filler and accuracy_group==3. I did this for all accuracy groups. So even if test IDs are more or less successful compared to train, this way I thought the train set would be calibrated somewhat to the testing data. This increased my CV somewhat but my score was already so low that I wasn't really paying too much attention to small bumps in my score so I am not sure.\nCan you  or anyone else chime in on this. Is this a logical thing to try? And is it correct use of xgboost weight parameter?\nThanks</p>",
      "votes": 0,
      "replies": [
        {
          "id": 729990,
          "author_name": "pao",
          "author_url": "",
          "post_date": "2020-01-27T00:10:37.390000",
          "content": "<p>I think this method makes overfitting because we cannot know the distribution of private test.\nMoreover I think the difficulty of assessment is same between train and test.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 727854,
      "author_name": "umut",
      "author_url": "",
      "post_date": "2020-01-24T05:49:11.793000",
      "content": "<p>Hello, thank you for the write up, beginner questions here. I am trying to understand how you did validation and what is truncated CV in general.\n1)What is the data that you do the GroupKFold on? Is it on all the rows where  accuracy_group exists, or the entire 11.3 million rows of train.csv ? \nI checked there are 3614 installation_ids with at least 1 assessment done. So I think you get 361 ids per group\n2)then why do you split it to 51 folds? Why not ask for 510 folds (or 501) in the first place?\n3) for each fold, since 1 set is just early stopping, does that mean you run cv on the other 50 sets which means the model is trained with 49 sets, and error is computed on the 1 remaining set, and all 50 errors are averaged?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 729985,
          "author_name": "pao",
          "author_url": "",
          "post_date": "2020-01-27T00:01:42.460000",
          "content": "<p>Sorry for late.</p>\n\n<blockquote>\n  <p>1\n  Group on installation_id.</p>\n  \n  <p>2\n  I don't use 51 fold. Only 10fold.\n  From the one validation set in 10 fold, I make 51 sets by selecting  assessment randomly per installation_id.</p>\n  \n  <p>3\n  I use only 10 fold.\n  Per 1 fold, 1 set for early stopping and 50 set for validation score.</p>\n</blockquote>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 727267,
      "author_name": "samshipengs",
      "author_url": "",
      "post_date": "2020-01-23T15:33:15.877000",
      "content": "<p>thanks for sharing and congrats! \n&gt; In each fold, I make 50 truncated datasets, and change dataset per 5 iteration by using lightgbm init_model params.</p>\n\n<p>this is pretty interesting and its my first time seen this kind of approach. Have you compared this with just train one lgb on the combination of these 50 truncated datasets? Is there a good motivation for doing this 5 iteration training each time with different truncated datasets? It sort makes sense to me in neural nets (i.e. random sampling of shuffled training data in batch training), where the nn weights carries information, but its hard to imagine how it works for lgb, where the training is made based on splits. Does it keep building leafs or it could replace the spliting criteria from <code>init_model</code> completely? (EDIT: now i think about, it seems like it just keeps building base trees but with new data)</p>\n\n<p>Did you still apply early stopping during training, or the training is done when all the 50x5 iteration is finished?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 728604,
          "author_name": "pao",
          "author_url": "",
          "post_date": "2020-01-25T00:38:39.680000",
          "content": "<p>Thanks for a good question.</p>\n\n<p>&gt; Have you compared this with just train one lgb on the combination of these 50 truncated datasets? Is there a good motivation for doing this 5 iteration training each time with different truncated datasets?</p>\n\n<p>I compared the two model. In fact, the validation score is almost same, and 50 truncated model takes more time to learning. \nHowever my motivation of truncated model is to evaluate feature importance correctly.\nThe distribution of all data is different from that of truncated data.\nIt means that the feature importance of training with all data is a little different from the feature importance which we want to check.</p>\n\n<p>&gt; Does it keep building leafs or it could replace the spliting criteria from init_model completely?</p>\n\n<p>In lgb, a decision tree is added to the model by each iteration, and if use init_model, the added trees keeps and add new tree to the init_model trees.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 730053,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-01-27T03:17:13.940000",
      "content": "",
      "votes": 3,
      "replies": []
    },
    {
      "id": 727500,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-01-23T18:47:59.927000",
      "content": "<p>Congratulations Thanks for sharing !</p>",
      "votes": 6,
      "replies": []
    }
  ],
  "comment_count": 18,
  "messages": [
    {
      "id": 726942,
      "postDate": "2020-01-23T10:25:16.653Z",
      "content": "<p>First, thanks kaggle team for a exciting competition, and congratulations to all winning teams and good result teams.\nI joined this competition solely, so it was hard but very interesting competition.</p>\n\n<p>1 year ago, I have experienced very big shake down(2th =&gt; about 1500th) at Microsoft Malware Competition.\n<a href=\"https://www.kaggle.com/c/microsoft-malware-prediction/discussion/83950\">https://www.kaggle.com/c/microsoft-malware-prediction/discussion/83950</a></p>\n\n<p>From this experience, I made effort to validation strategy and public/private analysis.\nAs a result I got my first Gold Medal by shake up.</p>\n\n<p>Here is my solution. (I am sorry for my poor English.)</p>\n\n<h2>Results</h2>\n\n<p>10th(solo Gold) / 3523</p>\n\n<h2>Model</h2>\n\n<ul>\n<li>LightGBM x 6 average\n<ul><li>CV seed snd some hyper parameters is changed per model</li>\n<li>After averaging regression value, transform to integer accuracy_group by threshold.</li></ul></li>\n</ul>\n\n<h2>Validation</h2>\n\n<ul>\n<li>Stratified Group KFold 10fold</li>\n<li>All Validation score is calculated by truncated validation.\n<ul><li>random sample assessment each installation_id</li></ul></li>\n<li>Each fold, I use 51 truncated validation set.\n<ul><li>1 set is used for early stopping</li>\n<li>50 set is used for validation score by averaging qwk.</li></ul></li>\n</ul>\n\n<h2>Public vs Private</h2>\n\n<p>I think public dataset is not good distribution for validation because there are only 1000 records.\nI calculated by 1000 times the average of train oof prediction which is truncated and randomly sampling 1000 rows.\nThe histgram is as follows.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1305588%2F03a952505303120659eb4ec830ad0ab0%2Ftruncated_oof_prediction_average.png?generation=1579774962577581&amp;alt=media\" alt=\"\"></p>\n\n<p>From this histgram, It seems that the public dataset is rare case.</p>\n\n<p>Therefore I trust CV (ignore LB) and use threshold of CV best (explain detail in next).</p>\n\n<h2>QWK threshold</h2>\n\n<p>Finaly I used constant threshold [1.04, 1.76, 2.18].\nThis threshold is calculated by OptimizedRounder's threshold average in 500 truncated oof validation.</p>\n\n<p>I tryed many methods, but I believed maximum threshold in local CV prediction is most reliable.</p>\n\n<p>Some public kernels decided threshold by target distribution.\nIn my experiment, the method is good for public LB than other methods, but I think this method is overfitting to Public LB because the distribution is not equal to the truncated target distribution and not best distribution for QWK.</p>\n\n<h2>Feature</h2>\n\n<p>I made 3000~5000 features overall, but I think there are no magic features.\n(Finaly I used about 300 features.)</p>\n\n<p>Good features for me is as follows.</p>\n\n<ul>\n<li>Normalized Accuracy feature\n<ul><li>I normalized accuracy features because the difficulty of assessments and games are different per title.</li>\n<li>(Accuracy - Accuracy_mean_per_title) / Feature_std_per_title</li>\n<li>accuracy features means accuracy_group, n_true_attempts/all_attempts, correct/event_num and corret/(correct+false) etc...</li></ul></li>\n<li>Feature per title\n<ul><li>I make feature per title because the difference of level in a game is difficult to find common columns in event data.</li>\n<li>Ex : target_distances length in Air Show</li>\n<li>However it spends a lot of time, so I make only abount 10 titles(game, assessment) and gave up...</li></ul></li>\n<li>Relative feature\n<ul><li>Ex: event_code: 4020_count / 4070_count, last_accuracy / all_accuracy_mean</li></ul></li>\n</ul>\n\n<h2>Feature Selection</h2>\n\n<p>To evaluate features effect in truncated validation, I use LGB feature importance by truncated training data.\nIn each fold, I make 50 truncated datasets, and change dataset per 5 iteration by using lightgbm init_model params.</p>\n\n<p>I use top 300 features (the number is feeling).</p>\n\n<h2>Others</h2>\n\n<ul>\n<li>LightGBM parameter feature fraction =&gt; 1.0\n<ul><li>Feature fraction change (0.8 =&gt; 1.0) make improvement my CV about 0.005</li>\n<li>I think that the model should use assessment_title for every tree because the title has big effect on the target value, and the role of other features is change by the title feature.\n(It is hypothesis. I don't know it is correct)</li></ul></li>\n<li>model per game session\n<ul><li>Ubove Transformer model, I make lightgbm model per game session (predict next assessment result).</li>\n<li>The model is not used for the main model, but it is useful for find good feature in game eventdata speedy.</li></ul></li>\n<li>Use test dataset for training\n<ul><li>I don't know it made improvement.</li></ul></li>\n</ul>\n\n<h2>Not Work</h2>\n\n<ul>\n<li>NN regressor (MLP)\n<ul><li>Though NN sometimes has good score, but not stable.</li>\n<li>I have no time to tuning.</li></ul></li>\n<li>NN EventCode Transformer\n<ul><li>I regard one session as one sentence, and event codes as words.</li>\n<li>Prediction next assessment per session, and use it as feature</li>\n<li>A little improvement but consuming long time, so I do not use it.</li></ul></li>\n<li>Word2Vec Feature\n<ul><li>Similar to Transformer, I regard one session as one sentense.</li>\n<li>No improvement.</li></ul></li>\n<li>Predicting normalized accuracy group\n<ul><li>No improvement.</li></ul></li>\n<li>Training redidual error per title\n<ul><li>No improvement</li></ul></li>\n</ul>",
      "rawMarkdown": "First, thanks kaggle team for a exciting competition, and congratulations to all winning teams and good result teams.\nI joined this competition solely, so it was hard but very interesting competition.\n\n1 year ago, I have experienced very big shake down(2th =&gt; about 1500th) at Microsoft Malware Competition.\nhttps://www.kaggle.com/c/microsoft-malware-prediction/discussion/83950\n\nFrom this experience, I made effort to validation strategy and public/private analysis.\nAs a result I got my first Gold Medal by shake up.\n\nHere is my solution. (I am sorry for my poor English.)\n\n## Results\n\n10th(solo Gold) / 3523\n\n## Model\n\n- LightGBM x 6 average\n  - CV seed snd some hyper parameters is changed per model\n  - After averaging regression value, transform to integer accuracy_group by threshold.\n\n## Validation\n\n- Stratified Group KFold 10fold\n- All Validation score is calculated by truncated validation.\n  - random sample assessment each installation_id\n- Each fold, I use 51 truncated validation set.\n  - 1 set is used for early stopping\n  - 50 set is used for validation score by averaging qwk.\n\n## Public vs Private\n\nI think public dataset is not good distribution for validation because there are only 1000 records.\nI calculated by 1000 times the average of train oof prediction which is truncated and randomly sampling 1000 rows.\nThe histgram is as follows.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1305588%2F03a952505303120659eb4ec830ad0ab0%2Ftruncated_oof_prediction_average.png?generation=1579774962577581&amp;alt=media)\n\nFrom this histgram, It seems that the public dataset is rare case.\n\nTherefore I trust CV (ignore LB) and use threshold of CV best (explain detail in next).\n\n## QWK threshold\n\nFinaly I used constant threshold [1.04, 1.76, 2.18].\nThis threshold is calculated by OptimizedRounder's threshold average in 500 truncated oof validation.\n\nI tryed many methods, but I believed maximum threshold in local CV prediction is most reliable.\n\nSome public kernels decided threshold by target distribution.\nIn my experiment, the method is good for public LB than other methods, but I think this method is overfitting to Public LB because the distribution is not equal to the truncated target distribution and not best distribution for QWK.\n\n\n## Feature\n\nI made 3000~5000 features overall, but I think there are no magic features.\n(Finaly I used about 300 features.)\n\nGood features for me is as follows.\n\n- Normalized Accuracy feature\n  - I normalized accuracy features because the difficulty of assessments and games are different per title.\n    - (Accuracy - Accuracy_mean_per_title) / Feature_std_per_title\n  - accuracy features means accuracy_group, n_true_attempts/all_attempts, correct/event_num and corret/(correct+false) etc...\n- Feature per title\n  - I make feature per title because the difference of level in a game is difficult to find common columns in event data.\n    - Ex : target_distances length in Air Show\n  - However it spends a lot of time, so I make only abount 10 titles(game, assessment) and gave up...\n- Relative feature\n  - Ex: event_code: 4020_count / 4070_count, last_accuracy / all_accuracy_mean\n \n\n## Feature Selection\n\nTo evaluate features effect in truncated validation, I use LGB feature importance by truncated training data.\nIn each fold, I make 50 truncated datasets, and change dataset per 5 iteration by using lightgbm init_model params.\n\nI use top 300 features (the number is feeling).\n\n## Others\n\n- LightGBM parameter feature fraction =&gt; 1.0\n  - Feature fraction change (0.8 =&gt; 1.0) make improvement my CV about 0.005\n  - I think that the model should use assessment_title for every tree because the title has big effect on the target value, and the role of other features is change by the title feature.\n   (It is hypothesis. I don't know it is correct)\n- model per game session\n  - Ubove Transformer model, I make lightgbm model per game session (predict next assessment result).\n  - The model is not used for the main model, but it is useful for find good feature in game eventdata speedy.\n- Use test dataset for training\n  - I don't know it made improvement.\n\n## Not Work\n\n- NN regressor (MLP)\n  - Though NN sometimes has good score, but not stable.\n  - I have no time to tuning.\n- NN EventCode Transformer\n  - I regard one session as one sentence, and event codes as words.\n  - Prediction next assessment per session, and use it as feature\n  - A little improvement but consuming long time, so I do not use it.\n- Word2Vec Feature\n  - Similar to Transformer, I regard one session as one sentense.\n  - No improvement.\n- Predicting normalized accuracy group\n  - No improvement.\n- Training redidual error per title\n  - No improvement\n",
      "votes": 67
    },
    {
      "id": 733273,
      "postDate": "2020-01-30T23:05:20.830Z",
      "content": "<p>Congrats for your first solo gold and thank you for sharing 🎉 </p>",
      "rawMarkdown": "Congrats for your first solo gold and thank you for sharing 🎉 ",
      "votes": 1
    },
    {
      "id": 727287,
      "postDate": "2020-01-23T15:56:01.230Z",
      "content": "<p>Congrats Pao.</p>",
      "rawMarkdown": "Congrats Pao.",
      "votes": 1
    },
    {
      "id": 727110,
      "postDate": "2020-01-23T13:17:58.833Z",
      "content": "<p>Congratulations! Thank you so much for sharing your solutions.</p>",
      "rawMarkdown": "Congratulations! Thank you so much for sharing your solutions.",
      "votes": 1
    },
    {
      "id": 727082,
      "postDate": "2020-01-23T12:54:37.430Z",
      "content": "<p>Congratulations!</p>",
      "rawMarkdown": "Congratulations!",
      "votes": 1
    },
    {
      "id": 726971,
      "postDate": "2020-01-23T10:46:32.770Z",
      "content": "<p>Congratulations\nGreat Write-Up\nThanks for Sharing your Approach &amp; Insights!! <a href=\"/go5kuramubon\">@go5kuramubon</a> </p>",
      "rawMarkdown": "Congratulations\nGreat Write-Up\nThanks for Sharing your Approach &amp; Insights!! @go5kuramubon ",
      "votes": 1
    },
    {
      "id": 726959,
      "postDate": "2020-01-23T10:39:58.897Z",
      "content": "<p>Congratulations!</p>",
      "rawMarkdown": "Congratulations!",
      "votes": 1
    },
    {
      "id": 726955,
      "postDate": "2020-01-23T10:36:46.767Z",
      "content": "<p>Congratulations! Your features seem well preprocessed</p>",
      "rawMarkdown": "Congratulations! Your features seem well preprocessed",
      "votes": 1
    },
    {
      "id": 726952,
      "postDate": "2020-01-23T10:35:08.367Z",
      "content": "<p>Congratulations and thanks for sharing your solution!!!!!</p>",
      "rawMarkdown": "Congratulations and thanks for sharing your solution!!!!!",
      "votes": 1
    },
    {
      "id": 727862,
      "postDate": "2020-01-24T06:07:32.203Z",
      "content": "<p>One more question on the topic of weights in xgboost. I added the completed assessments in test.csv to the training data and thinking that those are better data than train (because they are same IDs as the users for which we need to predict, I put a larger weight for them, I tried putting weight=1 for train.csv rows and weight=3 for test.csv rows but my score decreased. Can anyone comment why? Is there an obvious flaw with this line of thinking? Maybe 3 was too hight, would it have made sense to try some smaller numbers like 1.5?</p>",
      "rawMarkdown": "One more question on the topic of weights in xgboost. I added the completed assessments in test.csv to the training data and thinking that those are better data than train (because they are same IDs as the users for which we need to predict, I put a larger weight for them, I tried putting weight=1 for train.csv rows and weight=3 for test.csv rows but my score decreased. Can anyone comment why? Is there an obvious flaw with this line of thinking? Maybe 3 was too hight, would it have made sense to try some smaller numbers like 1.5?",
      "replies": [
        {
          "id": 729991,
          "postDate": "2020-01-27T00:19:06.387Z",
          "content": "<p>I don't know the best weigh but I think we should keep the test weight lower because the count of assessment in test data for train is lower than test for LB.\nIt makes the training data distribution different from test for LB though increasing train\ndata is good for model accuracy.</p>",
          "rawMarkdown": "I don't know the best weigh but I think we should keep the test weight lower because the count of assessment in test data for train is lower than test for LB.\nIt makes the training data distribution different from test for LB though increasing train\ndata is good for model accuracy."
        }
      ]
    },
    {
      "id": 727860,
      "postDate": "2020-01-24T06:02:39.207Z",
      "content": "<p>I did a similar test as you did in Public vs. Private. My conclusion was different, I thought that the IDs in test.csv are more successful so  I did this: I computed probability of getting a 3 in Cauldron Filler in train data and in test data, then I took the ratios. Let's say ratio is 1.2, that means the IDs in test.csv were x1.2 better so I put that as the weight column (xgboost allows for a weight parameter) for all rows in train where title==Cauldron Filler and accuracy_group==3. I did this for all accuracy groups. So even if test IDs are more or less successful compared to train, this way I thought the train set would be calibrated somewhat to the testing data. This increased my CV somewhat but my score was already so low that I wasn't really paying too much attention to small bumps in my score so I am not sure.\nCan you  or anyone else chime in on this. Is this a logical thing to try? And is it correct use of xgboost weight parameter?\nThanks</p>",
      "rawMarkdown": "I did a similar test as you did in Public vs. Private. My conclusion was different, I thought that the IDs in test.csv are more successful so  I did this: I computed probability of getting a 3 in Cauldron Filler in train data and in test data, then I took the ratios. Let's say ratio is 1.2, that means the IDs in test.csv were x1.2 better so I put that as the weight column (xgboost allows for a weight parameter) for all rows in train where title==Cauldron Filler and accuracy_group==3. I did this for all accuracy groups. So even if test IDs are more or less successful compared to train, this way I thought the train set would be calibrated somewhat to the testing data. This increased my CV somewhat but my score was already so low that I wasn't really paying too much attention to small bumps in my score so I am not sure.\nCan you  or anyone else chime in on this. Is this a logical thing to try? And is it correct use of xgboost weight parameter?\nThanks",
      "replies": [
        {
          "id": 729990,
          "postDate": "2020-01-27T00:10:37.390Z",
          "content": "<p>I think this method makes overfitting because we cannot know the distribution of private test.\nMoreover I think the difficulty of assessment is same between train and test.</p>",
          "rawMarkdown": "I think this method makes overfitting because we cannot know the distribution of private test.\nMoreover I think the difficulty of assessment is same between train and test.",
          "votes": 1
        }
      ]
    },
    {
      "id": 727854,
      "postDate": "2020-01-24T05:49:11.793Z",
      "content": "<p>Hello, thank you for the write up, beginner questions here. I am trying to understand how you did validation and what is truncated CV in general.\n1)What is the data that you do the GroupKFold on? Is it on all the rows where  accuracy_group exists, or the entire 11.3 million rows of train.csv ? \nI checked there are 3614 installation_ids with at least 1 assessment done. So I think you get 361 ids per group\n2)then why do you split it to 51 folds? Why not ask for 510 folds (or 501) in the first place?\n3) for each fold, since 1 set is just early stopping, does that mean you run cv on the other 50 sets which means the model is trained with 49 sets, and error is computed on the 1 remaining set, and all 50 errors are averaged?</p>",
      "rawMarkdown": "Hello, thank you for the write up, beginner questions here. I am trying to understand how you did validation and what is truncated CV in general.\n1)What is the data that you do the GroupKFold on? Is it on all the rows where  accuracy_group exists, or the entire 11.3 million rows of train.csv ? \nI checked there are 3614 installation_ids with at least 1 assessment done. So I think you get 361 ids per group\n2)then why do you split it to 51 folds? Why not ask for 510 folds (or 501) in the first place?\n3) for each fold, since 1 set is just early stopping, does that mean you run cv on the other 50 sets which means the model is trained with 49 sets, and error is computed on the 1 remaining set, and all 50 errors are averaged?\n",
      "replies": [
        {
          "id": 729985,
          "postDate": "2020-01-27T00:01:42.460Z",
          "content": "<p>Sorry for late.</p>\n\n<blockquote>\n  <p>1\n  Group on installation_id.</p>\n  \n  <p>2\n  I don't use 51 fold. Only 10fold.\n  From the one validation set in 10 fold, I make 51 sets by selecting  assessment randomly per installation_id.</p>\n  \n  <p>3\n  I use only 10 fold.\n  Per 1 fold, 1 set for early stopping and 50 set for validation score.</p>\n</blockquote>",
          "rawMarkdown": "Sorry for late.\n&gt; 1\nGroup on installation_id.\n\n&gt; 2\nI don't use 51 fold. Only 10fold.\nFrom the one validation set in 10 fold, I make 51 sets by selecting  assessment randomly per installation_id.\n\n&gt; 3\nI use only 10 fold.\nPer 1 fold, 1 set for early stopping and 50 set for validation score.",
          "votes": 1
        }
      ]
    },
    {
      "id": 727267,
      "postDate": "2020-01-23T15:33:15.877Z",
      "content": "<p>thanks for sharing and congrats! \n&gt; In each fold, I make 50 truncated datasets, and change dataset per 5 iteration by using lightgbm init_model params.</p>\n\n<p>this is pretty interesting and its my first time seen this kind of approach. Have you compared this with just train one lgb on the combination of these 50 truncated datasets? Is there a good motivation for doing this 5 iteration training each time with different truncated datasets? It sort makes sense to me in neural nets (i.e. random sampling of shuffled training data in batch training), where the nn weights carries information, but its hard to imagine how it works for lgb, where the training is made based on splits. Does it keep building leafs or it could replace the spliting criteria from <code>init_model</code> completely? (EDIT: now i think about, it seems like it just keeps building base trees but with new data)</p>\n\n<p>Did you still apply early stopping during training, or the training is done when all the 50x5 iteration is finished?</p>",
      "rawMarkdown": "thanks for sharing and congrats! \n&gt; In each fold, I make 50 truncated datasets, and change dataset per 5 iteration by using lightgbm init_model params.\n\nthis is pretty interesting and its my first time seen this kind of approach. Have you compared this with just train one lgb on the combination of these 50 truncated datasets? Is there a good motivation for doing this 5 iteration training each time with different truncated datasets? It sort makes sense to me in neural nets (i.e. random sampling of shuffled training data in batch training), where the nn weights carries information, but its hard to imagine how it works for lgb, where the training is made based on splits. Does it keep building leafs or it could replace the spliting criteria from `init_model` completely? (EDIT: now i think about, it seems like it just keeps building base trees but with new data)\n\nDid you still apply early stopping during training, or the training is done when all the 50x5 iteration is finished?",
      "replies": [
        {
          "id": 728604,
          "postDate": "2020-01-25T00:38:39.680Z",
          "content": "<p>Thanks for a good question.</p>\n\n<p>&gt; Have you compared this with just train one lgb on the combination of these 50 truncated datasets? Is there a good motivation for doing this 5 iteration training each time with different truncated datasets?</p>\n\n<p>I compared the two model. In fact, the validation score is almost same, and 50 truncated model takes more time to learning. \nHowever my motivation of truncated model is to evaluate feature importance correctly.\nThe distribution of all data is different from that of truncated data.\nIt means that the feature importance of training with all data is a little different from the feature importance which we want to check.</p>\n\n<p>&gt; Does it keep building leafs or it could replace the spliting criteria from init_model completely?</p>\n\n<p>In lgb, a decision tree is added to the model by each iteration, and if use init_model, the added trees keeps and add new tree to the init_model trees.</p>",
          "rawMarkdown": "Thanks for a good question.\n\n&gt; Have you compared this with just train one lgb on the combination of these 50 truncated datasets? Is there a good motivation for doing this 5 iteration training each time with different truncated datasets?\n\nI compared the two model. In fact, the validation score is almost same, and 50 truncated model takes more time to learning. \nHowever my motivation of truncated model is to evaluate feature importance correctly.\nThe distribution of all data is different from that of truncated data.\nIt means that the feature importance of training with all data is a little different from the feature importance which we want to check.\n\n\n&gt; Does it keep building leafs or it could replace the spliting criteria from init_model completely?\n\nIn lgb, a decision tree is added to the model by each iteration, and if use init_model, the added trees keeps and add new tree to the init_model trees.",
          "votes": 1
        }
      ]
    },
    {
      "id": 730053,
      "postDate": "2020-01-27T03:17:13.940Z",
      "rawMarkdown": "",
      "votes": 3,
      "isDeleted": true
    },
    {
      "id": 727500,
      "postDate": "2020-01-23T18:47:59.927Z",
      "content": "<p>Congratulations Thanks for sharing !</p>",
      "rawMarkdown": "Congratulations Thanks for sharing !",
      "votes": 6
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-22T10:52:18Z",
  "competition_id": 16531,
  "competition_slug": "data-science-bowl-2019",
  "team_id": 3924421,
  "solution_url": "/competitions/data-science-bowl-2019/writeups/pao-10th-place-solution"
}