{
  "id": 14629,
  "title": "Share your codes!",
  "url": "/competitions/facebook-recruiting-iv-human-or-bot/discussion/14629",
  "author_name": "",
  "post_date": "2015-06-09T01:37:30.073Z",
  "votes": 8,
  "comment_count": 5,
  "views": 2067,
  "content": "<p>First of all, congratulations to the winners.</p>\n<p>Second, post your code! <a href=\"https://bitbucket.org/rinze/kaggle-fr4\">Here is mine (R)</a>; I scored 0.92401 on the private leaderboard (higher AUC than I had on the public one, but I dropped several positions anyway). I have written a <a href=\"http://rinzewind.org/blog-en/2015/my-take-on-kaggles-facebook-recruiting-iv-human-or-robot.html\">brief blog post</a> detailing some of the stuff I did.</p>\n<p>See you on the next challenge.</p>",
  "messages": [
    {
      "id": "81298",
      "postDate": "06/09/2015 01:37:30",
      "content": "<p>First of all, congratulations to the winners.</p>\n<p>Second, post your code! <a href=\"https://bitbucket.org/rinze/kaggle-fr4\">Here is mine (R)</a>; I scored 0.92401 on the private leaderboard (higher AUC than I had on the public one, but I dropped several positions anyway). I have written a <a href=\"http://rinzewind.org/blog-en/2015/my-take-on-kaggles-facebook-recruiting-iv-human-or-robot.html\">brief blog post</a> detailing some of the stuff I did.</p>\n<p>See you on the next challenge.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "81305",
      "postDate": "06/09/2015 02:15:27",
      "content": "<p>Here's my code for a basic model I used within my ensemble.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "81311",
      "postDate": "06/09/2015 03:13:56",
      "content": "<p>I think the important part for this competition should be feature engineering, even though the ML could be equal important as well. The features that I found useful (at least I used in my model) are below:</p>\n<p>1. Total bids for each bidder</p>\n<p>2. Total auctions for each bidder</p>\n<p>3. Total bids in each country for each bidder</p>\n<p>4. Total urls for each bidder</p>\n<p>5. Total unique times for each bidder</p>\n<p>6. Total devices for each bidder</p>\n<p>7. Max number of bids that share the same left-most-5 digits of time for each bidder</p>\n<p>8. Max number of bids that share the same left-most-4 digits of time for each bidder</p>\n<p>9. Max number of bids that share the same left-most-6 digits of time for each bidder</p>\n<p>10. The median time difference of all consecuitive bids for each bidder</p>\n<p>11. Total ips for each bidder</p>\n<p>12. Total ips in Indian for each bidder</p>\n<p>13. Total bids of each merchandise for each bidder</p>\n<p>14. The median of each auction's time for each bidder.</p>\n<p>The ML models I used are XGB, adaboost and svm ensembled by ranking (weights around 1.0, 0.9, 0.8 for each).</p>\n<p>1. setting class.weights for SVM are quite helpful. ( class.weights=c('0'=0.1,'1'=1.0) )</p>\n<p>2. For adaboost, I used svm and rf as base models, and adaboost as second stage stacking.</p>\n<p>3. XGB itself gives the best performance of the three. (around 0.92 in CV)</p>\n<p>Final models are the ranking average of the three with weights around 1.0*xgb + 0.9*ada + 0.8*svm, and use log(1+x) to scale the features.</p>\n<p>I got&nbsp;0.92176 for Public LB and&nbsp;0.93426 for Private (I tried not to overfit too much, and in the end I selected one best CV model and one best LB model as my final submission)&nbsp;</p>\n<p><strong>EDIT</strong>: I just found out&nbsp;that my <strong>2-stage</strong>&nbsp;<strong>bagged</strong>&nbsp;adaboost (stacked on svm and rm as base classifier, as in part 2 above), or meta bagging as Mike Kim called it, gives a single private score of 0.936, which is better than my final combined model. So I attached it here. &nbsp;</p>\n<p>At least I can say&nbsp;that&nbsp;bagging &amp; stacking of&nbsp;adaboost in this kind of competition could work well. (For <strong>bagging</strong>, I used 75% WITHOUT replacement as bag, and the remaining 25% as OOB data, instead of sample WITH replacement as in normal bagging; also the adabag package has weird issue when you don't have target column for prediction data set, which is why I added a dummy target col. )&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "81335",
      "postDate": "06/09/2015 11:57:33",
      "content": "<p>[quote=Mike Kim;81305]</p>\n<p>Here's my code for a basic model I used within my ensemble.&nbsp;</p>\n<p>[/quote]</p>\n\n<p>Mike,</p>\n<p>When using Xgboost, the eval metric of auc always prints out numbers around 0.5. The end result is good (0.92 on leaderboard), but it prints out uninformative auc values. Does Xgboost print reasonable AUC values for you? I ended up training &quot;blind&quot; with Xgboost, and then running separate code to check how the AUC was doing. Worked out, but would like to do it an easier way next time.</p>\n\n<p>-Rich</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "81359",
      "postDate": "06/09/2015 15:37:11",
      "content": "<p>I think it's probably just a version issue with xgboost. I'm using this version:<br>https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/12947/achieve-0-50776-on-the-leaderboard-in-a-minute-with-xgboost<br>For cv you can use something like:<br>xgb.cv()<br>But I think the CV code above over estimates AUC compared to my 300 fold random 2/3 subset CV by a large margin.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "81444",
      "postDate": "06/10/2015 04:16:10",
      "content": "<p>I got really into this competition and I had tons of fun, thanks to you all for respecting the rules about sharing that make this kind of competitions special.</p>\n<p>So here is my solution for this challenge, with a score of ~0.927 with some comments and some visualizations in R markdown.</p>\n<p><a href=\"http://rpubs.com/wacax/85239\">http://rpubs.com/wacax/85239</a></p>\n<p>The full repository is here in case somebody wants to have a peek. It still contains parts from models that weren't included in the final result (ex. linear models) and EDAs but they gave important insights nonetheless.</p>\n<p><a href=\"https://github.com/wacax/Facebook-Recruiting-IV\">https://github.com/wacax/Facebook-Recruiting-IV</a></p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 81305,
      "author_name": "mikeskim",
      "author_url": "",
      "post_date": "06/09/2015 02:15:27",
      "content": "<p>Here's my code for a basic model I used within my ensemble.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 81311,
      "author_name": "weimin",
      "author_url": "",
      "post_date": "06/09/2015 03:13:56",
      "content": "<p>I think the important part for this competition should be feature engineering, even though the ML could be equal important as well. The features that I found useful (at least I used in my model) are below:</p>\n<p>1. Total bids for each bidder</p>\n<p>2. Total auctions for each bidder</p>\n<p>3. Total bids in each country for each bidder</p>\n<p>4. Total urls for each bidder</p>\n<p>5. Total unique times for each bidder</p>\n<p>6. Total devices for each bidder</p>\n<p>7. Max number of bids that share the same left-most-5 digits of time for each bidder</p>\n<p>8. Max number of bids that share the same left-most-4 digits of time for each bidder</p>\n<p>9. Max number of bids that share the same left-most-6 digits of time for each bidder</p>\n<p>10. The median time difference of all consecuitive bids for each bidder</p>\n<p>11. Total ips for each bidder</p>\n<p>12. Total ips in Indian for each bidder</p>\n<p>13. Total bids of each merchandise for each bidder</p>\n<p>14. The median of each auction's time for each bidder.</p>\n<p>The ML models I used are XGB, adaboost and svm ensembled by ranking (weights around 1.0, 0.9, 0.8 for each).</p>\n<p>1. setting class.weights for SVM are quite helpful. ( class.weights=c('0'=0.1,'1'=1.0) )</p>\n<p>2. For adaboost, I used svm and rf as base models, and adaboost as second stage stacking.</p>\n<p>3. XGB itself gives the best performance of the three. (around 0.92 in CV)</p>\n<p>Final models are the ranking average of the three with weights around 1.0*xgb + 0.9*ada + 0.8*svm, and use log(1+x) to scale the features.</p>\n<p>I got&nbsp;0.92176 for Public LB and&nbsp;0.93426 for Private (I tried not to overfit too much, and in the end I selected one best CV model and one best LB model as my final submission)&nbsp;</p>\n<p><strong>EDIT</strong>: I just found out&nbsp;that my <strong>2-stage</strong>&nbsp;<strong>bagged</strong>&nbsp;adaboost (stacked on svm and rm as base classifier, as in part 2 above), or meta bagging as Mike Kim called it, gives a single private score of 0.936, which is better than my final combined model. So I attached it here. &nbsp;</p>\n<p>At least I can say&nbsp;that&nbsp;bagging &amp; stacking of&nbsp;adaboost in this kind of competition could work well. (For <strong>bagging</strong>, I used 75% WITHOUT replacement as bag, and the remaining 25% as OOB data, instead of sample WITH replacement as in normal bagging; also the adabag package has weird issue when you don't have target column for prediction data set, which is why I added a dummy target col. )&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 81335,
      "author_name": "richardepstein",
      "author_url": "",
      "post_date": "06/09/2015 11:57:33",
      "content": "<p>[quote=Mike Kim;81305]</p>\n<p>Here's my code for a basic model I used within my ensemble.&nbsp;</p>\n<p>[/quote]</p>\n\n<p>Mike,</p>\n<p>When using Xgboost, the eval metric of auc always prints out numbers around 0.5. The end result is good (0.92 on leaderboard), but it prints out uninformative auc values. Does Xgboost print reasonable AUC values for you? I ended up training &quot;blind&quot; with Xgboost, and then running separate code to check how the AUC was doing. Worked out, but would like to do it an easier way next time.</p>\n\n<p>-Rich</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 81359,
      "author_name": "mikeskim",
      "author_url": "",
      "post_date": "06/09/2015 15:37:11",
      "content": "<p>I think it's probably just a version issue with xgboost. I'm using this version:<br>https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/12947/achieve-0-50776-on-the-leaderboard-in-a-minute-with-xgboost<br>For cv you can use something like:<br>xgb.cv()<br>But I think the CV code above over estimates AUC compared to my 300 fold random 2/3 subset CV by a large margin.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 81444,
      "author_name": "wacaxx",
      "author_url": "",
      "post_date": "06/10/2015 04:16:10",
      "content": "<p>I got really into this competition and I had tons of fun, thanks to you all for respecting the rules about sharing that make this kind of competitions special.</p>\n<p>So here is my solution for this challenge, with a score of ~0.927 with some comments and some visualizations in R markdown.</p>\n<p><a href=\"http://rpubs.com/wacax/85239\">http://rpubs.com/wacax/85239</a></p>\n<p>The full repository is here in case somebody wants to have a peek. It still contains parts from models that weren't included in the final result (ex. linear models) and EDAs but they gave important insights nonetheless.</p>\n<p><a href=\"https://github.com/wacax/Facebook-Recruiting-IV\">https://github.com/wacax/Facebook-Recruiting-IV</a></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "81298": "",
    "81305": "",
    "81311": "",
    "81335": "",
    "81359": "",
    "81444": ""
  },
  "source": "meta"
}