{
  "id": 38100,
  "title": "9th place Approach",
  "content": "<p>Congrats to the winners - great work!</p>\n\n<p>I am committed to sharing my approach every time I get a good position. I will share my approach even though I am pretty sure the top competitors' approaches will be far more useful. Generally I did not expect to get that high, given that I never even managed to make the metric working internally - I was optimising using <strong>log loss</strong> the whole time . By the way, if anybody has an implementation of f1_score (not the one is sklearn that seemed to be off in my case) for python that would be great! No wonder I over-fitted private LB a bit as I used public LB to find the right cut-off to the F1 optimizer. </p>\n\n<p>(I also shamelessly invite you to follow <a href=\"https://www.facebook.com/StackNet/\">my new FB page</a> where I will share insight about using data science tools and approaches)</p>\n\n<p>Using the forums/kernels has been very useful in this competition . My score has been greatly boosted by:</p>\n\n<ul>\n<li><a href=\"https://www.kaggle.com/mmueller/f1-score-expectation-maximization-in-o-n\">Farons F1 optimizer script</a> </li>\n<li><a href=\"https://www.kaggle.com/c/instacart-market-basket-analysis/discussion/37697\">Sh1ng fetaures</a> and <a href=\"https://github.com/sh1ng/arboretum\">arboretum</a> too</li>\n<li><a href=\"https://www.kaggle.com/mmueller/order-streaks-feature\">Faron's Streaks</a></li>\n<li>Features from <a href=\"https://www.kaggle.com/paulantoine/light-gbm-benchmark-0-3692/code\">this script</a></li>\n<li>And the features from <a href=\"https://www.kaggle.com/nickycan/lb-0-3805009-python-edition\">this script</a></li>\n</ul>\n\n<p>I give big credit for arboretum. I found it (obviously faster and) more accurate than xgboost ( but not by much) . Lightgbm was still my best (and faster) sinlge model on a set of 300 features (all the above plus some of mine ) with these params:</p>\n\n<pre><code>LightgbmClassifier boosting:dart num_leaves:22 num_iterations:3000  max_drop:5 drop_rate:0.01 categorical_feature:0,1,2* learning_rate:0.12 threads:12 max_depth:7 feature_fraction:0.7 min_data_in_leaf:10  bagging_fraction:0.85 lambda_l1:1 lambda_l2:0.01 bagging_freq:1 seed:1 verbose:false\n</code></pre>\n\n<ul>\n<li>categorical_feature:0,1,2  are product, aisle and departement.</li>\n</ul>\n\n<p>I made a separate simple model to predict <strong>None or not</strong> for each offer and fed it to the f1 optimiser.</p>\n\n<p>My own (extra) features included:</p>\n\n<ul>\n<li>counts of purchased items/aisle/deps per customer in different intervals . (like last 15, 30 days etc)</li>\n<li>Timing features. like when was the last time the item was bought.</li>\n<li>Likelihoods on various categorical features including products, aisles, deps</li>\n<li>Cart position of the item and features around this area were also useful. Average position of item and  features that show the shift in cart position over time</li>\n<li>Cardinality features like number of different departments, products, asiles the customer shops from</li>\n<li>User-based features showing the tendency of buying new items -e.g average proportion of new items in each order.</li>\n</ul>\n\n<p>Things that did not work:</p>\n\n<ul>\n<li>Making a model per product/aisle/department. </li>\n<li>Collaborative filtering</li>\n<li>Exploring the description of items. E.g text analysis was useless. </li>\n</ul>\n\n<p>For Stacking I used both StackNet and separate Stacking (e.g. used the output of Stacknet on another meta - see below) . I ensembled around 15 models - mostly lightgbms , <a href=\"http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science.html\">H2o algos</a> and <a href=\"https://keras.io/\">keras</a>' nns.  However i did not get that much from Stacking in this competition. It was much more important the metric's optimisation and the feature engineering.</p>\n\n<p>My best final meta model was an NN using keras and theano. The structure was this:</p>\n\n<pre><code>models = Sequential()\nmodels.add(Dense(output_dim=1024, input_dim=input_d, init='lecun_uniform')) \nmodels.add(Activation('relu')) \nmodels.add(BatchNormalization())    \nmodels.add(Dropout(0.5))  \nmodels.add(Dense(512, activation='relu',init='lecun_uniform'))\nmodels.add(Activation('relu')) \nmodels.add(BatchNormalization())    \nmodels.add(Dropout(0.4))  \nmodels.add(Dense(2, init='lecun_uniform'))\nmodels.add(Activation('softmax'))    \nopt = optimizers.Adam(lr=0.01)\nmodels.compile(loss='binary_crossentropy', optimizer=opt)\n</code></pre>\n\n<p>For the f1 optimizer I used <strong>probabilities higher than 0.005.</strong></p>",
  "comments": [
    {
      "id": 213750,
      "author_name": "CPMP",
      "author_url": "",
      "post_date": "2017-08-15T07:10:27.663000",
      "content": "<p>Congrats, and thanks for sharing.  Your LB climb in the last few days was very impressive.</p>\n\n<p>I also found sklearn f1 score to be deceptive as a metric.  I also had no luck with 3 collaborative filtering models I tried.</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 213666,
      "author_name": "",
      "author_url": "",
      "post_date": "2017-08-15T03:30:32.570000",
      "content": "<p>Thanks so much.\nYou did really good.\nI really hope you share some of the code and add it to stacknet examples.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 213614,
      "author_name": "Chia-Ta Tsai",
      "author_url": "",
      "post_date": "2017-08-15T01:57:12.043000",
      "content": "<p>Congrats and thanks for sharing. I am wondering how to tune dart for a while, it always performed worse and slow than gbdt.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 213624,
          "author_name": "Serigne ",
          "author_url": "",
          "post_date": "2017-08-15T02:09:31.233000",
          "content": "<p>Haha same here !!!\ndart performed far worse on my model. I don't why it performed better on kazanova's ^^</p>\n\n<p>Anyway I really need to learn proper ML and dealing with overfit from Kaggle grandmasters ^^</p>\n\n<p>BTW Congrats Kazanova . Hopefully I will learn and use Stacknet soon :-)</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 213787,
          "author_name": "Μαριος Μιχαηλιδης KazAnova",
          "author_url": "",
          "post_date": "2017-08-15T08:57:50.900000",
          "content": "<p>dart almost always performs better than <strong>gbdt</strong> for me. the trick is to put high learning rate to offset the drop-rate. </p>",
          "votes": 8,
          "replies": []
        },
        {
          "id": 213836,
          "author_name": "Serigne ",
          "author_url": "",
          "post_date": "2017-08-15T11:20:13.743000",
          "content": "<p>Thanks Kazanova for the answer and for the trick </p>\n\n<p>At the first look , I said the learning rate is too huge given the number of iterations. But  didn't know it can help this way. </p>\n\n<p>Yeah documentation says dart perform usually better too.  I will give it a try again next time and will try to tune  accordingly the others parameters. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 213866,
          "author_name": "Chia-Ta Tsai",
          "author_url": "",
          "post_date": "2017-08-15T12:39:14.130000",
          "content": "<p>Indeed, dart should have the possibility to preform better for me due to its dropout mechanism. This is what I wondered and contrasted to my on-hand experience. I guess I was doing it wrong as trees in forest were too strong to make dropout work. If every tree is weak and shallow, it would make less impact to the boosting forest while drop out trees. Thanks for sharing!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 213724,
      "author_name": "Sameh Faidi",
      "author_url": "",
      "post_date": "2017-08-15T05:46:33.947000",
      "content": "<p>just curious, \"For the f1 optimizer I used probabilities higher than 0.005.\" how much difference this made to your score compared to using all probabilties?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 213786,
          "author_name": "Μαριος Μιχαηλιδης KazAnova",
          "author_url": "",
          "post_date": "2017-08-15T08:56:32.300000",
          "content": "<p>the difference between 0.01 and 0.005 was 0.00005 , lets say from .4082160  to 0.4082660</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 213688,
      "author_name": "GeorgeGui",
      "author_url": "",
      "post_date": "2017-08-15T04:14:22.430000",
      "content": "<p>Thanks a lot, KazAnova. I was trying to use your StackNet to do the stacking but gave up because it seems ideal to train all the model using StackNet? May I know your workflow using StackNet? It seems that one option is to put all the preprocessed features into csv and then use StackNet to train it? If this is the case, do you experiment and tune different models separately at first in python or R and then start to use StackNet to train them all over again near the end? Or do you plug in the output of these different models into StackNet? Sorry if any of these may sound like stupid questions due to my lack of understanding of the tool. </p>",
      "votes": 2,
      "replies": [
        {
          "id": 214001,
          "author_name": "Μαριος Μιχαηλιδης KazAnova",
          "author_url": "",
          "post_date": "2017-08-15T17:34:21.877000",
          "content": "<p>I actually use only StackNet for tuning , but I put only 1 model for 1st layer and a dummy one (lets say a logistic regression)  for the second layer . Then I keep tuning the parameters of the first model doing one change at a time. For example I will change max_depth from 5 to 6 and keep note of the improvement (or not)  in  validation . Once I am done with one Algorithm (e.g not further improvement) , I replace  with another algorithm . Once I am done with all algorithms , I put them all together and I run a full StackNet, saving the outputs. Then I can run a second stack net on the outputs,</p>\n\n<p>For more information, please have a look at the Tip: <a href=\"http://blog.kaggle.com/2017/06/15/stacking-made-easy-an-introduction-to-stacknet-by-competitions-grandmaster-marios-michailidis-kazanova/\">To tune a single model, one may choose an algorithm...</a></p>\n\n<p>I have also included some slides you can get <a href=\"http://www.filedropper.com/stacknetmeta-modellingframework\">from this link</a> , that also include the above tip in a more visual way.</p>\n\n<p>Let me know if these help.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 214010,
          "author_name": "",
          "author_url": "",
          "post_date": "2017-08-15T17:58:46.660000",
          "content": "<p>but what about num_rounds for xgboost or lgb, do you use the same method you mentioned? and if so in what increments?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 214074,
          "author_name": "GeorgeGui",
          "author_url": "",
          "post_date": "2017-08-15T22:25:56.780000",
          "content": "<p>Thanks @KazAnova! This is really helpful! So it seems that apart from data cleaning and feature engineering, all the rest is done in StackNet. Another question I have is the data format: is uncompressed csv the only supported format for StackNet? It seems that when you have 300 features,  the disk space needed is huge. </p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 214076,
          "author_name": "Μαριος Μιχαηλιδης KazAnova",
          "author_url": "",
          "post_date": "2017-08-15T22:28:14.183000",
          "content": "<p><a href=\"https://github.com/kaz-Anova/StackNet#data-format\">Sparse format </a> is supported too  . Most of the times I use the sparse format. You also need to put </p>\n\n<pre><code>sparse=true\n</code></pre>\n\n<p>in the command line.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 214079,
          "author_name": "GeorgeGui",
          "author_url": "",
          "post_date": "2017-08-15T22:33:11.320000",
          "content": "<p>I see; most of my features in this competition were dense so I have not considered using the sparse format. Will try it in the future, thanks!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 222943,
      "author_name": "DanilaSavenkov",
      "author_url": "",
      "post_date": "2017-09-20T16:42:09.880000",
      "content": "<p>Thank you very much for sharing.\nCould you please elaborate more on 'Likelihoods on various categorical features including products, aisles, deps'. What exactly do you mean by this?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 213687,
      "author_name": "plantsgo",
      "author_url": "",
      "post_date": "2017-08-15T04:09:56.237000",
      "content": "<p>Congrats ,300 features amazing...Which and how many meta-features of the NN meta model's input?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 214002,
          "author_name": "Μαριος Μιχαηλιδης KazAnova",
          "author_url": "",
          "post_date": "2017-08-15T17:36:48.327000",
          "content": "<p>I had around 40...but only 15 models. Actually I forgot to mention this. apart from the normal predictions of these 15 models, I also created ranks per customer. Like X times was ranked ith for the Z customer. This made it 30 features.</p>\n\n<p>Then I also included  a more aggregate features per customer and some flags for whether it is a new item (to capture 'None's) </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 213712,
      "author_name": "YaGana Sheriff-Hussaini",
      "author_url": "",
      "post_date": "2017-08-15T05:11:35.947000",
      "content": "<p>Thanks for sharing.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 213610,
      "author_name": "StuartLu",
      "author_url": "",
      "post_date": "2017-08-15T01:52:17.917000",
      "content": "<p>Thanks for the sharing!</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "comment_count": 20,
  "messages": [
    {
      "id": 213589,
      "postDate": "2017-08-15T01:21:39.460Z",
      "content": "<p>Congrats to the winners - great work!</p>\n\n<p>I am committed to sharing my approach every time I get a good position. I will share my approach even though I am pretty sure the top competitors' approaches will be far more useful. Generally I did not expect to get that high, given that I never even managed to make the metric working internally - I was optimising using <strong>log loss</strong> the whole time . By the way, if anybody has an implementation of f1_score (not the one is sklearn that seemed to be off in my case) for python that would be great! No wonder I over-fitted private LB a bit as I used public LB to find the right cut-off to the F1 optimizer. </p>\n\n<p>(I also shamelessly invite you to follow <a href=\"https://www.facebook.com/StackNet/\">my new FB page</a> where I will share insight about using data science tools and approaches)</p>\n\n<p>Using the forums/kernels has been very useful in this competition . My score has been greatly boosted by:</p>\n\n<ul>\n<li><a href=\"https://www.kaggle.com/mmueller/f1-score-expectation-maximization-in-o-n\">Farons F1 optimizer script</a> </li>\n<li><a href=\"https://www.kaggle.com/c/instacart-market-basket-analysis/discussion/37697\">Sh1ng fetaures</a> and <a href=\"https://github.com/sh1ng/arboretum\">arboretum</a> too</li>\n<li><a href=\"https://www.kaggle.com/mmueller/order-streaks-feature\">Faron's Streaks</a></li>\n<li>Features from <a href=\"https://www.kaggle.com/paulantoine/light-gbm-benchmark-0-3692/code\">this script</a></li>\n<li>And the features from <a href=\"https://www.kaggle.com/nickycan/lb-0-3805009-python-edition\">this script</a></li>\n</ul>\n\n<p>I give big credit for arboretum. I found it (obviously faster and) more accurate than xgboost ( but not by much) . Lightgbm was still my best (and faster) sinlge model on a set of 300 features (all the above plus some of mine ) with these params:</p>\n\n<pre><code>LightgbmClassifier boosting:dart num_leaves:22 num_iterations:3000  max_drop:5 drop_rate:0.01 categorical_feature:0,1,2* learning_rate:0.12 threads:12 max_depth:7 feature_fraction:0.7 min_data_in_leaf:10  bagging_fraction:0.85 lambda_l1:1 lambda_l2:0.01 bagging_freq:1 seed:1 verbose:false\n</code></pre>\n\n<ul>\n<li>categorical_feature:0,1,2  are product, aisle and departement.</li>\n</ul>\n\n<p>I made a separate simple model to predict <strong>None or not</strong> for each offer and fed it to the f1 optimiser.</p>\n\n<p>My own (extra) features included:</p>\n\n<ul>\n<li>counts of purchased items/aisle/deps per customer in different intervals . (like last 15, 30 days etc)</li>\n<li>Timing features. like when was the last time the item was bought.</li>\n<li>Likelihoods on various categorical features including products, aisles, deps</li>\n<li>Cart position of the item and features around this area were also useful. Average position of item and  features that show the shift in cart position over time</li>\n<li>Cardinality features like number of different departments, products, asiles the customer shops from</li>\n<li>User-based features showing the tendency of buying new items -e.g average proportion of new items in each order.</li>\n</ul>\n\n<p>Things that did not work:</p>\n\n<ul>\n<li>Making a model per product/aisle/department. </li>\n<li>Collaborative filtering</li>\n<li>Exploring the description of items. E.g text analysis was useless. </li>\n</ul>\n\n<p>For Stacking I used both StackNet and separate Stacking (e.g. used the output of Stacknet on another meta - see below) . I ensembled around 15 models - mostly lightgbms , <a href=\"http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science.html\">H2o algos</a> and <a href=\"https://keras.io/\">keras</a>' nns.  However i did not get that much from Stacking in this competition. It was much more important the metric's optimisation and the feature engineering.</p>\n\n<p>My best final meta model was an NN using keras and theano. The structure was this:</p>\n\n<pre><code>models = Sequential()\nmodels.add(Dense(output_dim=1024, input_dim=input_d, init='lecun_uniform')) \nmodels.add(Activation('relu')) \nmodels.add(BatchNormalization())    \nmodels.add(Dropout(0.5))  \nmodels.add(Dense(512, activation='relu',init='lecun_uniform'))\nmodels.add(Activation('relu')) \nmodels.add(BatchNormalization())    \nmodels.add(Dropout(0.4))  \nmodels.add(Dense(2, init='lecun_uniform'))\nmodels.add(Activation('softmax'))    \nopt = optimizers.Adam(lr=0.01)\nmodels.compile(loss='binary_crossentropy', optimizer=opt)\n</code></pre>\n\n<p>For the f1 optimizer I used <strong>probabilities higher than 0.005.</strong></p>",
      "rawMarkdown": "Congrats to the winners - great work!\n\nI am committed to sharing my approach every time I get a good position. I will share my approach even though I am pretty sure the top competitors' approaches will be far more useful. Generally I did not expect to get that high, given that I never even managed to make the metric working internally - I was optimising using **log loss** the whole time . By the way, if anybody has an implementation of f1_score (not the one is sklearn that seemed to be off in my case) for python that would be great! No wonder I over-fitted private LB a bit as I used public LB to find the right cut-off to the F1 optimizer. \n\n(I also shamelessly invite you to follow [my new FB page][1] where I will share insight about using data science tools and approaches)\n\nUsing the forums/kernels has been very useful in this competition . My score has been greatly boosted by:\n\n - [Farons F1 optimizer script][2] \n - [Sh1ng fetaures][3] and [arboretum][4] too\n - [Faron's Streaks][5]\n - Features from [this script][6]\n - And the features from [this script][7]\n\nI give big credit for arboretum. I found it (obviously faster and) more accurate than xgboost ( but not by much) . Lightgbm was still my best (and faster) sinlge model on a set of 300 features (all the above plus some of mine ) with these params:\n\n    LightgbmClassifier boosting:dart num_leaves:22 num_iterations:3000  max_drop:5 drop_rate:0.01 categorical_feature:0,1,2* learning_rate:0.12 threads:12 max_depth:7 feature_fraction:0.7 min_data_in_leaf:10  bagging_fraction:0.85 lambda_l1:1 lambda_l2:0.01 bagging_freq:1 seed:1 verbose:false\n\n* categorical_feature:0,1,2  are product, aisle and departement.\n\nI made a separate simple model to predict **None or not** for each offer and fed it to the f1 optimiser.\n\nMy own (extra) features included:\n\n - counts of purchased items/aisle/deps per customer in different intervals . (like last 15, 30 days etc)\n - Timing features. like when was the last time the item was bought.\n - Likelihoods on various categorical features including products, aisles, deps\n - Cart position of the item and features around this area were also useful. Average position of item and  features that show the shift in cart position over time\n - Cardinality features like number of different departments, products, asiles the customer shops from\n - User-based features showing the tendency of buying new items -e.g average proportion of new items in each order.\n\nThings that did not work:\n\n - Making a model per product/aisle/department. \n - Collaborative filtering\n - Exploring the description of items. E.g text analysis was useless. \n\nFor Stacking I used both StackNet and separate Stacking (e.g. used the output of Stacknet on another meta - see below) . I ensembled around 15 models - mostly lightgbms , [H2o algos][8] and [keras][9]' nns.  However i did not get that much from Stacking in this competition. It was much more important the metric's optimisation and the feature engineering.\n\n\nMy best final meta model was an NN using keras and theano. The structure was this:\n\n    models = Sequential()\n    models.add(Dense(output_dim=1024, input_dim=input_d, init='lecun_uniform')) \n    models.add(Activation('relu')) \n    models.add(BatchNormalization())    \n    models.add(Dropout(0.5))  \n    models.add(Dense(512, activation='relu',init='lecun_uniform'))\n    models.add(Activation('relu')) \n    models.add(BatchNormalization())    \n    models.add(Dropout(0.4))  \n    models.add(Dense(2, init='lecun_uniform'))\n    models.add(Activation('softmax'))    \n    opt = optimizers.Adam(lr=0.01)\n    models.compile(loss='binary_crossentropy', optimizer=opt)\n\nFor the f1 optimizer I used **probabilities higher than 0.005.**\n\n\n  [1]: https://www.facebook.com/StackNet/\n  [2]: https://www.kaggle.com/mmueller/f1-score-expectation-maximization-in-o-n\n  [3]: https://www.kaggle.com/c/instacart-market-basket-analysis/discussion/37697\n  [4]: https://github.com/sh1ng/arboretum\n  [5]: https://www.kaggle.com/mmueller/order-streaks-feature\n  [6]: https://www.kaggle.com/paulantoine/light-gbm-benchmark-0-3692/code\n  [7]: https://www.kaggle.com/nickycan/lb-0-3805009-python-edition\n  [8]: http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science.html\n  [9]: https://keras.io/",
      "votes": 75
    },
    {
      "id": 213750,
      "postDate": "2017-08-15T07:10:27.663Z",
      "content": "<p>Congrats, and thanks for sharing.  Your LB climb in the last few days was very impressive.</p>\n\n<p>I also found sklearn f1 score to be deceptive as a metric.  I also had no luck with 3 collaborative filtering models I tried.</p>",
      "rawMarkdown": "Congrats, and thanks for sharing.  Your LB climb in the last few days was very impressive.\n\nI also found sklearn f1 score to be deceptive as a metric.  I also had no luck with 3 collaborative filtering models I tried.",
      "votes": 3
    },
    {
      "id": 213666,
      "postDate": "2017-08-15T03:30:32.570Z",
      "content": "<p>Thanks so much.\nYou did really good.\nI really hope you share some of the code and add it to stacknet examples.</p>",
      "rawMarkdown": "Thanks so much.\nYou did really good.\nI really hope you share some of the code and add it to stacknet examples.",
      "votes": 1
    },
    {
      "id": 213614,
      "postDate": "2017-08-15T01:57:12.043Z",
      "content": "<p>Congrats and thanks for sharing. I am wondering how to tune dart for a while, it always performed worse and slow than gbdt.</p>",
      "rawMarkdown": "Congrats and thanks for sharing. I am wondering how to tune dart for a while, it always performed worse and slow than gbdt.",
      "votes": 1,
      "replies": [
        {
          "id": 213624,
          "postDate": "2017-08-15T02:09:31.233Z",
          "content": "<p>Haha same here !!!\ndart performed far worse on my model. I don't why it performed better on kazanova's ^^</p>\n\n<p>Anyway I really need to learn proper ML and dealing with overfit from Kaggle grandmasters ^^</p>\n\n<p>BTW Congrats Kazanova . Hopefully I will learn and use Stacknet soon :-)</p>",
          "rawMarkdown": "Haha same here !!!\ndart performed far worse on my model. I don't why it performed better on kazanova's ^^\n\nAnyway I really need to learn proper ML and dealing with overfit from Kaggle grandmasters ^^\n\nBTW Congrats Kazanova . Hopefully I will learn and use Stacknet soon :-)"
        },
        {
          "id": 213787,
          "postDate": "2017-08-15T08:57:50.900Z",
          "content": "<p>dart almost always performs better than <strong>gbdt</strong> for me. the trick is to put high learning rate to offset the drop-rate. </p>",
          "rawMarkdown": "dart almost always performs better than **gbdt** for me. the trick is to put high learning rate to offset the drop-rate. ",
          "votes": 8
        },
        {
          "id": 213836,
          "postDate": "2017-08-15T11:20:13.743Z",
          "content": "<p>Thanks Kazanova for the answer and for the trick </p>\n\n<p>At the first look , I said the learning rate is too huge given the number of iterations. But  didn't know it can help this way. </p>\n\n<p>Yeah documentation says dart perform usually better too.  I will give it a try again next time and will try to tune  accordingly the others parameters. </p>",
          "rawMarkdown": "Thanks Kazanova for the answer and for the trick \n\nAt the first look , I said the learning rate is too huge given the number of iterations. But  didn't know it can help this way. \n\nYeah documentation says dart perform usually better too.  I will give it a try again next time and will try to tune  accordingly the others parameters. "
        },
        {
          "id": 213866,
          "postDate": "2017-08-15T12:39:14.130Z",
          "content": "<p>Indeed, dart should have the possibility to preform better for me due to its dropout mechanism. This is what I wondered and contrasted to my on-hand experience. I guess I was doing it wrong as trees in forest were too strong to make dropout work. If every tree is weak and shallow, it would make less impact to the boosting forest while drop out trees. Thanks for sharing!</p>",
          "rawMarkdown": "Indeed, dart should have the possibility to preform better for me due to its dropout mechanism. This is what I wondered and contrasted to my on-hand experience. I guess I was doing it wrong as trees in forest were too strong to make dropout work. If every tree is weak and shallow, it would make less impact to the boosting forest while drop out trees. Thanks for sharing!"
        }
      ]
    },
    {
      "id": 213724,
      "postDate": "2017-08-15T05:46:33.947Z",
      "content": "<p>just curious, \"For the f1 optimizer I used probabilities higher than 0.005.\" how much difference this made to your score compared to using all probabilties?</p>",
      "rawMarkdown": "just curious, \"For the f1 optimizer I used probabilities higher than 0.005.\" how much difference this made to your score compared to using all probabilties?",
      "votes": 2,
      "replies": [
        {
          "id": 213786,
          "postDate": "2017-08-15T08:56:32.300Z",
          "content": "<p>the difference between 0.01 and 0.005 was 0.00005 , lets say from .4082160  to 0.4082660</p>",
          "rawMarkdown": "the difference between 0.01 and 0.005 was 0.00005 , lets say from .4082160  to 0.4082660"
        }
      ]
    },
    {
      "id": 213688,
      "postDate": "2017-08-15T04:14:22.430Z",
      "content": "<p>Thanks a lot, KazAnova. I was trying to use your StackNet to do the stacking but gave up because it seems ideal to train all the model using StackNet? May I know your workflow using StackNet? It seems that one option is to put all the preprocessed features into csv and then use StackNet to train it? If this is the case, do you experiment and tune different models separately at first in python or R and then start to use StackNet to train them all over again near the end? Or do you plug in the output of these different models into StackNet? Sorry if any of these may sound like stupid questions due to my lack of understanding of the tool. </p>",
      "rawMarkdown": "Thanks a lot, KazAnova. I was trying to use your StackNet to do the stacking but gave up because it seems ideal to train all the model using StackNet? May I know your workflow using StackNet? It seems that one option is to put all the preprocessed features into csv and then use StackNet to train it? If this is the case, do you experiment and tune different models separately at first in python or R and then start to use StackNet to train them all over again near the end? Or do you plug in the output of these different models into StackNet? Sorry if any of these may sound like stupid questions due to my lack of understanding of the tool. ",
      "votes": 2,
      "replies": [
        {
          "id": 214001,
          "postDate": "2017-08-15T17:34:21.877Z",
          "content": "<p>I actually use only StackNet for tuning , but I put only 1 model for 1st layer and a dummy one (lets say a logistic regression)  for the second layer . Then I keep tuning the parameters of the first model doing one change at a time. For example I will change max_depth from 5 to 6 and keep note of the improvement (or not)  in  validation . Once I am done with one Algorithm (e.g not further improvement) , I replace  with another algorithm . Once I am done with all algorithms , I put them all together and I run a full StackNet, saving the outputs. Then I can run a second stack net on the outputs,</p>\n\n<p>For more information, please have a look at the Tip: <a href=\"http://blog.kaggle.com/2017/06/15/stacking-made-easy-an-introduction-to-stacknet-by-competitions-grandmaster-marios-michailidis-kazanova/\">To tune a single model, one may choose an algorithm...</a></p>\n\n<p>I have also included some slides you can get <a href=\"http://www.filedropper.com/stacknetmeta-modellingframework\">from this link</a> , that also include the above tip in a more visual way.</p>\n\n<p>Let me know if these help.</p>",
          "rawMarkdown": "I actually use only StackNet for tuning , but I put only 1 model for 1st layer and a dummy one (lets say a logistic regression)  for the second layer . Then I keep tuning the parameters of the first model doing one change at a time. For example I will change max_depth from 5 to 6 and keep note of the improvement (or not)  in  validation . Once I am done with one Algorithm (e.g not further improvement) , I replace  with another algorithm . Once I am done with all algorithms , I put them all together and I run a full StackNet, saving the outputs. Then I can run a second stack net on the outputs,\n\nFor more information, please have a look at the Tip: [To tune a single model, one may choose an algorithm...][1]\n\nI have also included some slides you can get [from this link][2] , that also include the above tip in a more visual way.\n\nLet me know if these help.\n\n  [1]: http://blog.kaggle.com/2017/06/15/stacking-made-easy-an-introduction-to-stacknet-by-competitions-grandmaster-marios-michailidis-kazanova/\n  [2]: http://www.filedropper.com/stacknetmeta-modellingframework",
          "votes": 2
        },
        {
          "id": 214010,
          "postDate": "2017-08-15T17:58:46.660Z",
          "content": "<p>but what about num_rounds for xgboost or lgb, do you use the same method you mentioned? and if so in what increments?</p>",
          "rawMarkdown": "but what about num_rounds for xgboost or lgb, do you use the same method you mentioned? and if so in what increments?"
        },
        {
          "id": 214074,
          "postDate": "2017-08-15T22:25:56.780Z",
          "content": "<p>Thanks @KazAnova! This is really helpful! So it seems that apart from data cleaning and feature engineering, all the rest is done in StackNet. Another question I have is the data format: is uncompressed csv the only supported format for StackNet? It seems that when you have 300 features,  the disk space needed is huge. </p>",
          "rawMarkdown": "Thanks @KazAnova! This is really helpful! So it seems that apart from data cleaning and feature engineering, all the rest is done in StackNet. Another question I have is the data format: is uncompressed csv the only supported format for StackNet? It seems that when you have 300 features,  the disk space needed is huge. ",
          "votes": 1
        },
        {
          "id": 214076,
          "postDate": "2017-08-15T22:28:14.183Z",
          "content": "<p><a href=\"https://github.com/kaz-Anova/StackNet#data-format\">Sparse format </a> is supported too  . Most of the times I use the sparse format. You also need to put </p>\n\n<pre><code>sparse=true\n</code></pre>\n\n<p>in the command line.</p>",
          "rawMarkdown": "[Sparse format ][1] is supported too  . Most of the times I use the sparse format. You also need to put \n\n    sparse=true\nin the command line.\n  [1]: https://github.com/kaz-Anova/StackNet#data-format\n",
          "votes": 1
        },
        {
          "id": 214079,
          "postDate": "2017-08-15T22:33:11.320Z",
          "content": "<p>I see; most of my features in this competition were dense so I have not considered using the sparse format. Will try it in the future, thanks!</p>",
          "rawMarkdown": "I see; most of my features in this competition were dense so I have not considered using the sparse format. Will try it in the future, thanks!"
        }
      ]
    },
    {
      "id": 222943,
      "postDate": "2017-09-20T16:42:09.880Z",
      "content": "<p>Thank you very much for sharing.\nCould you please elaborate more on 'Likelihoods on various categorical features including products, aisles, deps'. What exactly do you mean by this?</p>",
      "rawMarkdown": "Thank you very much for sharing.\nCould you please elaborate more on 'Likelihoods on various categorical features including products, aisles, deps'. What exactly do you mean by this?"
    },
    {
      "id": 213687,
      "postDate": "2017-08-15T04:09:56.237Z",
      "content": "<p>Congrats ,300 features amazing...Which and how many meta-features of the NN meta model's input?</p>",
      "rawMarkdown": "Congrats ,300 features amazing...Which and how many meta-features of the NN meta model's input?",
      "replies": [
        {
          "id": 214002,
          "postDate": "2017-08-15T17:36:48.327Z",
          "content": "<p>I had around 40...but only 15 models. Actually I forgot to mention this. apart from the normal predictions of these 15 models, I also created ranks per customer. Like X times was ranked ith for the Z customer. This made it 30 features.</p>\n\n<p>Then I also included  a more aggregate features per customer and some flags for whether it is a new item (to capture 'None's) </p>",
          "rawMarkdown": "I had around 40...but only 15 models. Actually I forgot to mention this. apart from the normal predictions of these 15 models, I also created ranks per customer. Like X times was ranked ith for the Z customer. This made it 30 features.\n\nThen I also included  a more aggregate features per customer and some flags for whether it is a new item (to capture 'None's) \n\n",
          "votes": 1
        }
      ]
    },
    {
      "id": 213712,
      "postDate": "2017-08-15T05:11:35.947Z",
      "content": "<p>Thanks for sharing.</p>",
      "rawMarkdown": "Thanks for sharing."
    },
    {
      "id": 213610,
      "postDate": "2017-08-15T01:52:17.917Z",
      "content": "<p>Thanks for the sharing!</p>",
      "rawMarkdown": "Thanks for the sharing!"
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-20T02:03:24Z",
  "competition_id": 6644,
  "competition_slug": "basket-analysis",
  "team_id": 784541,
  "solution_url": "/competitions/basket-analysis/writeups/kazanova-h2o-ai-stacknet-9th-place-approach"
}