{
  "id": 26416,
  "title": "#1st Place Solution",
  "content": "<p>Hi Guys,</p>\n\n<p>Here is a short summary of my final solution: Nothing extra-oridinary but a lot of diverse models and data preprocessing. So after my 1st submission which scored 1118 on public LB and I landed the 3rd position at the very beginning of the competiton, I thought I would give a try for my solo gold medal here. I had just relocated to a new city and joined a new company at that moment, but I tried my best to keep in touch with the leaderboard progression and hence update my models going ahead.</p>\n\n<p><strong>Best Single Model:</strong></p>\n\n<p>My best single model is an XGBoost with the two-way interactions reported on the forum along with some chosen three, four, five and seven-way interactions. It score 1105.12 in the public LB with 10-fold CV around 1124. I chose the higher order interactions primarily based on mutual information. I used <a href=\"https://www.kaggle.com/c/allstate-claims-severity/forums/t/24520/effect-of-mae?forumMessageId=140255#post140255\">fair_obj</a> with a constant of 0.7 for training that model and <code>(1 + loss)**0.25</code> transformation reported by <a href=\"https://www.kaggle.com/mrooijer\">MrOijer</a>.</p>\n\n<p><strong>My NN architecture</strong></p>\n\n<p>My best NN scores 1110 in the public leaderboard with a 10-fold cv of 1134.xx. It is very similar to the <a href=\"https://www.kaggle.com/mtinti/allstate-claims-severity/keras-starter-with-bagging-1111-84364/code\">public scirpt scoring 1111.8x</a> , just some more neurons in each layer.  I used EarlyStopping, ModelCheckpoint and derived metric to monitor (I used <code>log(loss + SHIFT)</code> transformation) and 10-fold 10 times bagged model. Almost all my NN models follow the same architecture.</p>\n\n<p>I used mostly the above two models to train a stacked model (details later in the post) in the second layer, but there are other models with significant contribution. Among them:</p>\n\n<p><strong>Regularized Greedy Forest</strong>\nI had three RGF mixed in to my ensemble trained with slighly different data and loss transformation. My best RGF scores 1113.xx with a cv around 1136.xx. It is a fantastic library that I explored back in BNP Paribas competiton and was determined to use it in one of my competitions. Just one setback is that it's a bit on the slower side being single-threaded.</p>\n\n<p><strong>LightGBM</strong>\nAnother very fast and efficient gradient boosting library beside XGboost. I loved it. Best single model 1111.xx on public LB.</p>\n\n<p><strong>Vowpal Wabbit</strong>\nAlways found it worth giving a shot and yes it beat random forest and extra trees which I never could get executed with <code>MAE</code> criterion in sklearn. Best single model 1133.xx with a cv of 1154.xx. I used quadtraic interactions in the categorical namespace.</p>\n\n<p><strong>LibFM</strong>\nNot much from single model, but definitely helped my ensemble. Best model 1166.xx with 10-fold cv of 1188.xx.</p>\n\n<p><strong>LibFFM</strong>\nAlmost at par with my VW. Best model 10-fold cv 1158.xx with public LB 1139.xx.</p>\n\n<p>I also used RF(R-h20), ExtraTrees(sklearn), glmnet (R) and some other models to diversify my final ensemble but none of them yielded significant individual performance.</p>\n\n<p><strong>Stacking pipeline</strong></p>\n\n<p>I used 10-fold stacking in this competiton and tried a number of preprocessing on the data:</p>\n\n<ul>\n<li>Different order interactions between categorical features.</li>\n<li>TF-IDF on categorical features.</li>\n<li><a href=\"https://github.com/entron/entity-embedding-rossmann\">Category Embedding</a> with NN and different embedding layer sizes.</li>\n<li>Standard Scalar/ Minmax scalar</li>\n<li>Different loss function in xgb incuding count:poisson on the rounded and log   transformed targets. Surprisingly it gave me a public LB of 1168.xx.</li>\n<li>Trained XGB on the bottom 5 and 10 percentile and top 70, 80 and 90 percentile of data. The motivation was to get a better estimate of the exorbitant loss values.</li>\n</ul>\n\n<p>I had a total of 81 models in the 1st level and trained an XGB and two NN on them on the second layer.</p>\n\n<p><strong>Best Second Level Model</strong>\nMy best L2 model has a 10-fold cv of 1114.645 and public LB 1097.87.</p>\n\n<p><strong>Final Submission</strong></p>\n\n<p>My final submission is an wegthed average of the following: </p>\n\n<ol>\n<li><code>w1*NN1^w2 + w3*NN2^w4 + w5*XGB1^w6 + w7</code> - weights optimized by using <code>optim</code> (Nelder-Mead) in a 1-fold manner =&gt; apply weights to test predictions =&gt; average 10 test predictions for 10x optimized weights.</li>\n<li>If NN1 &lt; w1 , then w2*NN1^w3 + w4 Else if  NN1 &gt; w5, then w6*NN1^w7\n        + w8 Else NN1</li>\n</ol>\n\n<p>I extend my congratulations to all other winners and my sincere thanks to Kaggle and Allstate group for arranging this exciting competition. </p>\n\n<p>Special thanks to Scirpus, Vladimir, Tilli, Lauea (as always), Danijel, d3miekno and all the other people who kept the forum so active all the time with their brilliant ideas and scripts :)</p>",
  "comments": [
    {
      "id": 149922,
      "author_name": "Bishwarup B",
      "author_url": "",
      "post_date": "2016-12-13T07:35:54.940000",
      "content": "<p>@DDgg: I am not aware of any such open/commercial software who will automate the whole stacking pipleline. There are libraries in both R and python to do the ensembling part for you but I haven't looked into those very deeply yet.</p>\n\n<p>@qianqian: My NN models took 24 hours on an average to complete. XGboost was much faster. None of my XGBoost models has an execution duration of more than 4 hours (I did 10-fold CV).</p>\n\n<p>@Balaji SR: I actually did not train on whole data. None of my models are trained on whole data as it was pretty tricky to find the optimum number of rounds. So I chose to do 10-fold CV average approach which also seemed quite stable in terms of CV-LB agreement. However, if I calculate the optimum round from my best model by the formula <code>average best round/ proportion sample in training set</code> it comes around 2700. 15000 seems too much, I think you were using a very small learning rate which resulted in large number of iterations. I tried to cut down the learning rate as well but that didn't improve my cv or lb. I almost always used learning rate = 0.03, the best number of rounds was pretty dependent on the <code>gamma</code> though.</p>\n\n<p>@Gippy: I calculated the mutual information between the interaction features and the transformed target. If you are looking for how to calculate MI, you can look into the packages like <a href=\"https://cran.r-project.org/web/packages/mRMRe/mRMRe.pdf\">mRMRe</a> or <a href=\"https://cran.r-project.org/web/packages/infotheo/infotheo.pdf\">infotheo</a>. In python, you can look into the function <a href=\"http://scikit-learn.org/stable/modules/generated/sklearn.metrics.mutual_info_score.html\">sklearn.metrics.mutual_info_score</a>. I took the interactions which had high MI score.</p>\n\n<p>@olivier: Thanks for the link. I actually came across that but didn't give it a try yet. Does it have cv support find the optimum model number given other parameters? I actually used my own wrapper in python for RGF but that is not multithreaded.</p>",
      "votes": 15,
      "replies": []
    },
    {
      "id": 149903,
      "author_name": "Siddharth Chandrakant",
      "author_url": "",
      "post_date": "2016-12-13T06:05:29.923000",
      "content": "<p>Congrats Bishwarup, not only for the win, but also for becoming the highest ranked Indian Kaggler when the rankings get updated! :)</p>",
      "votes": 11,
      "replies": []
    },
    {
      "id": 150253,
      "author_name": "SRK",
      "author_url": "",
      "post_date": "2016-12-14T12:06:16.590000",
      "content": "<p>Excellent Bishwarup. The solution shows the amount of hard work that you have put in. Well deserved victory. Congratulations.!</p>\n\n<p>Congrats on the overall top 10 as well. Time to party :)  </p>",
      "votes": 9,
      "replies": []
    },
    {
      "id": 149948,
      "author_name": "Qingchen",
      "author_url": "",
      "post_date": "2016-12-13T09:41:33.230000",
      "content": "<p>Congrats! I'm happy to see that you got so much success from ensembling many models. I pushed my best xgboost to ~1103 MAE three weeks ago and didn't know how to make improvements anymore. Really nice to see the effect of ensembling of different variations. Learned a lot from you here, definitely saving your post :) </p>",
      "votes": 7,
      "replies": [
        {
          "id": 150017,
          "author_name": "Vladimir Iglovikov",
          "author_url": "",
          "post_date": "2016-12-13T15:24:17.087000",
          "content": "<p>[quote=Qingchen;149948]</p>\n\n<p>Congrats! I'm happy to see that you got so much success from ensembling many models. I pushed my best xgboost to ~1103 MAE three weeks ago and didn't know how to make improvements anymore.</p>\n\n<p>[/quote]\n1103 is very impressive. Could you please share code, hyperparameters, feature engineering?</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 149902,
      "author_name": "DDgg",
      "author_url": "",
      "post_date": "2016-12-13T06:01:16.833000",
      "content": "<p>Thank you,\nmuch appreciated!</p>\n\n<p>Questions of course: <br>\n1) Is there an open/commercial pipeline/workflow that could <strong>match</strong> those results <strong>consistently</strong> <br>\n2) Is there an open or commercial pipeline/workflow that could <strong>deploy</strong> the whole solution  consistently  </p>\n\n<p>Basically, would it be feasible to implement a similar model <br>\nthat would consistently get good results on your proposed workflow.  </p>\n\n<p>Surely interesting for commercial/open ML providers for regression problems.  </p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 150706,
      "author_name": "Bishwarup B",
      "author_url": "",
      "post_date": "2016-12-16T12:01:13.023000",
      "content": "<p>@Gippy: I didn't use bootstrapping, I simply used oof-data for EarlyStopping.</p>\n\n<p>@ Ronin: I have written my own wrapper for VW in python for performing cross-validation and other stuff.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 150356,
      "author_name": "deltap",
      "author_url": "",
      "post_date": "2016-12-14T21:50:11.247000",
      "content": "<p>Thank you so much for sharing such a great solution! I have a question about generating out-of-fold predictions from bagged models (e.g. your NN bag) for stacking. I assume you used the same 10-fold split (call it 'a') for all of your base models. When you generate the meta/oof features of your NN models do you do another 10-fold cv (call it 'b') on the training portion of (a), early stop each of the models based on the valid portion of (b), and bag them to make predictions/oof features on the valid fold of (a)? In another word are the meta features you computed via the first 10-fold cv(a) generated by a similar 10-fold 10 times bagged model on the training portions of (a)</p>\n\n<p>I wonder if this type of 'nested' cv is necessary for all kinds of bagged models when the individual ones are terminated by the validation set</p>\n\n<p>I am not sure of I have made myself clear. Let me know if it is still confusing.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 149941,
      "author_name": "Bishwarup B",
      "author_url": "",
      "post_date": "2016-12-13T09:05:50.817000",
      "content": "<p>@Engine: I tuned the parameter manually for RGF (RGF, reg_L2 = 0.035, min_pop = 80, max_leaf_forest = 4500). Without interaction it took around 3.5 hrs and with interaction around 7 hours.</p>\n\n<p>@Evgeny_Semyonov: I used Ubuntu15.10 for the VW model. I used python to convert the data into vw format and execute the command line from within the script only. For your second query, the idea is when the NN (second layer) predicts low and higher value, I optimized the adjustment parameters differently.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 149937,
      "author_name": "RR",
      "author_url": "",
      "post_date": "2016-12-13T08:57:48.990000",
      "content": "<p>Congrats Bishwarup. great achievement.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 149920,
      "author_name": "olivier",
      "author_url": "",
      "post_date": "2016-12-13T07:24:41.397000",
      "content": "<p>Bishwarup Congratulations ! <br>\nThank you for detailing your solution in this way. \nThese algos will certainly end up in my arsenal. \nYou're probably aware but just in case, there's a multi core RGF available here: <a href=\"https://github.com/baidu/fast_rgf\">https://github.com/baidu/fast_rgf</a>\nI still need to test it though.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 154664,
      "author_name": "ShashankHegdeK",
      "author_url": "",
      "post_date": "2017-01-07T14:18:10.450000",
      "content": "<p>@Bishwarup B Thanks for sharing the solution. Can you please share the code as well?</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 150635,
      "author_name": "Ronin",
      "author_url": "",
      "post_date": "2016-12-16T05:05:14.267000",
      "content": "<p>How did you perform your CV in VW?  Did you do it manually?  I've always had trouble optimizing VW as the \"scoring\" functions used in competitions tend not to be implemented directly in vw (although the quintile loss function seemed to be working well this competition) as well as having to manually split the data set.</p>\n\n<p>I've never had good luck with the VW wrappers, although the program itself is slick as snot once I figured out what I was doing.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 150416,
      "author_name": "FredTony",
      "author_url": "",
      "post_date": "2016-12-15T02:58:56.450000",
      "content": "<p>And for python: <a href=\"https://docs.scipy.org/doc/scipy-0.18.1/reference/optimize.minimize-neldermead.html\">https://docs.scipy.org/doc/scipy-0.18.1/reference/optimize.minimize-neldermead.html</a></p>",
      "votes": 2,
      "replies": [
        {
          "id": 2186320,
          "author_name": "Tony6512",
          "author_url": "",
          "post_date": "2023-03-17T17:53:46.860000",
          "content": "<p>This is helpful. Thanks. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 149927,
      "author_name": "Evgeny_Semyonov",
      "author_url": "",
      "post_date": "2016-12-13T07:44:44.397000",
      "content": "<p>Congratulations!  Very cool solution.</p>\n\n<p>Questions: </p>\n\n<p>1) i tried to use Vowpal Wabbit, but it's terrible on Windows. What's your platform?(Windows/Unix)\nAn did you use it from Python or converted data to Vowpal Wabbit format and start from console?</p>\n\n<p>2) \"If NN1 &lt; w1 , then w2*NN1^w3 + w4 Else if NN1 &gt; w5, then w6*NN1^w7 + w8 Else NN1\". </p>\n\n<p>NN1 - it's predictions from Neural second level model  and w1 - it's weitht (scalar)? How can we compare them?</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 149923,
      "author_name": "Engine",
      "author_url": "",
      "post_date": "2016-12-13T07:37:03.353000",
      "content": "<p>congratulations for the 1st place!\nTell, please, about parameters of RGF (algorithm modification (RGF|RGF Opt|RGF Sib), num of leaves, kind of regularization parameters). How much of time takes for rgf to make prediction? \nThanks for sharing your ideas</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 149917,
      "author_name": "Abhay Shukla",
      "author_url": "",
      "post_date": "2016-12-13T07:16:37.597000",
      "content": "<p>So this is what it takes. Phew! Congratulations :)</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 970385,
      "author_name": "Murilo Palomo Sebilla",
      "author_url": "",
      "post_date": "2020-08-14T12:03:20.523000",
      "content": "<p>Thank you, it is really helpful to new guys like me ^^.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 261183,
      "author_name": "tedfyw",
      "author_url": "",
      "post_date": "2017-12-22T00:21:34.733000",
      "content": "<p>Thanks for sharing. That is really helpful!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 169239,
      "author_name": "deadpitman",
      "author_url": "",
      "post_date": "2017-03-20T08:16:19.507000",
      "content": "<p>Thx for sharing your strategy.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 162633,
      "author_name": "Amit Gupta",
      "author_url": "",
      "post_date": "2017-02-20T11:45:17.850000",
      "content": "<p>Many congrats Bishwarup B!!!!. Could you please share your code also.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150903,
      "author_name": "Bishwarup B",
      "author_url": "",
      "post_date": "2016-12-17T12:51:55.397000",
      "content": "<p>@Gippy: I didn't change any parameter as such, just the random_seed to make the model more robust as NN is very sentsitive to noise in the data.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150718,
      "author_name": "Gippy",
      "author_url": "",
      "post_date": "2016-12-16T13:30:04.677000",
      "content": "<p>@Bishwarup: Then can you please let me know what do you mean by 10 bags for each fold? What parameter do you change for each bag? Thanks</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150506,
      "author_name": "Gippy",
      "author_url": "",
      "post_date": "2016-12-15T13:38:28.027000",
      "content": "<p>@Bishwarup: 10 fold 10 bags: Does it mean that for every fold, you take bootstrap sample (10 times) and use that for training (if yes, then do you use the oob data for early stopping or oof fold data for early stopping). Or have i misunderstood the approach? Thanks</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150490,
      "author_name": "Bishwarup B",
      "author_url": "",
      "post_date": "2016-12-15T12:22:42.593000",
      "content": "<p>@Achal: I used percentile based binning.</p>\n\n<p>@ SRK: Thanks man :)</p>\n\n<p>@ deltap: 10 fold 10 bags -&gt; so 100 folds in total -&gt; EarlyStopping in each of the folds -&gt; predict oof and test -&gt; average test for all the 100 runs.</p>\n\n<p>@Finaly Liu: I think ClusterFork and Tony already cleared your doubts.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150406,
      "author_name": "Finlay",
      "author_url": "",
      "post_date": "2016-12-15T02:17:41.223000",
      "content": "<p>optim (Nelder-Mead) , what does this mean?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 150414,
          "author_name": "Mycroft Holmes",
          "author_url": "",
          "post_date": "2016-12-15T02:55:29.700000",
          "content": "<p>[quote=Finlay Liu;150406]</p>\n\n<p>optim (Nelder-Mead) , what does this mean?</p>\n\n<p>[/quote]\n?optim in R console:</p>\n\n<p>optim {stats}   R Documentation\nGeneral-purpose Optimization</p>\n\n<p>Description</p>\n\n<p>General-purpose optimization based on Nelder–Mead, quasi-Newton and conjugate-gradient algorithms. It includes an option for box-constrained optimization and simulated annealing.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 150076,
      "author_name": "Achal",
      "author_url": "",
      "post_date": "2016-12-13T19:14:10.190000",
      "content": "<blockquote>\n  <p>\"I chose the higher order interactions primarily based on mutual\n  information\"</p>\n  \n  <p>\" I calculated the mutual information between the interaction features\n  and the transformed target. If you are looking for how to calculate\n  MI, you can look into the packages like mRMRe or infotheo. In python,\n  you can look into the function sklearn.metrics.mutual_info_score. I\n  took the interactions which had high MI score.\"</p>\n</blockquote>\n\n<p>Did you calculate mutual information among all categorical features, right? Our loss function is continuous, so how did you calculate MI to calculate interactions? Any readings or link will be helpful.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150021,
      "author_name": "Travis Glines",
      "author_url": "",
      "post_date": "2016-12-13T15:36:33.727000",
      "content": "<p>Congrats Bishwarup!  Thanks for the play-by-play.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150020,
      "author_name": "InnerVoice",
      "author_url": "",
      "post_date": "2016-12-13T15:29:45.517000",
      "content": "<p>I have tried to use vowpal and max CV I got was around 1165.  Need some tuning tips for vowpal. I also tried to use RGF during last couple of days but not able to complete the training. I found your solution easy to understand as compared to others Multilayer stacking.. and will use some of the tips in near future.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150001,
      "author_name": "Vipin",
      "author_url": "",
      "post_date": "2016-12-13T14:08:13.037000",
      "content": "<p>Congratulations Bishwarup B.This was my first competition I never even thought about ensembling many models.Thanks for explaining your solution.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149918,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T07:21:06.597000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149910,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T06:40:55.803000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149908,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T06:29:33.187000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149907,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T06:28:07.327000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149905,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T06:23:39.387000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149904,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T06:11:42.260000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150011,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T14:53:35.440000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1913465,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-08-25T10:33:50.040000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150984,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-18T03:15:11.007000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 150522,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-15T15:05:05.073000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149991,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T13:20:00.253000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149900,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T05:50:17.413000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 149897,
      "author_name": "",
      "author_url": "",
      "post_date": "2016-12-13T05:30:24.663000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "comment_count": 45,
  "messages": [
    {
      "id": 149896,
      "postDate": "2016-12-13T05:23:14.197Z",
      "content": "<p>Hi Guys,</p>\n\n<p>Here is a short summary of my final solution: Nothing extra-oridinary but a lot of diverse models and data preprocessing. So after my 1st submission which scored 1118 on public LB and I landed the 3rd position at the very beginning of the competiton, I thought I would give a try for my solo gold medal here. I had just relocated to a new city and joined a new company at that moment, but I tried my best to keep in touch with the leaderboard progression and hence update my models going ahead.</p>\n\n<p><strong>Best Single Model:</strong></p>\n\n<p>My best single model is an XGBoost with the two-way interactions reported on the forum along with some chosen three, four, five and seven-way interactions. It score 1105.12 in the public LB with 10-fold CV around 1124. I chose the higher order interactions primarily based on mutual information. I used <a href=\"https://www.kaggle.com/c/allstate-claims-severity/forums/t/24520/effect-of-mae?forumMessageId=140255#post140255\">fair_obj</a> with a constant of 0.7 for training that model and <code>(1 + loss)**0.25</code> transformation reported by <a href=\"https://www.kaggle.com/mrooijer\">MrOijer</a>.</p>\n\n<p><strong>My NN architecture</strong></p>\n\n<p>My best NN scores 1110 in the public leaderboard with a 10-fold cv of 1134.xx. It is very similar to the <a href=\"https://www.kaggle.com/mtinti/allstate-claims-severity/keras-starter-with-bagging-1111-84364/code\">public scirpt scoring 1111.8x</a> , just some more neurons in each layer.  I used EarlyStopping, ModelCheckpoint and derived metric to monitor (I used <code>log(loss + SHIFT)</code> transformation) and 10-fold 10 times bagged model. Almost all my NN models follow the same architecture.</p>\n\n<p>I used mostly the above two models to train a stacked model (details later in the post) in the second layer, but there are other models with significant contribution. Among them:</p>\n\n<p><strong>Regularized Greedy Forest</strong>\nI had three RGF mixed in to my ensemble trained with slighly different data and loss transformation. My best RGF scores 1113.xx with a cv around 1136.xx. It is a fantastic library that I explored back in BNP Paribas competiton and was determined to use it in one of my competitions. Just one setback is that it's a bit on the slower side being single-threaded.</p>\n\n<p><strong>LightGBM</strong>\nAnother very fast and efficient gradient boosting library beside XGboost. I loved it. Best single model 1111.xx on public LB.</p>\n\n<p><strong>Vowpal Wabbit</strong>\nAlways found it worth giving a shot and yes it beat random forest and extra trees which I never could get executed with <code>MAE</code> criterion in sklearn. Best single model 1133.xx with a cv of 1154.xx. I used quadtraic interactions in the categorical namespace.</p>\n\n<p><strong>LibFM</strong>\nNot much from single model, but definitely helped my ensemble. Best model 1166.xx with 10-fold cv of 1188.xx.</p>\n\n<p><strong>LibFFM</strong>\nAlmost at par with my VW. Best model 10-fold cv 1158.xx with public LB 1139.xx.</p>\n\n<p>I also used RF(R-h20), ExtraTrees(sklearn), glmnet (R) and some other models to diversify my final ensemble but none of them yielded significant individual performance.</p>\n\n<p><strong>Stacking pipeline</strong></p>\n\n<p>I used 10-fold stacking in this competiton and tried a number of preprocessing on the data:</p>\n\n<ul>\n<li>Different order interactions between categorical features.</li>\n<li>TF-IDF on categorical features.</li>\n<li><a href=\"https://github.com/entron/entity-embedding-rossmann\">Category Embedding</a> with NN and different embedding layer sizes.</li>\n<li>Standard Scalar/ Minmax scalar</li>\n<li>Different loss function in xgb incuding count:poisson on the rounded and log   transformed targets. Surprisingly it gave me a public LB of 1168.xx.</li>\n<li>Trained XGB on the bottom 5 and 10 percentile and top 70, 80 and 90 percentile of data. The motivation was to get a better estimate of the exorbitant loss values.</li>\n</ul>\n\n<p>I had a total of 81 models in the 1st level and trained an XGB and two NN on them on the second layer.</p>\n\n<p><strong>Best Second Level Model</strong>\nMy best L2 model has a 10-fold cv of 1114.645 and public LB 1097.87.</p>\n\n<p><strong>Final Submission</strong></p>\n\n<p>My final submission is an wegthed average of the following: </p>\n\n<ol>\n<li><code>w1*NN1^w2 + w3*NN2^w4 + w5*XGB1^w6 + w7</code> - weights optimized by using <code>optim</code> (Nelder-Mead) in a 1-fold manner =&gt; apply weights to test predictions =&gt; average 10 test predictions for 10x optimized weights.</li>\n<li>If NN1 &lt; w1 , then w2*NN1^w3 + w4 Else if  NN1 &gt; w5, then w6*NN1^w7\n        + w8 Else NN1</li>\n</ol>\n\n<p>I extend my congratulations to all other winners and my sincere thanks to Kaggle and Allstate group for arranging this exciting competition. </p>\n\n<p>Special thanks to Scirpus, Vladimir, Tilli, Lauea (as always), Danijel, d3miekno and all the other people who kept the forum so active all the time with their brilliant ideas and scripts :)</p>",
      "rawMarkdown": "Hi Guys,\r\n\r\nHere is a short summary of my final solution: Nothing extra-oridinary but a lot of diverse models and data preprocessing. So after my 1st submission which scored 1118 on public LB and I landed the 3rd position at the very beginning of the competiton, I thought I would give a try for my solo gold medal here. I had just relocated to a new city and joined a new company at that moment, but I tried my best to keep in touch with the leaderboard progression and hence update my models going ahead.\r\n\r\n**Best Single Model:**\r\n\r\nMy best single model is an XGBoost with the two-way interactions reported on the forum along with some chosen three, four, five and seven-way interactions. It score 1105.12 in the public LB with 10-fold CV around 1124. I chose the higher order interactions primarily based on mutual information. I used [fair_obj][1] with a constant of 0.7 for training that model and `(1 + loss)**0.25` transformation reported by [MrOijer][2].\r\n\r\n**My NN architecture**\r\n\r\nMy best NN scores 1110 in the public leaderboard with a 10-fold cv of 1134.xx. It is very similar to the [public scirpt scoring 1111.8x][3] , just some more neurons in each layer.  I used EarlyStopping, ModelCheckpoint and derived metric to monitor (I used `log(loss + SHIFT)` transformation) and 10-fold 10 times bagged model. Almost all my NN models follow the same architecture.\r\n\r\nI used mostly the above two models to train a stacked model (details later in the post) in the second layer, but there are other models with significant contribution. Among them:\r\n\r\n**Regularized Greedy Forest**\r\nI had three RGF mixed in to my ensemble trained with slighly different data and loss transformation. My best RGF scores 1113.xx with a cv around 1136.xx. It is a fantastic library that I explored back in BNP Paribas competiton and was determined to use it in one of my competitions. Just one setback is that it's a bit on the slower side being single-threaded.\r\n\r\n**LightGBM**\r\nAnother very fast and efficient gradient boosting library beside XGboost. I loved it. Best single model 1111.xx on public LB.\r\n\r\n**Vowpal Wabbit**\r\nAlways found it worth giving a shot and yes it beat random forest and extra trees which I never could get executed with `MAE` criterion in sklearn. Best single model 1133.xx with a cv of 1154.xx. I used quadtraic interactions in the categorical namespace.\r\n\r\n**LibFM**\r\nNot much from single model, but definitely helped my ensemble. Best model 1166.xx with 10-fold cv of 1188.xx.\r\n\r\n**LibFFM**\r\nAlmost at par with my VW. Best model 10-fold cv 1158.xx with public LB 1139.xx.\r\n\r\nI also used RF(R-h20), ExtraTrees(sklearn), glmnet (R) and some other models to diversify my final ensemble but none of them yielded significant individual performance.\r\n\r\n**Stacking pipeline**\r\n\r\nI used 10-fold stacking in this competiton and tried a number of preprocessing on the data:\r\n\r\n - Different order interactions between categorical features.\r\n - TF-IDF on categorical features.\r\n - [Category Embedding][4] with NN and different embedding layer sizes.\r\n - Standard Scalar/ Minmax scalar\r\n - Different loss function in xgb incuding count:poisson on the rounded and log   transformed targets. Surprisingly it gave me a public LB of 1168.xx.\r\n - Trained XGB on the bottom 5 and 10 percentile and top 70, 80 and 90 percentile of data. The motivation was to get a better estimate of the exorbitant loss values.\r\n\r\nI had a total of 81 models in the 1st level and trained an XGB and two NN on them on the second layer.\r\n\r\n**Best Second Level Model**\r\nMy best L2 model has a 10-fold cv of 1114.645 and public LB 1097.87.\r\n\r\n**Final Submission**\r\n\r\nMy final submission is an wegthed average of the following: \r\n    \r\n\r\n 1. `w1*NN1^w2 + w3*NN2^w4 + w5*XGB1^w6 + w7` - weights optimized by using `optim` (Nelder-Mead) in a 1-fold manner => apply weights to test predictions => average 10 test predictions for 10x optimized weights.\r\n 2. If NN1 < w1 , then w2*NN1^w3 + w4 Else if  NN1 > w5, then w6*NN1^w7\r\n            + w8 Else NN1\r\n\r\nI extend my congratulations to all other winners and my sincere thanks to Kaggle and Allstate group for arranging this exciting competition. \r\n\r\nSpecial thanks to Scirpus, Vladimir, Tilli, Lauea (as always), Danijel, d3miekno and all the other people who kept the forum so active all the time with their brilliant ideas and scripts :)\r\n\r\n  [1]: https://www.kaggle.com/c/allstate-claims-severity/forums/t/24520/effect-of-mae?forumMessageId=140255#post140255\r\n  [2]: https://www.kaggle.com/mrooijer\r\n  [3]: https://www.kaggle.com/mtinti/allstate-claims-severity/keras-starter-with-bagging-1111-84364/code\r\n  [4]: https://github.com/entron/entity-embedding-rossmann",
      "votes": 180
    },
    {
      "id": 149922,
      "postDate": "2016-12-13T07:35:54.940Z",
      "content": "<p>@DDgg: I am not aware of any such open/commercial software who will automate the whole stacking pipleline. There are libraries in both R and python to do the ensembling part for you but I haven't looked into those very deeply yet.</p>\n\n<p>@qianqian: My NN models took 24 hours on an average to complete. XGboost was much faster. None of my XGBoost models has an execution duration of more than 4 hours (I did 10-fold CV).</p>\n\n<p>@Balaji SR: I actually did not train on whole data. None of my models are trained on whole data as it was pretty tricky to find the optimum number of rounds. So I chose to do 10-fold CV average approach which also seemed quite stable in terms of CV-LB agreement. However, if I calculate the optimum round from my best model by the formula <code>average best round/ proportion sample in training set</code> it comes around 2700. 15000 seems too much, I think you were using a very small learning rate which resulted in large number of iterations. I tried to cut down the learning rate as well but that didn't improve my cv or lb. I almost always used learning rate = 0.03, the best number of rounds was pretty dependent on the <code>gamma</code> though.</p>\n\n<p>@Gippy: I calculated the mutual information between the interaction features and the transformed target. If you are looking for how to calculate MI, you can look into the packages like <a href=\"https://cran.r-project.org/web/packages/mRMRe/mRMRe.pdf\">mRMRe</a> or <a href=\"https://cran.r-project.org/web/packages/infotheo/infotheo.pdf\">infotheo</a>. In python, you can look into the function <a href=\"http://scikit-learn.org/stable/modules/generated/sklearn.metrics.mutual_info_score.html\">sklearn.metrics.mutual_info_score</a>. I took the interactions which had high MI score.</p>\n\n<p>@olivier: Thanks for the link. I actually came across that but didn't give it a try yet. Does it have cv support find the optimum model number given other parameters? I actually used my own wrapper in python for RGF but that is not multithreaded.</p>",
      "rawMarkdown": "@DDgg: I am not aware of any such open/commercial software who will automate the whole stacking pipleline. There are libraries in both R and python to do the ensembling part for you but I haven't looked into those very deeply yet.\r\n\r\n@qianqian: My NN models took 24 hours on an average to complete. XGboost was much faster. None of my XGBoost models has an execution duration of more than 4 hours (I did 10-fold CV).\r\n\r\n@Balaji SR: I actually did not train on whole data. None of my models are trained on whole data as it was pretty tricky to find the optimum number of rounds. So I chose to do 10-fold CV average approach which also seemed quite stable in terms of CV-LB agreement. However, if I calculate the optimum round from my best model by the formula `average best round/ proportion sample in training set` it comes around 2700. 15000 seems too much, I think you were using a very small learning rate which resulted in large number of iterations. I tried to cut down the learning rate as well but that didn't improve my cv or lb. I almost always used learning rate = 0.03, the best number of rounds was pretty dependent on the `gamma` though.\r\n\r\n@Gippy: I calculated the mutual information between the interaction features and the transformed target. If you are looking for how to calculate MI, you can look into the packages like [mRMRe][1] or [infotheo][2]. In python, you can look into the function [sklearn.metrics.mutual_info_score][3]. I took the interactions which had high MI score.\r\n\r\n@olivier: Thanks for the link. I actually came across that but didn't give it a try yet. Does it have cv support find the optimum model number given other parameters? I actually used my own wrapper in python for RGF but that is not multithreaded.\r\n\r\n\r\n  [1]: https://cran.r-project.org/web/packages/mRMRe/mRMRe.pdf\r\n  [2]: https://cran.r-project.org/web/packages/infotheo/infotheo.pdf\r\n  [3]: http://scikit-learn.org/stable/modules/generated/sklearn.metrics.mutual_info_score.html",
      "votes": 15
    },
    {
      "id": 149903,
      "postDate": "2016-12-13T06:05:29.923Z",
      "content": "<p>Congrats Bishwarup, not only for the win, but also for becoming the highest ranked Indian Kaggler when the rankings get updated! :)</p>",
      "rawMarkdown": "Congrats Bishwarup, not only for the win, but also for becoming the highest ranked Indian Kaggler when the rankings get updated! :)",
      "votes": 11
    },
    {
      "id": 150253,
      "postDate": "2016-12-14T12:06:16.590Z",
      "content": "<p>Excellent Bishwarup. The solution shows the amount of hard work that you have put in. Well deserved victory. Congratulations.!</p>\n\n<p>Congrats on the overall top 10 as well. Time to party :)  </p>",
      "rawMarkdown": "Excellent Bishwarup. The solution shows the amount of hard work that you have put in. Well deserved victory. Congratulations.!\r\n\r\nCongrats on the overall top 10 as well. Time to party :)  ",
      "votes": 9
    },
    {
      "id": 149948,
      "postDate": "2016-12-13T09:41:33.230Z",
      "content": "<p>Congrats! I'm happy to see that you got so much success from ensembling many models. I pushed my best xgboost to ~1103 MAE three weeks ago and didn't know how to make improvements anymore. Really nice to see the effect of ensembling of different variations. Learned a lot from you here, definitely saving your post :) </p>",
      "rawMarkdown": "Congrats! I'm happy to see that you got so much success from ensembling many models. I pushed my best xgboost to ~1103 MAE three weeks ago and didn't know how to make improvements anymore. Really nice to see the effect of ensembling of different variations. Learned a lot from you here, definitely saving your post :) ",
      "votes": 7,
      "replies": [
        {
          "id": 150017,
          "postDate": "2016-12-13T15:24:17.087Z",
          "content": "<p>[quote=Qingchen;149948]</p>\n\n<p>Congrats! I'm happy to see that you got so much success from ensembling many models. I pushed my best xgboost to ~1103 MAE three weeks ago and didn't know how to make improvements anymore.</p>\n\n<p>[/quote]\n1103 is very impressive. Could you please share code, hyperparameters, feature engineering?</p>",
          "rawMarkdown": "[quote=Qingchen;149948]\r\n\r\nCongrats! I'm happy to see that you got so much success from ensembling many models. I pushed my best xgboost to ~1103 MAE three weeks ago and didn't know how to make improvements anymore.\r\n\r\n[/quote]\r\n1103 is very impressive. Could you please share code, hyperparameters, feature engineering?",
          "votes": 3
        }
      ]
    },
    {
      "id": 149902,
      "postDate": "2016-12-13T06:01:16.833Z",
      "content": "<p>Thank you,\nmuch appreciated!</p>\n\n<p>Questions of course: <br>\n1) Is there an open/commercial pipeline/workflow that could <strong>match</strong> those results <strong>consistently</strong> <br>\n2) Is there an open or commercial pipeline/workflow that could <strong>deploy</strong> the whole solution  consistently  </p>\n\n<p>Basically, would it be feasible to implement a similar model <br>\nthat would consistently get good results on your proposed workflow.  </p>\n\n<p>Surely interesting for commercial/open ML providers for regression problems.  </p>",
      "rawMarkdown": "Thank you,\r\nmuch appreciated!\r\n\r\nQuestions of course:  \r\n1) Is there an open/commercial pipeline/workflow that could **match** those results **consistently**  \r\n2) Is there an open or commercial pipeline/workflow that could **deploy** the whole solution  consistently  \r\n\r\nBasically, would it be feasible to implement a similar model  \r\nthat would consistently get good results on your proposed workflow.  \r\n\r\nSurely interesting for commercial/open ML providers for regression problems.  \r\n\r\n",
      "votes": 3
    },
    {
      "id": 150706,
      "postDate": "2016-12-16T12:01:13.023Z",
      "content": "<p>@Gippy: I didn't use bootstrapping, I simply used oof-data for EarlyStopping.</p>\n\n<p>@ Ronin: I have written my own wrapper for VW in python for performing cross-validation and other stuff.</p>",
      "rawMarkdown": "@Gippy: I didn't use bootstrapping, I simply used oof-data for EarlyStopping.\r\n\r\n@ Ronin: I have written my own wrapper for VW in python for performing cross-validation and other stuff.",
      "votes": 1
    },
    {
      "id": 150356,
      "postDate": "2016-12-14T21:50:11.247Z",
      "content": "<p>Thank you so much for sharing such a great solution! I have a question about generating out-of-fold predictions from bagged models (e.g. your NN bag) for stacking. I assume you used the same 10-fold split (call it 'a') for all of your base models. When you generate the meta/oof features of your NN models do you do another 10-fold cv (call it 'b') on the training portion of (a), early stop each of the models based on the valid portion of (b), and bag them to make predictions/oof features on the valid fold of (a)? In another word are the meta features you computed via the first 10-fold cv(a) generated by a similar 10-fold 10 times bagged model on the training portions of (a)</p>\n\n<p>I wonder if this type of 'nested' cv is necessary for all kinds of bagged models when the individual ones are terminated by the validation set</p>\n\n<p>I am not sure of I have made myself clear. Let me know if it is still confusing.</p>",
      "rawMarkdown": "Thank you so much for sharing such a great solution! I have a question about generating out-of-fold predictions from bagged models (e.g. your NN bag) for stacking. I assume you used the same 10-fold split (call it 'a') for all of your base models. When you generate the meta/oof features of your NN models do you do another 10-fold cv (call it 'b') on the training portion of (a), early stop each of the models based on the valid portion of (b), and bag them to make predictions/oof features on the valid fold of (a)? In another word are the meta features you computed via the first 10-fold cv(a) generated by a similar 10-fold 10 times bagged model on the training portions of (a)\r\n\r\nI wonder if this type of 'nested' cv is necessary for all kinds of bagged models when the individual ones are terminated by the validation set\r\n\r\nI am not sure of I have made myself clear. Let me know if it is still confusing.",
      "votes": 1
    },
    {
      "id": 149941,
      "postDate": "2016-12-13T09:05:50.817Z",
      "content": "<p>@Engine: I tuned the parameter manually for RGF (RGF, reg_L2 = 0.035, min_pop = 80, max_leaf_forest = 4500). Without interaction it took around 3.5 hrs and with interaction around 7 hours.</p>\n\n<p>@Evgeny_Semyonov: I used Ubuntu15.10 for the VW model. I used python to convert the data into vw format and execute the command line from within the script only. For your second query, the idea is when the NN (second layer) predicts low and higher value, I optimized the adjustment parameters differently.</p>",
      "rawMarkdown": "@Engine: I tuned the parameter manually for RGF (RGF, reg_L2 = 0.035, min_pop = 80, max_leaf_forest = 4500). Without interaction it took around 3.5 hrs and with interaction around 7 hours.\r\n\r\n@Evgeny_Semyonov: I used Ubuntu15.10 for the VW model. I used python to convert the data into vw format and execute the command line from within the script only. For your second query, the idea is when the NN (second layer) predicts low and higher value, I optimized the adjustment parameters differently.",
      "votes": 1
    },
    {
      "id": 149937,
      "postDate": "2016-12-13T08:57:48.990Z",
      "content": "<p>Congrats Bishwarup. great achievement.</p>",
      "rawMarkdown": "Congrats Bishwarup. great achievement.\r\n",
      "votes": 1
    },
    {
      "id": 149920,
      "postDate": "2016-12-13T07:24:41.397Z",
      "content": "<p>Bishwarup Congratulations ! <br>\nThank you for detailing your solution in this way. \nThese algos will certainly end up in my arsenal. \nYou're probably aware but just in case, there's a multi core RGF available here: <a href=\"https://github.com/baidu/fast_rgf\">https://github.com/baidu/fast_rgf</a>\nI still need to test it though.</p>",
      "rawMarkdown": "Bishwarup Congratulations !  \r\nThank you for detailing your solution in this way. \r\nThese algos will certainly end up in my arsenal. \r\nYou're probably aware but just in case, there's a multi core RGF available here: https://github.com/baidu/fast_rgf\r\nI still need to test it though.\r\n",
      "votes": 1
    },
    {
      "id": 154664,
      "postDate": "2017-01-07T14:18:10.450Z",
      "content": "<p>@Bishwarup B Thanks for sharing the solution. Can you please share the code as well?</p>",
      "rawMarkdown": "@Bishwarup B Thanks for sharing the solution. Can you please share the code as well?\r\n",
      "votes": 2
    },
    {
      "id": 150635,
      "postDate": "2016-12-16T05:05:14.267Z",
      "content": "<p>How did you perform your CV in VW?  Did you do it manually?  I've always had trouble optimizing VW as the \"scoring\" functions used in competitions tend not to be implemented directly in vw (although the quintile loss function seemed to be working well this competition) as well as having to manually split the data set.</p>\n\n<p>I've never had good luck with the VW wrappers, although the program itself is slick as snot once I figured out what I was doing.</p>",
      "rawMarkdown": "How did you perform your CV in VW?  Did you do it manually?  I've always had trouble optimizing VW as the \"scoring\" functions used in competitions tend not to be implemented directly in vw (although the quintile loss function seemed to be working well this competition) as well as having to manually split the data set.\r\n\r\nI've never had good luck with the VW wrappers, although the program itself is slick as snot once I figured out what I was doing.",
      "votes": 2
    },
    {
      "id": 150416,
      "postDate": "2016-12-15T02:58:56.450Z",
      "content": "<p>And for python: <a href=\"https://docs.scipy.org/doc/scipy-0.18.1/reference/optimize.minimize-neldermead.html\">https://docs.scipy.org/doc/scipy-0.18.1/reference/optimize.minimize-neldermead.html</a></p>",
      "rawMarkdown": "And for python: [https://docs.scipy.org/doc/scipy-0.18.1/reference/optimize.minimize-neldermead.html][1]\r\n\r\n\r\n  [1]: https://docs.scipy.org/doc/scipy-0.18.1/reference/optimize.minimize-neldermead.html",
      "votes": 2,
      "replies": [
        {
          "id": 2186320,
          "postDate": "2023-03-17T17:53:46.860Z",
          "content": "<p>This is helpful. Thanks. </p>",
          "rawMarkdown": "This is helpful. Thanks. "
        }
      ]
    },
    {
      "id": 149927,
      "postDate": "2016-12-13T07:44:44.397Z",
      "content": "<p>Congratulations!  Very cool solution.</p>\n\n<p>Questions: </p>\n\n<p>1) i tried to use Vowpal Wabbit, but it's terrible on Windows. What's your platform?(Windows/Unix)\nAn did you use it from Python or converted data to Vowpal Wabbit format and start from console?</p>\n\n<p>2) \"If NN1 &lt; w1 , then w2*NN1^w3 + w4 Else if NN1 &gt; w5, then w6*NN1^w7 + w8 Else NN1\". </p>\n\n<p>NN1 - it's predictions from Neural second level model  and w1 - it's weitht (scalar)? How can we compare them?</p>",
      "rawMarkdown": "Congratulations!  Very cool solution.\r\n\r\nQuestions: \r\n\r\n1) i tried to use Vowpal Wabbit, but it's terrible on Windows. What's your platform?(Windows/Unix)\r\nAn did you use it from Python or converted data to Vowpal Wabbit format and start from console?\r\n\r\n2) \"If NN1 < w1 , then w2*NN1^w3 + w4 Else if NN1 > w5, then w6*NN1^w7 + w8 Else NN1\". \r\n\r\nNN1 - it's predictions from Neural second level model  and w1 - it's weitht (scalar)? How can we compare them?",
      "votes": 2
    },
    {
      "id": 149923,
      "postDate": "2016-12-13T07:37:03.353Z",
      "content": "<p>congratulations for the 1st place!\nTell, please, about parameters of RGF (algorithm modification (RGF|RGF Opt|RGF Sib), num of leaves, kind of regularization parameters). How much of time takes for rgf to make prediction? \nThanks for sharing your ideas</p>",
      "rawMarkdown": "congratulations for the 1st place!\r\nTell, please, about parameters of RGF (algorithm modification (RGF|RGF Opt|RGF Sib), num of leaves, kind of regularization parameters). How much of time takes for rgf to make prediction? \r\nThanks for sharing your ideas",
      "votes": 2
    },
    {
      "id": 149917,
      "postDate": "2016-12-13T07:16:37.597Z",
      "content": "<p>So this is what it takes. Phew! Congratulations :)</p>",
      "rawMarkdown": "So this is what it takes. Phew! Congratulations :)",
      "votes": 2
    },
    {
      "id": 970385,
      "postDate": "2020-08-14T12:03:20.523Z",
      "content": "<p>Thank you, it is really helpful to new guys like me ^^.</p>",
      "rawMarkdown": "Thank you, it is really helpful to new guys like me ^^."
    },
    {
      "id": 261183,
      "postDate": "2017-12-22T00:21:34.733Z",
      "content": "<p>Thanks for sharing. That is really helpful!</p>",
      "rawMarkdown": "Thanks for sharing. That is really helpful!"
    },
    {
      "id": 169239,
      "postDate": "2017-03-20T08:16:19.507Z",
      "content": "<p>Thx for sharing your strategy.</p>",
      "rawMarkdown": "Thx for sharing your strategy."
    },
    {
      "id": 162633,
      "postDate": "2017-02-20T11:45:17.850Z",
      "content": "<p>Many congrats Bishwarup B!!!!. Could you please share your code also.</p>",
      "rawMarkdown": "Many congrats Bishwarup B!!!!. Could you please share your code also."
    },
    {
      "id": 150903,
      "postDate": "2016-12-17T12:51:55.397Z",
      "content": "<p>@Gippy: I didn't change any parameter as such, just the random_seed to make the model more robust as NN is very sentsitive to noise in the data.</p>",
      "rawMarkdown": "@Gippy: I didn't change any parameter as such, just the random_seed to make the model more robust as NN is very sentsitive to noise in the data."
    },
    {
      "id": 150718,
      "postDate": "2016-12-16T13:30:04.677Z",
      "content": "<p>@Bishwarup: Then can you please let me know what do you mean by 10 bags for each fold? What parameter do you change for each bag? Thanks</p>",
      "rawMarkdown": "@Bishwarup: Then can you please let me know what do you mean by 10 bags for each fold? What parameter do you change for each bag? Thanks"
    },
    {
      "id": 150506,
      "postDate": "2016-12-15T13:38:28.027Z",
      "content": "<p>@Bishwarup: 10 fold 10 bags: Does it mean that for every fold, you take bootstrap sample (10 times) and use that for training (if yes, then do you use the oob data for early stopping or oof fold data for early stopping). Or have i misunderstood the approach? Thanks</p>",
      "rawMarkdown": "@Bishwarup: 10 fold 10 bags: Does it mean that for every fold, you take bootstrap sample (10 times) and use that for training (if yes, then do you use the oob data for early stopping or oof fold data for early stopping). Or have i misunderstood the approach? Thanks"
    },
    {
      "id": 150490,
      "postDate": "2016-12-15T12:22:42.593Z",
      "content": "<p>@Achal: I used percentile based binning.</p>\n\n<p>@ SRK: Thanks man :)</p>\n\n<p>@ deltap: 10 fold 10 bags -&gt; so 100 folds in total -&gt; EarlyStopping in each of the folds -&gt; predict oof and test -&gt; average test for all the 100 runs.</p>\n\n<p>@Finaly Liu: I think ClusterFork and Tony already cleared your doubts.</p>",
      "rawMarkdown": "@Achal: I used percentile based binning.\r\n\r\n@ SRK: Thanks man :)\r\n\r\n@ deltap: 10 fold 10 bags -> so 100 folds in total -> EarlyStopping in each of the folds -> predict oof and test -> average test for all the 100 runs.\r\n\r\n@Finaly Liu: I think ClusterFork and Tony already cleared your doubts.\r\n"
    },
    {
      "id": 150406,
      "postDate": "2016-12-15T02:17:41.223Z",
      "content": "<p>optim (Nelder-Mead) , what does this mean?</p>",
      "rawMarkdown": "optim (Nelder-Mead) , what does this mean?",
      "replies": [
        {
          "id": 150414,
          "postDate": "2016-12-15T02:55:29.700Z",
          "content": "<p>[quote=Finlay Liu;150406]</p>\n\n<p>optim (Nelder-Mead) , what does this mean?</p>\n\n<p>[/quote]\n?optim in R console:</p>\n\n<p>optim {stats}   R Documentation\nGeneral-purpose Optimization</p>\n\n<p>Description</p>\n\n<p>General-purpose optimization based on Nelder–Mead, quasi-Newton and conjugate-gradient algorithms. It includes an option for box-constrained optimization and simulated annealing.</p>",
          "rawMarkdown": "[quote=Finlay Liu;150406]\r\n\r\noptim (Nelder-Mead) , what does this mean?\r\n\r\n[/quote]\r\n?optim in R console:\r\n\r\noptim {stats}\tR Documentation\r\nGeneral-purpose Optimization\r\n\r\nDescription\r\n\r\nGeneral-purpose optimization based on Nelder–Mead, quasi-Newton and conjugate-gradient algorithms. It includes an option for box-constrained optimization and simulated annealing.\r\n"
        }
      ]
    },
    {
      "id": 150076,
      "postDate": "2016-12-13T19:14:10.190Z",
      "content": "<blockquote>\n  <p>\"I chose the higher order interactions primarily based on mutual\n  information\"</p>\n  \n  <p>\" I calculated the mutual information between the interaction features\n  and the transformed target. If you are looking for how to calculate\n  MI, you can look into the packages like mRMRe or infotheo. In python,\n  you can look into the function sklearn.metrics.mutual_info_score. I\n  took the interactions which had high MI score.\"</p>\n</blockquote>\n\n<p>Did you calculate mutual information among all categorical features, right? Our loss function is continuous, so how did you calculate MI to calculate interactions? Any readings or link will be helpful.</p>",
      "rawMarkdown": "> \"I chose the higher order interactions primarily based on mutual\r\n> information\"\r\n> \r\n> \" I calculated the mutual information between the interaction features\r\n> and the transformed target. If you are looking for how to calculate\r\n> MI, you can look into the packages like mRMRe or infotheo. In python,\r\n> you can look into the function sklearn.metrics.mutual_info_score. I\r\n> took the interactions which had high MI score.\"\r\n\r\n\r\nDid you calculate mutual information among all categorical features, right? Our loss function is continuous, so how did you calculate MI to calculate interactions? Any readings or link will be helpful."
    },
    {
      "id": 150021,
      "postDate": "2016-12-13T15:36:33.727Z",
      "content": "<p>Congrats Bishwarup!  Thanks for the play-by-play.</p>",
      "rawMarkdown": "Congrats Bishwarup!  Thanks for the play-by-play."
    },
    {
      "id": 150020,
      "postDate": "2016-12-13T15:29:45.517Z",
      "content": "<p>I have tried to use vowpal and max CV I got was around 1165.  Need some tuning tips for vowpal. I also tried to use RGF during last couple of days but not able to complete the training. I found your solution easy to understand as compared to others Multilayer stacking.. and will use some of the tips in near future.</p>",
      "rawMarkdown": "I have tried to use vowpal and max CV I got was around 1165.  Need some tuning tips for vowpal. I also tried to use RGF during last couple of days but not able to complete the training. I found your solution easy to understand as compared to others Multilayer stacking.. and will use some of the tips in near future."
    },
    {
      "id": 150001,
      "postDate": "2016-12-13T14:08:13.037Z",
      "content": "<p>Congratulations Bishwarup B.This was my first competition I never even thought about ensembling many models.Thanks for explaining your solution.</p>",
      "rawMarkdown": "Congratulations Bishwarup B.This was my first competition I never even thought about ensembling many models.Thanks for explaining your solution."
    },
    {
      "id": 149918,
      "postDate": "2016-12-13T07:21:06.597Z",
      "content": "<p>Congrats for the 1st Rank and thanks for sharing your approach. I have one question: Can you please explain \"higher order interactions primarily based on mutual information\"? Thanks</p>",
      "rawMarkdown": "Congrats for the 1st Rank and thanks for sharing your approach. I have one question: Can you please explain \"higher order interactions primarily based on mutual information\"? Thanks\r\n\r\n"
    },
    {
      "id": 149910,
      "postDate": "2016-12-13T06:40:55.803Z",
      "content": "<p>Gongrats with #1st place and thank you very much for sharing solution</p>",
      "rawMarkdown": "Gongrats with #1st place and thank you very much for sharing solution"
    },
    {
      "id": 149908,
      "postDate": "2016-12-13T06:29:33.187Z",
      "content": "<p>Bishwarup Congratulations!</p>\n\n<p>If you do not mind,May I know number of rounds in your best xgboost model. Mine went beyond 15000 and did not try more than that.</p>\n\n<p>Thanks</p>",
      "rawMarkdown": "Bishwarup Congratulations!\r\n\r\nIf you do not mind,May I know number of rounds in your best xgboost model. Mine went beyond 15000 and did not try more than that.\r\n\r\nThanks"
    },
    {
      "id": 149907,
      "postDate": "2016-12-13T06:28:07.327Z",
      "content": "<p>Genius :)</p>",
      "rawMarkdown": "Genius :)"
    },
    {
      "id": 149905,
      "postDate": "2016-12-13T06:23:39.387Z",
      "content": "<p>Congratulations!  Awesome work! Btw I am curious about how long it took to run all these models.</p>",
      "rawMarkdown": "Congratulations!  Awesome work! Btw I am curious about how long it took to run all these models."
    },
    {
      "id": 149904,
      "postDate": "2016-12-13T06:11:42.260Z",
      "content": "<p>congratulation  and Thanks for sharing your solution.</p>",
      "rawMarkdown": "congratulation  and Thanks for sharing your solution."
    },
    {
      "id": 150011,
      "postDate": "2016-12-13T14:53:35.440Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 1913465,
      "postDate": "2022-08-25T10:33:50.040Z",
      "content": "<p>Thanks for sharing</p>",
      "rawMarkdown": "Thanks for sharing"
    },
    {
      "id": 150984,
      "postDate": "2016-12-18T03:15:11.007Z",
      "content": "<p>Congrats and Thanks for sharing.</p>",
      "rawMarkdown": "Congrats and Thanks for sharing."
    },
    {
      "id": 150522,
      "postDate": "2016-12-15T15:05:05.073Z",
      "content": "<p>Thanks for sharing!</p>",
      "rawMarkdown": "Thanks for sharing!\r\n\r\n "
    },
    {
      "id": 149991,
      "postDate": "2016-12-13T13:20:00.253Z",
      "content": "<p>Thank you.</p>",
      "rawMarkdown": "Thank you."
    },
    {
      "id": 149900,
      "postDate": "2016-12-13T05:50:17.413Z",
      "content": "<p>Learn a lot from your solution! Thanks~</p>",
      "rawMarkdown": "Learn a lot from your solution! Thanks~"
    },
    {
      "id": 149897,
      "postDate": "2016-12-13T05:30:24.663Z",
      "content": "<p>Great solution! Thanks!</p>",
      "rawMarkdown": "Great solution! Thanks!"
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T17:15:48Z",
  "competition_id": 5325,
  "competition_slug": "allstate-claims-severity",
  "team_id": 385195,
  "solution_url": "/competitions/allstate-claims-severity/writeups/bishwarup-b-1st-place-solution"
}