{
  "id": 12460,
  "title": "Congrats to the winners!",
  "url": "/competitions/avazu-ctr-prediction/discussion/12460",
  "author_name": "",
  "post_date": "2015-02-10T00:06:11.063Z",
  "votes": 8,
  "comment_count": 52,
  "views": 22228,
  "content": "<p>This was a LONG competition. Well played.</p>",
  "messages": [
    {
      "id": "63845",
      "postDate": "02/10/2015 00:06:11",
      "content": "<p>This was a LONG competition. Well played.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63846",
      "postDate": "02/10/2015 00:19:56",
      "content": "<p>Congrats. this is a particular hard problem. cannot wait to see the winning solutions.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63850",
      "postDate": "02/10/2015 00:33:35",
      "content": "<p>Congrats!&nbsp;Looking forward to learn something new!</p>\n<p>Special thanks to @Tinrtgu !</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63852",
      "postDate": "02/10/2015 00:37:48",
      "content": "<p>Congratulations to the folks on the nn2 team, guestwalk,&nbsp;Michael Jahrer, yolicat and&nbsp;mandora, to Owen, and to&nbsp;infinitezxc and&nbsp;machine learner from RandomWalker on their great finishes. I look forward to hearing about what set them apart. Also, congratulations to tingrtu on that impressive beat-the-benchmark code. I used it as part of my solution and I know lots of other people did too.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63866",
      "postDate": "02/10/2015 03:41:30",
      "content": "<p>Congratulations!&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63870",
      "postDate": "02/10/2015 03:59:51",
      "content": "<p>Thanks guys. :) This competition is really long but fun.</p>\n<p>And special thanks to&nbsp;tingrtu and 3 idiots for their awesome code for ftrl, fm and gbdt. Our method is mainly built on their code with moderate modifications. But maybe it is feature engineering that is the most important.</p>\n<p>We make up about 10 numerical features by counting the times of impression to one person and time intervals. How to locate a person is an interesting question though. Device_id has too many nulls and device_ip is not that accurate. We use device_id if it is not null and device_ip+device_model for others. Then we use gbdt trained on numerical features to better &quot;bin&quot; these features and get some edge.</p>\n<p>Our final solution is the ensemble of several ftrl and fm models. In ftrl selected interactions and gbdt features are used and in fm both the model with gbdt features and without gbdt features are used. We will post the code and detailed document soon.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63871",
      "postDate": "02/10/2015 04:16:59",
      "content": "<p>Congratulations!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63872",
      "postDate": "02/10/2015 04:17:16",
      "content": "<p>Congratulation to the winners!</p>\n<p>My solution is similar to RandomWalkers, except I did not use gbrt. The key points of my solution:</p>\n<p>1. A lot of feature engineering: count features, combinations of several categorical features, several types of likelihood features, time features.</p>\n<p>2. FTRL code with batches: here is the simple idea how to essentially improve FTRL algorithm: sort dataset by app_id, site_id and run Python code suggested by tingrtu. To get different algorithms, I sorted dataset using different set of categorical features.</p>\n<p>3. My final model contained 1 fm and 3 FTRL models with batches, ensembled with geometric average. The best score for fm model on public lb is 0.38358, for FTRL model - 0.38557.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63873",
      "postDate": "02/10/2015 04:27:12",
      "content": "<p>[quote=Dmitry Efimov;63872]</p>\n<p>2. FTRL code with batches: here is the simple idea how to essentially improve FTRL algorithm: sort dataset by app_id, site_id and run Python code suggested by tingrtu. To get different algorithms, I sorted dataset using different set of categorical features.</p>\n<p>[/quote]</p>\n<p>Thank you for sharing! Does it mean same app_id =&gt; same batch?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63875",
      "postDate": "02/10/2015 04:36:52",
      "content": "<p>Yes, basically, it works in the following way: train weights on the first app_id, make predictions on this app_id, train weights on the second app_id (starting from previous app_id weights) and so on. I suppose, there are a lot of ways to improve this idea, for example, initialize weights after some batches, but I did not have time to try it.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63876",
      "postDate": "02/10/2015 04:43:45",
      "content": "<p>Congratulations winners. That was an impressive amount of separation in an otherwise tight leaderboard.</p>\n<p>Something simple that helped me was to adapt the FTRL to have a decaying learning rate per epoch. So my single best was a&nbsp;0.3894276, and that was achieved with 3 epochs, where the learning rate was adjusted to 85% of its previous rate. The first time I did that, it was worth 100 spots or&nbsp;so. I'll post the slight update in that thread for others to try out--a simple method in the FTRL class&nbsp;and a call to that after the epoch loop is done. Hopefully others get some use out of it.</p>\n<p>For features, I started with a few things I thought would help classify new users, which was to measure the number of records divided by the number of hours, and the number of records divided by the number of unique site/apps. Logging and truncating that provided really nice separation, and it looked similar using it on sites/apps as well so I had two more--four in all. Aside from that, there were&nbsp;a bunch of carefully selected interactions--trying not to put elements of a hierarchy together, which was an idea referenced in one of the Criteo winner's post.</p>\n<p>Toward the end, I started running segmented models by site/app. I think 5 sites captured 40% of the volume, so I had a model for each. Those models helped, but not near as much as anything listed above.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63877",
      "postDate": "02/10/2015 05:09:19",
      "content": "<p>Congratulations to the winners especially Michael Jahrer ( We have worked together in our employer's projects but were competing separately here ) !! My solution is based on a single code, ftrl (thanks to Tinrtgu, you are awesome) and a lot of feature engineering from my end (thanks to pandas). Happy that I got my first top 10 finish in such a crazily hard competition. I thought of implementing 3 idiot's solution of Criteo to make an ensemble but didnt have time for it and I really wanted to know if it is possible to enter top 10 with a single code, all Pythonic . :)&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63878",
      "postDate": "02/10/2015 05:27:41",
      "content": "<p>Congrats to all!</p>\n<p>I ended up&nbsp;getting the most&nbsp;mileage from feature engineering time features. I tried to capture as much about the dynamics of each&nbsp;visitor's&nbsp;history of visits as I could. E.g. time since last visit, number of visits the prior hour, number of visits N days back, etc. I never checked to see which combinations&nbsp;time features were most useful, but in general they improved my LB score a lot. I think more&nbsp;clever feature engineering of time features might have&nbsp;gotten a better score, but ironically, I ran out of time.</p>\n<p>@Dmitry Efimov, and @infinitezxc, I'm curious if you could share details on how you got your FM to work. How did you deal with overfitting? I&nbsp;played&nbsp;around with a FM, but ran into some challenges&nbsp;with&nbsp;overfitting.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63881",
      "postDate": "02/10/2015 06:10:13",
      "content": "<p>[quote=Daniel Yoo;63878]</p>\n<p>@Dmitry Efimov, and @infinitezxc, I'm curious if you could share details on how you got your FM to work. How did you deal with overfitting? I&nbsp;played&nbsp;around with a FM, but ran into some challenges&nbsp;with&nbsp;overfitting.</p>\n<p>[/quote]</p>\n<p>We got the FM to work by tuning lambda and number of epochs through local validation that takes the last two days for testing. The model tends to overfit with smaller lambda and more epochs, so we just used the best parameters for validation and got 0.3834 for our best single fm model.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63888",
      "postDate": "02/10/2015 07:58:57",
      "content": "<p>Although I like building algorithms I realised along the&nbsp;way that this competetition was more about finding additional features. I used FM and FTRL although I tried a few others.<br><br></p>\n<p><strong>Working method</strong></p>\n<ul>\n<li>Holdout was day 29, day 30</li>\n<li>Split the data into app and site based.</li>\n<li>First enrich the original data with the extra features that I found</li>\n<li>Store a sampled version of the enriched file to analyse (excel etc)</li>\n<li>Try new features with a single pass FTRL</li>\n<li>When interesting features found in CV, make a submission with multipass FTRL, FM</li>\n<li>Goto 3.</li>\n<li>No real ensembling strategy since my CV was all over the place (unlike with feature engineering). The submissions was just a weighted model of ca. 60% FM, 40% FTRL.</li>\n</ul>\n<p><strong>Feature engineering</strong></p>\n<ul>\n<li>Many interactions for FTRL.. (The factorization machine&nbsp;found them automatically of course)</li>\n<li>Defined user as ip x deviceid x devicemodel</li>\n<li>Built approx 20 historical features. Based in &quot;how many times have I seen this X before&quot; and other tricks like has feature X changed since last presentation.</li>\n<li>The &quot;coolest&quot; feature was a &quot;site fingerprint&quot; for each record. Based on the user I made a fingerprint of which sites this user also visited. The print was clustered with K-means with cosine similarity. This gave me 0.0005.</li>\n<li>Tried an hour-of-day fingerprint as a proxy for timezone but failed.</li>\n<li>GBDT features (like criteo 3 idiots) features helped a bit but I already log-transformed and cut of the longtails of the counts so the results were not spectacular. It made my model very heavy so I dropped them.</li>\n</ul>\n<p><strong>Software and tuning</strong></p>\n<ul>\n<li>An adjusted FTRL implementation in C# (of course based on trintu's stuff! He deserves a medal!).</li>\n<li>3 passes for site, 2 passes for app data. LR ~1.1, Beta ~1.2, l1, l2 ~1.1</li>\n<li>Online FM (based on stephen rendles work) in C# but later changed to the 3 idiot FAFM because of the speed and accuracy. Kudos for that nifty high performance code. I learned a ton from it! I'm dying to put it on a GPU&nbsp;some time althoug there will be memory problems then.</li>\n<li>I modified (butchered) the fafm to get it running on windows and I also interacted features with themselves which gave a small boost.</li>\n<li>Recode&nbsp;low-count features to 'rare' like in criteo to prevent overfitting.</li>\n<li>60 epochs for app-data with l2 0.00004, k = 4, &nbsp;30 epochs for site data with l2 0.0002, k = 4</li>\n</ul>\n<p><br><strong>What did not help (for me).</strong></p>\n<ul>\n<li>My criteo neural net. To gain accurracy I &nbsp;had to bring down the minibatch size which made it slow. The net did not bring anything new to the table. It felt a bit like a blunt battle axe compared to a sharp rapier (FTRL/FAFM) :)</li>\n<li>I tried xgboost on the probabilties and counts but this model also did not add anything for me.</li>\n<li>Bagging , model variations</li>\n<li>10000 other ideas.</li>\n</ul>\n<p><strong>Results/conclusions</strong></p>\n<ul>\n<li>Best FTRL model was around 0.3849 (public)&nbsp;</li>\n<li>Best FAFM model was around 0.3835 (public)</li>\n<li>Ideas to integrate FM / FTRL in a neural net.. That would be great if it's possible</li>\n<li>Questions how a model could also automatically learn historical features (recurrent neural nets ? But this costs tons of memory I'm afraid)</li>\n</ul>\n<p>Congrats&nbsp;to the winners and a shoutout to Trintu and the 3 idioits and Micheal Jahrer and stephen rendle for their great contributions in terms of algoritms.<br><br>Personal shoutout to&nbsp;Dmitry Efimov.. I felt pretty lame with my last-effort submission just before the deadline..</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63890",
      "postDate": "02/10/2015 08:00:25",
      "content": "<p>Thanks @infinitezxc!!! It seems&nbsp;almost too easy when you put it that way :-).</p>\n<p>Did you mostly manually tune your lambda (I'm assuming L2 regularizer) and # epochs? Did you optimize the&nbsp;degree of the factorization or the random initialization of the factorization?</p>\n<p><span style=\"line-height: 1.4\">Perhaps I never found a good factorization model because I was </span><span style=\"line-height: 1.4\">searching</span><span style=\"line-height: 1.4\">&nbsp;over too </span><span style=\"line-height: 1.4\">many dimensions</span><span style=\"line-height: 1.4\">&nbsp;of hyper parameters.</span></p>\n<p><span style=\"line-height: 1.4\">I'd love&nbsp;to hear how </span><span style=\"line-height: 1.4\">others also</span><span style=\"line-height: 1.4\">&nbsp;optimized over their model hyper parameters considering how long it could take to&nbsp;</span><span style=\"line-height: 1.4\">pass through the data. I found myself forgoing much hyper parameter optimization in favor of ensembling a random mix of hyper parameters.</span></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63906",
      "postDate": "02/10/2015 09:57:20",
      "content": "<p>[quote=Julian de Wit;63888]</p>\n\n<ul>\n<li>Online FM (based on stephen rendles work) in C# but later changed to the 3 idiot FAFM because of the speed and accuracy...</li>\n</ul>\n<p>[/quote]</p>\n<p>This is interesting, any hint about how to implement an online FM?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63907",
      "postDate": "02/10/2015 10:04:12",
      "content": "<p>[quote=Daniel Yoo;63890]</p>\n<p>Did you mostly manually tune your lambda (I'm assuming L2 regularizer) and # epochs? Did you optimize the&nbsp;degree of the factorization or the random initialization of the factorization?</p>\n<p>[/quote]</p>\n<p>For # epochs, just give it a large number and see when loss goes up in validation.&nbsp;</p>\n<p>We also tried tuning other hyper parameters, and adjusting&nbsp;the random initialization got a ~0.0001 improvement. BTW we also made use of the first order features in FM.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63908",
      "postDate": "02/10/2015 10:05:57",
      "content": "<p>Congratulations to all winners, and thanks for sharing.</p>\n<p>I used the SGD code posted by Abhishek (thanks!) and did greedy selection of interaction terms (depth first) using&nbsp;5% of the data. I selected interaction terms that improved the prediction for holdout&nbsp;day 10, to identify&nbsp;interactions that are 'stable in time'. As features I had raw data&nbsp;and univariate logtransformed counts.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63909",
      "postDate": "02/10/2015 10:34:40",
      "content": "<p>[quote=Daniel Yoo;63878]</p>\n<p>@Dmitry Efimov, and @infinitezxc, I'm curious if you could share details on how you got your FM to work. How did you deal with overfitting? I&nbsp;played&nbsp;around with a FM, but ran into some challenges&nbsp;with&nbsp;overfitting.</p>\n<p>[/quote]</p>\n<p>I am going to write the detailed description of my solution soon. Regarding FM, I used the code of 3 idiots, with learning rate 0.02, 20 epochs and 20 latent factors. I have also tried Stephen Rendle's libfm, but I got only 0.38640 on lb with it. Some hints to avoid overfitting:</p>\n<p>1. Remove low-frequent levels (I used threshold 100).</p>\n<p>2. For continuous features I transformed it to binary features using discretisation or rounding. Regarding discretisation, there is a very nice package infotheo in R with function discretize there.</p>\n<p>3. The main problem was to add likelihood features to FM without overfitting, I constructed them in different ways, for example, for current day I used the previous day only. Likelihood features gave 0.002 improvement on the public lb.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63913",
      "postDate": "02/10/2015 11:23:44",
      "content": "<p>[quote=Nishant Kumar;63877]</p>\n<p>My solution is based on a single code, ftrl (thanks to Tinrtgu, you are awesome) and a lot of feature engineering from my end (thanks to pandas). </p>\n<p>[/quote]</p>\n\n<p>Congratulations! And please share more info on what exactly you did :-)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63915",
      "postDate": "02/10/2015 12:10:44",
      "content": "<p>Can someone post the libFM pipeline code (from data transformation into sh run)? I tried to use it as a hastily modified 3 idiots code, and could not get it to perform well.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63921",
      "postDate": "02/10/2015 14:09:33",
      "content": "<p>@Julian de Wit great explanation mate !</p>\n<p>I will talk for my part (which would probably have finished top 10)</p>\n<p>Based on some discussions I had recently with colleagues, academics and other data science enthusiasts , I came into some sort of collision by claiming that on many different problems at present&nbsp;(and with the advances of machine learning) you can do really well without even inspecting&nbsp;&nbsp;the data - just by&nbsp;</p>\n<p>1) knowing the tools</p>\n<p>2) cross- validating properly when you make features' selections, hyper parameter optimization etc</p>\n<p>3) ensembling many different models to capture different information</p>\n<p>In Light of this I did exactly what I tried in Tradeshift plus a couple of more models since we had more time. &nbsp;I only looked at the header of the&nbsp;data and once I understood the set is divided by days , I did a simple frequency count in that column. I also found &nbsp;the row that constitutes the beginning of day 30 (row&nbsp;36,210,029) and looked at that. That is the end of my data inspection.</p>\n<p>I did NOT divide my set in device or not, did NOT look at what constitutes a &quot;user id&quot;(did not bother to understand that either), did not make features' selections (apart from setting interactions=true to Tingru's code or doing the equivalent for other techniques) . &nbsp;I made 17&nbsp;different models based on the given categorical variables :</p>\n<p>-(4) Tingru-based (thanks Tingru!) for l1 only, l2 only, l1 only + interactions, l2 plus interactions cv at&nbsp;day 30</p>\n<p>-(7) sparse data with small samples, and l1 , l2 logits and LinearSVC &nbsp;with or without interactions ( 2 x ) &nbsp;and &nbsp;XGBoost in the same&nbsp;sparse data/ &nbsp;cv day 30</p>\n<p>-(3) converting categories to counts &nbsp;and running Extratrees, XGboost, Gradient Boosting with scikit&nbsp;&nbsp;/ cv day 30&nbsp;</p>\n<p>-(2) using days &lt;29 to calculate ratios of goods vs bads for each category which I applied on day 30 and 31. Then use gradient boosting of scikit or XGBoost to model these /&nbsp;internal random split 50-50 cv&nbsp;</p>\n<p>-(1) LibFM with 5 latent features and l2 for all features&nbsp;&nbsp;/ cv day 30</p>\n<p>I did all of these in a manner that I made predictions for days 30 and 31. Then I used Extra trees and XGBoost as meta-models to combine these and to get my final submission.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63949",
      "postDate": "02/10/2015 18:26:57",
      "content": "<p>Hello Kazanova,<br>What do you think.. Did&nbsp;any of the methods capture the historical features ?<br>Perhaps (3) ? Or do you think that some manual features would add to the score ?<br><br>@Cyberduck<br>Online Fm was just trintgu's code with a&nbsp;changed the 'update' and 'predict' methods to account for the extra interactions-latent-factor-magic-term as specified in the paper by Stephen Rendle.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63957",
      "postDate": "02/10/2015 19:42:07",
      "content": "<p>@Julian de Wit, thanks for your post! I also tried&nbsp;an online fm based on tinrtgu's code. Did you use FTRL for the FM? or did you go with a standard stochastic gradient descent?</p>\n<p>@Cyberduck, I've put up my factorization machine code on github. It's completely based of tinrtgu's code. Of course, I never was able to get it to work very&nbsp;well :-), so there might be 0+ bugs. I'll add some better documentation and readability later:</p>\n<p>https://github.com/comadan/FM_FTRL</p>\n\n<p>EDIT: updated&nbsp;the github repository with better documentation of code and an example of running the code.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63968",
      "postDate": "02/10/2015 21:11:10",
      "content": "<p>[quote=Julian de Wit;63949]</p>\n<p>Hello Kazanova,<br>What do you think.. Did&nbsp;any of the methods capture the historical features ?<br>Perhaps (3) ? Or do you think that some manual features would add to the score ?</p>\n<p>[/quote]</p>\n<p>Obviously the counts and the ratios of 1s&nbsp;and 0s&nbsp;allowed the trees to explore very deep interactions (in fact max_depth was higher than 20 ) historical-or-not, while the linear models gave good baselines (averages) of the main categories. I think deeper relationships were captured by the meta-models too. A weighted average of my models (based on leaderboard feedback) was 0.388+&nbsp;but could get down to 0.3860 with the meta modelling with forests. Interestingly a &nbsp;logistic regression meta-model could come close to my single weighted average but nowhere as good as the meta-model with forests (which where quite deep too). It seemed to me like the most efficient logic IMHO was like &quot; hey, when my probabilities of linear and non-linear models do not align, look at the nonlinear models, when they are quite close, look at the linear ones &quot; and so on.</p>\n<p>I am fairly certain that having introduced a user-id idea (conceptually at least) would have added some good new information and maybe allowed my LibFM model score better ( albeit was quite poor). I guess some food for thought...<strong>I have not spent much time in this competition (in comparison to other comps) - my computer has !&nbsp;</strong>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63969",
      "postDate": "02/10/2015 21:12:50",
      "content": "<p>[quote=Daniel Yoo;63957]</p>\n<p>I've put up my factorization machine code on github.</p>\n<p>[/quote]</p>\n<p>+1 for not using regularization in the first epoch for the latent features</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63974",
      "postDate": "02/10/2015 21:53:41",
      "content": "<p>[quote=Dmitry Efimov;63909]</p>\n<p>[quote=Daniel Yoo;63878]</p>\n<p>@Dmitry Efimov, and @infinitezxc, I'm curious if you could share details on how you got your FM to work. How did you deal with overfitting? I&nbsp;played&nbsp;around with a FM, but ran into some challenges&nbsp;with&nbsp;overfitting.</p>\n<p>[/quote]</p>\n<p>I am going to write the detailed description of my solution soon. Regarding FM, I used the code of 3 idiots, with learning rate 0.02, 20 epochs and 20 latent factors. I have also tried Stephen Rendle's libfm, but I got only 0.38640 on lb with it. Some hints to avoid overfitting:</p>\n<p>1. Remove low-frequent levels (I used threshold 100).</p>\n<p>2. For continuous features I transformed it to binary features using discretisation or rounding. Regarding discretisation, there is a very nice package infotheo in R with function discretize there.</p>\n<p>3. The main problem was to add likelihood features to FM without overfitting, I constructed them in different ways, for example, for current day I used the previous day only. Likelihood features gave 0.002 improvement on the public lb.</p>\n<p>[/quote]</p>\n<p>Would you mind expanding on the likelihood feature&nbsp;design?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64016",
      "postDate": "02/11/2015 10:55:21",
      "content": "<p>[quote=marbel;63974]</p>\n<p>Would you mind expanding on the likelihood feature&nbsp;design?</p>\n<p>[/quote]</p>\n<p>Actually, this is the first algorithm I tried in this competition. It gave 0.39400 on the public leaderboard with just 11 features with little feature engineering.</p>\n<p>Here is the algorithm:</p>\n<p>1) Choose the sequence of features, in my case I took the sequence:</p>\n<p>f = &quot;site_id&quot;,&nbsp;&quot;site_domain&quot;,&nbsp;&quot;app_id&quot;,&nbsp;&quot;banner_pos&quot;,&nbsp;&quot;device_id_count&quot;,&nbsp;&quot;device_conn_type&quot;,&nbsp;&quot;C16&quot;,&nbsp;&quot;device_ip_count&quot;,&nbsp;&quot;device_id_site_id_count&quot;,&nbsp;&quot;device_ip_site_id_count&quot;,&nbsp;&quot;device_model&quot;.</p>\n<p>2) Define the parameter M - reliable size of group (in my case I defined M = 28 by running grid search for different M).</p>\n<p>3) Define the sequence of jumps: j =&nbsp;11, 9, 8, 7, 4, 2.</p>\n<p>4) Start iteration by j:</p>\n<p>define likelihood inside the group: L = N1/N, where group is defined as f[1:j], N1 - number of clicks in the group, N - number of samples in the group.&nbsp;</p>\n<p>define weight for the group: W =&nbsp;1/(1+exp(-N+M)).</p>\n<p>After this step for each jump j I had likelihood L_j and weight W_j.</p>\n<p>5) Start iteration by reversed j:</p>\n<p>5.1) pred = global average of clicks;</p>\n<p>5.2) pred = W_j * L_j + (1-W_j)*pred.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64117",
      "postDate": "02/12/2015 15:49:44",
      "content": "<p>My solution(at 10th place) is as follows.</p>\n<p><strong>Working method:</strong></p>\n<ul>\n<li><span style=\"line-height: 1.4\">Tool I used: vowpal wabbit</span></li>\n<li><span style=\"line-height: 1.4\">Feature engineering:</span></li>\n</ul>\n<p style=\"padding-left: 60px\"><span style=\"line-height: 1.4\">- hour, device_ip and C17 were&nbsp;removed from my feature set, because they did not help.</span><br><span style=\"line-height: 1.4\">- quadratic interactions between major features and all others.</span><br><span style=\"line-height: 1.4\">&nbsp; The features which had greater impacts on my score were&nbsp;</span><br><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;device_model, app_id, site_id, site_domain and banner_pos.</span><br><span style=\"line-height: 1.4\">- cubic interactions among major features.</span><br><span style=\"line-height: 1.4\">- three types of count features (inspired by additions by Yannick Martel for tinrtgu code. &nbsp; &nbsp;Thanks Martel and tinrtgu):</span></p>\n<ol><ol><ol><ol><ol><ol>\n<li><span style=\"line-height: 1.4\">device_ip, device_id, device_ip * device_id and so on counted in all datasets.</span></li>\n<li><span style=\"line-height: 1.4\">the same features counted in past 24 hours.</span></li>\n<li><span style=\"line-height: 1.4\">the same features counted in reverse event order in 24 hours ahead.</span></li>\n</ol></ol></ol></ol></ol></ol>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - click rate for each feature with Laplace smoothing.</p>\n<ul>\n<li>Others:</li>\n</ul>\n<p style=\"padding-left: 30px\">- holdout was days 29 and 30</p>\n<p style=\"padding-left: 30px\">- parameter tuning of vowpal wabbit: --l1, -l, -b and --passes<br> - blending a model with click features and one without them</p>\n<p style=\"padding-left: 30px\">&nbsp;</p>\n<p><strong>Tried but not working methods:</strong></p>\n<ul>\n<ul>\n<li><span style=\"line-height: 1.4\">tinrtgu and Martel codes:</span></li>\n</ul>\n</ul>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;At first I used their codes as is, but oddly enough, the codes did not break 0.4 score barrier.</span></p>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I am not sure why, but I guess my preprocessed data files were corrupted or wrongly formatted.</span></p>\n<ul>\n<ul>\n<li><span style=\"line-height: 1.4\">neural network with or without dropout(--nn or --dropout).</span></li>\n<li><span style=\"line-height: 1.4\">stagewise polynomial feature(--stage_poly).</span></li>\n<li><span style=\"line-height: 1.4\">low rank quadratic feature with or without dropout(--lrq or --lrqdropout):</span></li>\n</ul>\n</ul>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I understand the lrq algorithm in vowpal wabbit has the same philosophy </span></p>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;as the factorization machine(FM)(if I am wrong, correct me!). Since lrq did not work,</span></p>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I did not try 3 idiots fm codes or libFM. Surprisingly (for me), it seems FM successfully </span></p>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; worked</span>&nbsp;in this competition. I should have tried FM!</p>\n<ul>\n<ul>\n<li><span style=\"line-height: 1.4\">3 idiots GBDT code, which I used for click rate features, only to overfit heavily.</span></li>\n<li><span style=\"line-height: 1.4\">removing rare features.</span></li>\n</ul>\n</ul>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64140",
      "postDate": "02/12/2015 20:09:11",
      "content": "<p>[quote=Julian de Wit;63888]</p>\n<ul>\n<li>Ideas to integrate FM / FTRL in a neural net.. That would be great if it's possible.</li>\n</ul>\n<p>[/quote]</p>\n<p>@Julian de Wit</p>\n<p>Interesting that you mentioned it. For this comp, I implemented an FM with drop out applying to the latent factors. This helps a lot in regularizing the FM and I was able to train it with a fairly high number of latent factors (48-64, took ages though, which is why I am also interested to see if it will work on a GPU, but I can't figure out how to align the sparse data.) Of course, once I did that I realize that I am treating the latent factors like hidden units in a neural net so I tried to stick another 'layer' in the back of these latent factors and apply an activation to turn it into a mini net. Unfortunately, these additions didn't really help me in this contest.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64177",
      "postDate": "02/13/2015 18:57:54",
      "content": "<p>My approach to 18th place:</p>\n<p><strong>Feature engineering: </strong></p>\n<p>user id by combining device id / device ip / device model + intraday frequency for user id. Removed all the features that were not present in test set.</p>\n<p><strong>Models:</strong></p>\n<p>Lots of different logistic regressions. I couldn't make FTRL work as good as a simple AdaGrad (thanks to Abnishek's code from Criteo!). I got 0.3663 on private leaderboard with a simple AdaGrad! That was a shock for me.</p>\n<p>I tried single hidden layer perceptron with no success. And after that I set out to build a working Stochastic Gradient Boosting Machine with weights from logistic regression as one of the inputs and it could improve the score. But mainly it didn't give me as good result as I was hoping for. An ensemble of it + best AdaGrad gave me 0.3856 on the private leaderboard.</p>\n\n<p>I would say that feature engineering and ensembling could get me much higher while I was putting to much effort into building and testing different alogithms. Anyway, It was real fun and I leant a lot from it. Thanks everybody!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64196",
      "postDate": "02/13/2015 22:13:55",
      "content": "<p>[quote=KazAnova;63921]</p>\n<p>I did all of these in a manner that I made predictions for days 30 and 31. Then I used Extra trees and XGBoost as meta-models to combine these and to get my final submission.&nbsp;</p>\n<p>[/quote]</p>\n<p>Am I understanding this correctly: you take the output click probabilities of a number of models and feed them to XGBoost to get a final probability?</p>\n<p>I'm curious how many models and what improvement from your best single model you got.</p>\n<p>Cheers!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64205",
      "postDate": "02/14/2015 01:03:27",
      "content": "<p>[quote=laserwolf;64196]</p>\n<p>Am I understanding this correctly: you take the output click probabilities of a number of models and feed them to XGBoost to get a final probability?</p>\n<p>[/quote]</p>\n<p>So all my models were trained with the following logic:</p>\n<p>1) Choose a classifier</p>\n<p>2) Build a model with the selected classifier using data from 20-29 days</p>\n<p>3) make predictions (in probabilities) for day 30</p>\n<p>4) save the labels that correspond to day 30</p>\n<p>5) Build a model&nbsp;with the selected classifier using data from 20-30 days</p>\n<p>6)&nbsp; make predictions (in probabilities) for day 31</p>\n<p>7) once I have number of predictions for different classifiers, I use as new training set my predictions for day 30 and as test set the predictions of the different models for day 31</p>\n<p>8) i used XGBOOST to make this meta-model (that uses as inputs the predictions of all the models)</p>\n<p>A weak point of this approach is that the models are combined based on predictions for day 30 which might be slightly different than day 31</p>\n<p>[quote=laserwolf;64196]</p>\n<p>I'm curious how many models and what improvement from your best single model you got.</p>\n<p>[/quote]</p>\n<p>I made 17 models</p>\n<p>my best single model was 0.392</p>\n<p>The&nbsp;weighted average of my models was around 0.388+</p>\n<p>The XGBoost ensemble took me down to 0.385+</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64218",
      "postDate": "02/14/2015 07:21:25",
      "content": "<p>I'm really interested in how far this really could be pushed.<br>For instance.. for me 29+30 was a better CV than 30 only. Perhaps that alone might improve the scores. I always hope to acquire general knowledge from a competition. Many feature engineering tricks just work once for one comp and not for the other. This ensembling approach is general knowledge. Of course it is known but I really thought it was not&nbsp;working in this competition.<br>But I'm worried&nbsp;of you can solve the problem of, say, converting the date-of-birth to an age..<br><br>But perhaps one of the first jobs that datascientists automate is their own job :)</p>\n<p><br>@mymo</p>\n<p>Of course I was wildly speculating but I was thinking the same thing.<br>Next to the &quot;normal&quot; neurons, have a number of latent factor-neurons... When you think of it. finding interactions is very hard for NN's. It's just not a natural fit. This would help them. Another idea was to put&nbsp;the FM on top of the network as the last layer..<br><br><br></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64340",
      "postDate": "02/16/2015 14:42:27",
      "content": "<p>[quote=KazAnova;64205]</p>\n<p>I made 17 models</p>\n<p>my best single model was 0.392</p>\n<p>The&nbsp;weighted average of my models was around 0.388+</p>\n<p>The XGBoost ensemble took me down to 0.385+</p>\n<p>[/quote]</p>\n<p>Thanks so much KazAnova for this awesome post!</p>\n<p>I just can't seem to get XGBoost to ensemble better than a simple weighted average though. are you &nbsp;binary:logistic or something else? if you could post your configs that would be awesome.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64344",
      "postDate": "02/16/2015 15:08:46",
      "content": "<p>SEED=10</p>\n<p>param = {} <br> eta=0.04<br> max_depth=11<br> subs=1.0<br> thread=30<br> trees=600<br> param['objective'] = 'binary:logistic'<br> param['bst:eta'] = eta<br> param['bst:max_depth'] = max_depth<br> param['eval_metric'] = 'auc'<br> #param['bst:min_child_weight']=1<br> param['silent'] = 1<br> param['seed'] = SEED<br> param['nthread'] = thread<br> param['bst:subsample'] = subs</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64376",
      "postDate": "02/17/2015 01:41:59",
      "content": "<p>[quote=infinitezxc;63870]</p>\n<p>Thanks guys. :) This competition is really long but fun.</p>\n<p>And special thanks to&nbsp;tingrtu and 3 idiots for their awesome code for ftrl, fm and gbdt. Our method is mainly built on their code with moderate modifications. But maybe it is feature engineering that is the most important.</p>\n<p>We make up about 10 numerical features by counting the times of impression to one person and time intervals. How to locate a person is an interesting question though. Device_id has too many nulls and device_ip is not that accurate. We use device_id if it is not null and device_ip+device_model for others. Then we use gbdt trained on numerical features to better &quot;bin&quot; these features and get some edge.</p>\n<p>Our final solution is the ensemble of several ftrl and fm models. In ftrl selected interactions and gbdt features are used and in fm both the model with gbdt features and without gbdt features are used. We will post the code and detailed document soon.</p>\n<p>[/quote]</p>\n<p>@infinitezxc</p>\n<p>&#20146;,&#22312;&#21738;&#37324;&#33021;&#24471;&#21040;&#24744;&#30340;&#25991;&#26723;,&#22914;&#26524;&#21457;&#25918;&#20986;&#26469;&#30340;&#35805;,&#35831;&#36890;&#30693;&#25105;&#20204;&#19968;&#19979;&#22909;&#21527;?&#26399;&#24453;..</p>\n<p>&#39034;&#20415;&#38382;&#19968;&#19979;,&#20146;&#22312;&#21738;&#37324;&#39640;&#23601;?&#25105;&#20204;&#24819;&#36992;&#35831;&#20146;&#26469;&#25105;&#20204;&#20844;&#21496;&#20570;&#19968;&#19979;&#35762;&#24231;.&#22914;&#26524;&#24744;&#26085;&#31243;&#33021;&#23433;&#25490;&#30340;&#35805;,&#35831;&#22238;&#22797;&#25105;&#19968;&#19979;.&#35874;&#35874;.</p>\n<p>&#25105;&#30340;&#37038;&#31665;:306388406@qq.com</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64382",
      "postDate": "02/17/2015 04:58:00",
      "content": "<p>&#19968;&#33324;&#35201;&#22312;&#27604;&#36187;&#32467;&#26463;&#21518;&#20004;&#21608;&#20043;&#20869;&#19978;&#20256;&#25991;&#26723;&#21040;&#35770;&#22363;&#65292;&#25105;&#20204;&#20063;&#22909;&#24819;&#30475;&#21834;&#128064;&#65292; &#22826;&#21385;&#23475;&#20102;&#20320;&#20204;@infinitezxc&#65281;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64386",
      "postDate": "02/17/2015 09:53:40",
      "content": "<p>@chang yangfan @Xueer Chen &#25991;&#26723;&#24050;&#32463;&#24046;&#19981;&#22810;&#25972;&#29702;&#22909;&#20102;&#65292;&#39532;&#19978;&#20250;&#26681;&#25454;&#35201;&#27714;&#25918;&#20986;&#26469;&#30340;&#12290;:&#65289;&#21487;&#20197;&#37038;&#31665;&#32852;&#31995; infinitezxc@gmail.com</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64463",
      "postDate": "02/18/2015 04:43:23",
      "content": "<p>The problem appears to be tough for those who are new to ML. (Unfortunately) some students in my Institute have taken up this as a graduation Project and want to stick to it. I will be grateful if some simple and working code that achieves good enough results can be posted so they can further work upon it. Thanks.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64474",
      "postDate": "02/18/2015 09:11:20",
      "content": "<p>[quote=ashok k harnal;64463]</p>\n<p>I will be grateful if some simple and working code that achieves good enough results can be posted so they can further work upon it.</p>\n<p>[/quote]</p>\n<p>There are already several good examples on the forums: tinrtgu's FTRL in python; a few vowpal wabbit examples; and xgboost/R in the recent thread.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64476",
      "postDate": "02/18/2015 09:15:29",
      "content": "<p>@chang yangfan @Xueer Chen&nbsp;@infinitezxc</p>\n<p>&#20170;&#22825;&#25165;&#30693;&#36947;&#12290;&#12290;&#21407;&#26469;&#21487;&#20197;&#25171;&#20013;&#25991;&#12290;&#12290;&#12290;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64480",
      "postDate": "02/18/2015 09:40:16",
      "content": "<p>Thanks Lewis. Vowpal wabbit examples do appear easy to follow.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64549",
      "postDate": "02/19/2015 04:28:05",
      "content": "<p>For those deep learners among you - how would you use neural networks&nbsp;in this competition?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64799",
      "postDate": "02/24/2015 04:37:35",
      "content": "<p>Thanks everyone for sharing. Here is my solution:</p>\n\n<p>https://github.com/owenzhang/kaggle-avazu</p>\n\n<p>It is largely based 3 idiots' winning solution for criteo.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64855",
      "postDate": "02/25/2015 10:27:19",
      "content": "<p>[quote=Owen;64799]</p>\n<p>Thanks everyone for sharing. Here is my solution:</p>\n<p>https://github.com/owenzhang/kaggle-avazu</p>\n<p>It is largely based 3 idiots' winning solution for criteo.&nbsp;</p>\n<p>[/quote]</p>\n\n<p>Thanks so much!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64866",
      "postDate": "02/25/2015 14:40:09",
      "content": "<p>Time to learn from the best :D</p>\n<p>thank you Owen and 4 idiots for sharing their <a href=\"https://www.kaggle.com/c/avazu-ctr-prediction/forums/t/12608/4-idiots-solution-libffm\">solution</a>&nbsp;!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65015",
      "postDate": "02/27/2015 09:18:38",
      "content": "<p>[quote=infinitezxc;64386]</p>\n<p>@chang yangfan @Xueer Chen &#25991;&#26723;&#24050;&#32463;&#24046;&#19981;&#22810;&#25972;&#29702;&#22909;&#20102;&#65292;&#39532;&#19978;&#20250;&#26681;&#25454;&#35201;&#27714;&#25918;&#20986;&#26469;&#30340;&#12290;:&#65289;&#25105;&#36824;&#26159;&#28165;&#21326;&#35745;&#31639;&#26426;&#30740;&#19968;&#30340;&#23398;&#29983;...&#21487;&#20197;&#37038;&#31665;&#32852;&#31995; infinitezxc@gmail.com</p>\n<p>[/quote]</p>\n<p>&#21457;&#36865;&#20102;&#37038;&#20214;,&#19981;&#30693;&#36947;&#26159;&#21542;&#25910;&#21040;!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65223",
      "postDate": "03/02/2015 08:05:41",
      "content": "<p>Hi All,</p>\n<p>We have prepared our code and document&nbsp;<a href=\"https://github.com/infinitezxc/kaggle-avazu\">here</a>.</p>\n<p>Your comments are very welcome. :)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65282",
      "postDate": "03/02/2015 19:32:08",
      "content": "<p>[quote=infinitezxc;65223]</p>\n<p>Hi All,</p>\n<p>We have prepared our code and document&nbsp;<a href=\"https://github.com/infinitezxc/kaggle-avazu\">here</a>.</p>\n<p>Your comments are very welcome. :)</p>\n<p>[/quote]</p>\n<p>Great work!</p>\n<p>I have a question. I see you added the first order terms into FFM. In my experience, removing first order terms works slightly better. (I can't remember the exact difference.)&nbsp;Did you observe any improvement by adding the first order terms back? Thanks!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65312",
      "postDate": "03/03/2015 02:02:49",
      "content": "<p>[quote=guestwalk;65282]</p>\n<p>I have a question. I see you added the first order terms into FFM. In my experience, removing first order terms works slightly better. (I can't remember the exact difference.)&nbsp;Did you observe any improvement by adding the first order terms back? Thanks!</p>\n<p>[/quote]</p>\n<p>Yes. We got ~0.001 improvement on this dataset by adding first order terms at an early stage and we keep using it regarding the positive result.</p>\n<p>Thanks again for the excellent work in the two competitions, we learned a lot from your solutions. :)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65323",
      "postDate": "03/03/2015 11:22:28",
      "content": "<p>[quote=infinitezxc;65312]</p>\n<p>[quote=guestwalk;65282]</p>\n<p>I have a question. I see you added the first order terms into FFM. In my experience, removing first order terms works slightly better. (I can't remember the exact difference.)&nbsp;Did you observe any improvement by adding the first order terms back? Thanks!</p>\n<p>[/quote]</p>\n<p>Yes. We got ~0.001 improvement on this dataset by adding first order terms at an early stage and we keep using it regarding the positive result.</p>\n<p>Thanks again for the excellent work in the two competitions, we learned a lot from your solutions. :)</p>\n<p>[/quote]</p>\n<p>I see. 0.001 is a significant improvement. I may need to check this issue again. Thanks a lot for your answer!&nbsp; :)</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 63846,
      "author_name": "jiweiliu",
      "author_url": "",
      "post_date": "02/10/2015 00:19:56",
      "content": "<p>Congrats. this is a particular hard problem. cannot wait to see the winning solutions.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63850,
      "author_name": "superfan123",
      "author_url": "",
      "post_date": "02/10/2015 00:33:35",
      "content": "<p>Congrats!&nbsp;Looking forward to learn something new!</p>\n<p>Special thanks to @Tinrtgu !</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63852,
      "author_name": "davidthaler",
      "author_url": "",
      "post_date": "02/10/2015 00:37:48",
      "content": "<p>Congratulations to the folks on the nn2 team, guestwalk,&nbsp;Michael Jahrer, yolicat and&nbsp;mandora, to Owen, and to&nbsp;infinitezxc and&nbsp;machine learner from RandomWalker on their great finishes. I look forward to hearing about what set them apart. Also, congratulations to tingrtu on that impressive beat-the-benchmark code. I used it as part of my solution and I know lots of other people did too.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63866,
      "author_name": "supernova117",
      "author_url": "",
      "post_date": "02/10/2015 03:41:30",
      "content": "<p>Congratulations!&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63870,
      "author_name": "infinite",
      "author_url": "",
      "post_date": "02/10/2015 03:59:51",
      "content": "<p>Thanks guys. :) This competition is really long but fun.</p>\n<p>And special thanks to&nbsp;tingrtu and 3 idiots for their awesome code for ftrl, fm and gbdt. Our method is mainly built on their code with moderate modifications. But maybe it is feature engineering that is the most important.</p>\n<p>We make up about 10 numerical features by counting the times of impression to one person and time intervals. How to locate a person is an interesting question though. Device_id has too many nulls and device_ip is not that accurate. We use device_id if it is not null and device_ip+device_model for others. Then we use gbdt trained on numerical features to better &quot;bin&quot; these features and get some edge.</p>\n<p>Our final solution is the ensemble of several ftrl and fm models. In ftrl selected interactions and gbdt features are used and in fm both the model with gbdt features and without gbdt features are used. We will post the code and detailed document soon.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63871,
      "author_name": "chuan92",
      "author_url": "",
      "post_date": "02/10/2015 04:16:59",
      "content": "<p>Congratulations!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63872,
      "author_name": "efimov",
      "author_url": "",
      "post_date": "02/10/2015 04:17:16",
      "content": "<p>Congratulation to the winners!</p>\n<p>My solution is similar to RandomWalkers, except I did not use gbrt. The key points of my solution:</p>\n<p>1. A lot of feature engineering: count features, combinations of several categorical features, several types of likelihood features, time features.</p>\n<p>2. FTRL code with batches: here is the simple idea how to essentially improve FTRL algorithm: sort dataset by app_id, site_id and run Python code suggested by tingrtu. To get different algorithms, I sorted dataset using different set of categorical features.</p>\n<p>3. My final model contained 1 fm and 3 FTRL models with batches, ensembled with geometric average. The best score for fm model on public lb is 0.38358, for FTRL model - 0.38557.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63873,
      "author_name": "jiweiliu",
      "author_url": "",
      "post_date": "02/10/2015 04:27:12",
      "content": "<p>[quote=Dmitry Efimov;63872]</p>\n<p>2. FTRL code with batches: here is the simple idea how to essentially improve FTRL algorithm: sort dataset by app_id, site_id and run Python code suggested by tingrtu. To get different algorithms, I sorted dataset using different set of categorical features.</p>\n<p>[/quote]</p>\n<p>Thank you for sharing! Does it mean same app_id =&gt; same batch?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63875,
      "author_name": "efimov",
      "author_url": "",
      "post_date": "02/10/2015 04:36:52",
      "content": "<p>Yes, basically, it works in the following way: train weights on the first app_id, make predictions on this app_id, train weights on the second app_id (starting from previous app_id weights) and so on. I suppose, there are a lot of ways to improve this idea, for example, initialize weights after some batches, but I did not have time to try it.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63876,
      "author_name": "mlandry",
      "author_url": "",
      "post_date": "02/10/2015 04:43:45",
      "content": "<p>Congratulations winners. That was an impressive amount of separation in an otherwise tight leaderboard.</p>\n<p>Something simple that helped me was to adapt the FTRL to have a decaying learning rate per epoch. So my single best was a&nbsp;0.3894276, and that was achieved with 3 epochs, where the learning rate was adjusted to 85% of its previous rate. The first time I did that, it was worth 100 spots or&nbsp;so. I'll post the slight update in that thread for others to try out--a simple method in the FTRL class&nbsp;and a call to that after the epoch loop is done. Hopefully others get some use out of it.</p>\n<p>For features, I started with a few things I thought would help classify new users, which was to measure the number of records divided by the number of hours, and the number of records divided by the number of unique site/apps. Logging and truncating that provided really nice separation, and it looked similar using it on sites/apps as well so I had two more--four in all. Aside from that, there were&nbsp;a bunch of carefully selected interactions--trying not to put elements of a hierarchy together, which was an idea referenced in one of the Criteo winner's post.</p>\n<p>Toward the end, I started running segmented models by site/app. I think 5 sites captured 40% of the volume, so I had a model for each. Those models helped, but not near as much as anything listed above.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63877,
      "author_name": "nishkgp",
      "author_url": "",
      "post_date": "02/10/2015 05:09:19",
      "content": "<p>Congratulations to the winners especially Michael Jahrer ( We have worked together in our employer's projects but were competing separately here ) !! My solution is based on a single code, ftrl (thanks to Tinrtgu, you are awesome) and a lot of feature engineering from my end (thanks to pandas). Happy that I got my first top 10 finish in such a crazily hard competition. I thought of implementing 3 idiot's solution of Criteo to make an ensemble but didnt have time for it and I really wanted to know if it is possible to enter top 10 with a single code, all Pythonic . :)&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63878,
      "author_name": "danielyoo",
      "author_url": "",
      "post_date": "02/10/2015 05:27:41",
      "content": "<p>Congrats to all!</p>\n<p>I ended up&nbsp;getting the most&nbsp;mileage from feature engineering time features. I tried to capture as much about the dynamics of each&nbsp;visitor's&nbsp;history of visits as I could. E.g. time since last visit, number of visits the prior hour, number of visits N days back, etc. I never checked to see which combinations&nbsp;time features were most useful, but in general they improved my LB score a lot. I think more&nbsp;clever feature engineering of time features might have&nbsp;gotten a better score, but ironically, I ran out of time.</p>\n<p>@Dmitry Efimov, and @infinitezxc, I'm curious if you could share details on how you got your FM to work. How did you deal with overfitting? I&nbsp;played&nbsp;around with a FM, but ran into some challenges&nbsp;with&nbsp;overfitting.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63881,
      "author_name": "infinite",
      "author_url": "",
      "post_date": "02/10/2015 06:10:13",
      "content": "<p>[quote=Daniel Yoo;63878]</p>\n<p>@Dmitry Efimov, and @infinitezxc, I'm curious if you could share details on how you got your FM to work. How did you deal with overfitting? I&nbsp;played&nbsp;around with a FM, but ran into some challenges&nbsp;with&nbsp;overfitting.</p>\n<p>[/quote]</p>\n<p>We got the FM to work by tuning lambda and number of epochs through local validation that takes the last two days for testing. The model tends to overfit with smaller lambda and more epochs, so we just used the best parameters for validation and got 0.3834 for our best single fm model.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63888,
      "author_name": "juliandewit",
      "author_url": "",
      "post_date": "02/10/2015 07:58:57",
      "content": "<p>Although I like building algorithms I realised along the&nbsp;way that this competetition was more about finding additional features. I used FM and FTRL although I tried a few others.<br><br></p>\n<p><strong>Working method</strong></p>\n<ul>\n<li>Holdout was day 29, day 30</li>\n<li>Split the data into app and site based.</li>\n<li>First enrich the original data with the extra features that I found</li>\n<li>Store a sampled version of the enriched file to analyse (excel etc)</li>\n<li>Try new features with a single pass FTRL</li>\n<li>When interesting features found in CV, make a submission with multipass FTRL, FM</li>\n<li>Goto 3.</li>\n<li>No real ensembling strategy since my CV was all over the place (unlike with feature engineering). The submissions was just a weighted model of ca. 60% FM, 40% FTRL.</li>\n</ul>\n<p><strong>Feature engineering</strong></p>\n<ul>\n<li>Many interactions for FTRL.. (The factorization machine&nbsp;found them automatically of course)</li>\n<li>Defined user as ip x deviceid x devicemodel</li>\n<li>Built approx 20 historical features. Based in &quot;how many times have I seen this X before&quot; and other tricks like has feature X changed since last presentation.</li>\n<li>The &quot;coolest&quot; feature was a &quot;site fingerprint&quot; for each record. Based on the user I made a fingerprint of which sites this user also visited. The print was clustered with K-means with cosine similarity. This gave me 0.0005.</li>\n<li>Tried an hour-of-day fingerprint as a proxy for timezone but failed.</li>\n<li>GBDT features (like criteo 3 idiots) features helped a bit but I already log-transformed and cut of the longtails of the counts so the results were not spectacular. It made my model very heavy so I dropped them.</li>\n</ul>\n<p><strong>Software and tuning</strong></p>\n<ul>\n<li>An adjusted FTRL implementation in C# (of course based on trintu's stuff! He deserves a medal!).</li>\n<li>3 passes for site, 2 passes for app data. LR ~1.1, Beta ~1.2, l1, l2 ~1.1</li>\n<li>Online FM (based on stephen rendles work) in C# but later changed to the 3 idiot FAFM because of the speed and accuracy. Kudos for that nifty high performance code. I learned a ton from it! I'm dying to put it on a GPU&nbsp;some time althoug there will be memory problems then.</li>\n<li>I modified (butchered) the fafm to get it running on windows and I also interacted features with themselves which gave a small boost.</li>\n<li>Recode&nbsp;low-count features to 'rare' like in criteo to prevent overfitting.</li>\n<li>60 epochs for app-data with l2 0.00004, k = 4, &nbsp;30 epochs for site data with l2 0.0002, k = 4</li>\n</ul>\n<p><br><strong>What did not help (for me).</strong></p>\n<ul>\n<li>My criteo neural net. To gain accurracy I &nbsp;had to bring down the minibatch size which made it slow. The net did not bring anything new to the table. It felt a bit like a blunt battle axe compared to a sharp rapier (FTRL/FAFM) :)</li>\n<li>I tried xgboost on the probabilties and counts but this model also did not add anything for me.</li>\n<li>Bagging , model variations</li>\n<li>10000 other ideas.</li>\n</ul>\n<p><strong>Results/conclusions</strong></p>\n<ul>\n<li>Best FTRL model was around 0.3849 (public)&nbsp;</li>\n<li>Best FAFM model was around 0.3835 (public)</li>\n<li>Ideas to integrate FM / FTRL in a neural net.. That would be great if it's possible</li>\n<li>Questions how a model could also automatically learn historical features (recurrent neural nets ? But this costs tons of memory I'm afraid)</li>\n</ul>\n<p>Congrats&nbsp;to the winners and a shoutout to Trintu and the 3 idioits and Micheal Jahrer and stephen rendle for their great contributions in terms of algoritms.<br><br>Personal shoutout to&nbsp;Dmitry Efimov.. I felt pretty lame with my last-effort submission just before the deadline..</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63890,
      "author_name": "danielyoo",
      "author_url": "",
      "post_date": "02/10/2015 08:00:25",
      "content": "<p>Thanks @infinitezxc!!! It seems&nbsp;almost too easy when you put it that way :-).</p>\n<p>Did you mostly manually tune your lambda (I'm assuming L2 regularizer) and # epochs? Did you optimize the&nbsp;degree of the factorization or the random initialization of the factorization?</p>\n<p><span style=\"line-height: 1.4\">Perhaps I never found a good factorization model because I was </span><span style=\"line-height: 1.4\">searching</span><span style=\"line-height: 1.4\">&nbsp;over too </span><span style=\"line-height: 1.4\">many dimensions</span><span style=\"line-height: 1.4\">&nbsp;of hyper parameters.</span></p>\n<p><span style=\"line-height: 1.4\">I'd love&nbsp;to hear how </span><span style=\"line-height: 1.4\">others also</span><span style=\"line-height: 1.4\">&nbsp;optimized over their model hyper parameters considering how long it could take to&nbsp;</span><span style=\"line-height: 1.4\">pass through the data. I found myself forgoing much hyper parameter optimization in favor of ensembling a random mix of hyper parameters.</span></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63906,
      "author_name": "antoniom",
      "author_url": "",
      "post_date": "02/10/2015 09:57:20",
      "content": "<p>[quote=Julian de Wit;63888]</p>\n\n<ul>\n<li>Online FM (based on stephen rendles work) in C# but later changed to the 3 idiot FAFM because of the speed and accuracy...</li>\n</ul>\n<p>[/quote]</p>\n<p>This is interesting, any hint about how to implement an online FM?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63907,
      "author_name": "infinite",
      "author_url": "",
      "post_date": "02/10/2015 10:04:12",
      "content": "<p>[quote=Daniel Yoo;63890]</p>\n<p>Did you mostly manually tune your lambda (I'm assuming L2 regularizer) and # epochs? Did you optimize the&nbsp;degree of the factorization or the random initialization of the factorization?</p>\n<p>[/quote]</p>\n<p>For # epochs, just give it a large number and see when loss goes up in validation.&nbsp;</p>\n<p>We also tried tuning other hyper parameters, and adjusting&nbsp;the random initialization got a ~0.0001 improvement. BTW we also made use of the first order features in FM.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63908,
      "author_name": "gertjac",
      "author_url": "",
      "post_date": "02/10/2015 10:05:57",
      "content": "<p>Congratulations to all winners, and thanks for sharing.</p>\n<p>I used the SGD code posted by Abhishek (thanks!) and did greedy selection of interaction terms (depth first) using&nbsp;5% of the data. I selected interaction terms that improved the prediction for holdout&nbsp;day 10, to identify&nbsp;interactions that are 'stable in time'. As features I had raw data&nbsp;and univariate logtransformed counts.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63909,
      "author_name": "efimov",
      "author_url": "",
      "post_date": "02/10/2015 10:34:40",
      "content": "<p>[quote=Daniel Yoo;63878]</p>\n<p>@Dmitry Efimov, and @infinitezxc, I'm curious if you could share details on how you got your FM to work. How did you deal with overfitting? I&nbsp;played&nbsp;around with a FM, but ran into some challenges&nbsp;with&nbsp;overfitting.</p>\n<p>[/quote]</p>\n<p>I am going to write the detailed description of my solution soon. Regarding FM, I used the code of 3 idiots, with learning rate 0.02, 20 epochs and 20 latent factors. I have also tried Stephen Rendle's libfm, but I got only 0.38640 on lb with it. Some hints to avoid overfitting:</p>\n<p>1. Remove low-frequent levels (I used threshold 100).</p>\n<p>2. For continuous features I transformed it to binary features using discretisation or rounding. Regarding discretisation, there is a very nice package infotheo in R with function discretize there.</p>\n<p>3. The main problem was to add likelihood features to FM without overfitting, I constructed them in different ways, for example, for current day I used the previous day only. Likelihood features gave 0.002 improvement on the public lb.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63913,
      "author_name": "tobycheese",
      "author_url": "",
      "post_date": "02/10/2015 11:23:44",
      "content": "<p>[quote=Nishant Kumar;63877]</p>\n<p>My solution is based on a single code, ftrl (thanks to Tinrtgu, you are awesome) and a lot of feature engineering from my end (thanks to pandas). </p>\n<p>[/quote]</p>\n\n<p>Congratulations! And please share more info on what exactly you did :-)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63915,
      "author_name": "mikeskim",
      "author_url": "",
      "post_date": "02/10/2015 12:10:44",
      "content": "<p>Can someone post the libFM pipeline code (from data transformation into sh run)? I tried to use it as a hastily modified 3 idiots code, and could not get it to perform well.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63921,
      "author_name": "kazanova",
      "author_url": "",
      "post_date": "02/10/2015 14:09:33",
      "content": "<p>@Julian de Wit great explanation mate !</p>\n<p>I will talk for my part (which would probably have finished top 10)</p>\n<p>Based on some discussions I had recently with colleagues, academics and other data science enthusiasts , I came into some sort of collision by claiming that on many different problems at present&nbsp;(and with the advances of machine learning) you can do really well without even inspecting&nbsp;&nbsp;the data - just by&nbsp;</p>\n<p>1) knowing the tools</p>\n<p>2) cross- validating properly when you make features' selections, hyper parameter optimization etc</p>\n<p>3) ensembling many different models to capture different information</p>\n<p>In Light of this I did exactly what I tried in Tradeshift plus a couple of more models since we had more time. &nbsp;I only looked at the header of the&nbsp;data and once I understood the set is divided by days , I did a simple frequency count in that column. I also found &nbsp;the row that constitutes the beginning of day 30 (row&nbsp;36,210,029) and looked at that. That is the end of my data inspection.</p>\n<p>I did NOT divide my set in device or not, did NOT look at what constitutes a &quot;user id&quot;(did not bother to understand that either), did not make features' selections (apart from setting interactions=true to Tingru's code or doing the equivalent for other techniques) . &nbsp;I made 17&nbsp;different models based on the given categorical variables :</p>\n<p>-(4) Tingru-based (thanks Tingru!) for l1 only, l2 only, l1 only + interactions, l2 plus interactions cv at&nbsp;day 30</p>\n<p>-(7) sparse data with small samples, and l1 , l2 logits and LinearSVC &nbsp;with or without interactions ( 2 x ) &nbsp;and &nbsp;XGBoost in the same&nbsp;sparse data/ &nbsp;cv day 30</p>\n<p>-(3) converting categories to counts &nbsp;and running Extratrees, XGboost, Gradient Boosting with scikit&nbsp;&nbsp;/ cv day 30&nbsp;</p>\n<p>-(2) using days &lt;29 to calculate ratios of goods vs bads for each category which I applied on day 30 and 31. Then use gradient boosting of scikit or XGBoost to model these /&nbsp;internal random split 50-50 cv&nbsp;</p>\n<p>-(1) LibFM with 5 latent features and l2 for all features&nbsp;&nbsp;/ cv day 30</p>\n<p>I did all of these in a manner that I made predictions for days 30 and 31. Then I used Extra trees and XGBoost as meta-models to combine these and to get my final submission.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63949,
      "author_name": "juliandewit",
      "author_url": "",
      "post_date": "02/10/2015 18:26:57",
      "content": "<p>Hello Kazanova,<br>What do you think.. Did&nbsp;any of the methods capture the historical features ?<br>Perhaps (3) ? Or do you think that some manual features would add to the score ?<br><br>@Cyberduck<br>Online Fm was just trintgu's code with a&nbsp;changed the 'update' and 'predict' methods to account for the extra interactions-latent-factor-magic-term as specified in the paper by Stephen Rendle.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63957,
      "author_name": "danielyoo",
      "author_url": "",
      "post_date": "02/10/2015 19:42:07",
      "content": "<p>@Julian de Wit, thanks for your post! I also tried&nbsp;an online fm based on tinrtgu's code. Did you use FTRL for the FM? or did you go with a standard stochastic gradient descent?</p>\n<p>@Cyberduck, I've put up my factorization machine code on github. It's completely based of tinrtgu's code. Of course, I never was able to get it to work very&nbsp;well :-), so there might be 0+ bugs. I'll add some better documentation and readability later:</p>\n<p>https://github.com/comadan/FM_FTRL</p>\n\n<p>EDIT: updated&nbsp;the github repository with better documentation of code and an example of running the code.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63968,
      "author_name": "kazanova",
      "author_url": "",
      "post_date": "02/10/2015 21:11:10",
      "content": "<p>[quote=Julian de Wit;63949]</p>\n<p>Hello Kazanova,<br>What do you think.. Did&nbsp;any of the methods capture the historical features ?<br>Perhaps (3) ? Or do you think that some manual features would add to the score ?</p>\n<p>[/quote]</p>\n<p>Obviously the counts and the ratios of 1s&nbsp;and 0s&nbsp;allowed the trees to explore very deep interactions (in fact max_depth was higher than 20 ) historical-or-not, while the linear models gave good baselines (averages) of the main categories. I think deeper relationships were captured by the meta-models too. A weighted average of my models (based on leaderboard feedback) was 0.388+&nbsp;but could get down to 0.3860 with the meta modelling with forests. Interestingly a &nbsp;logistic regression meta-model could come close to my single weighted average but nowhere as good as the meta-model with forests (which where quite deep too). It seemed to me like the most efficient logic IMHO was like &quot; hey, when my probabilities of linear and non-linear models do not align, look at the nonlinear models, when they are quite close, look at the linear ones &quot; and so on.</p>\n<p>I am fairly certain that having introduced a user-id idea (conceptually at least) would have added some good new information and maybe allowed my LibFM model score better ( albeit was quite poor). I guess some food for thought...<strong>I have not spent much time in this competition (in comparison to other comps) - my computer has !&nbsp;</strong>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63969,
      "author_name": "kazanova",
      "author_url": "",
      "post_date": "02/10/2015 21:12:50",
      "content": "<p>[quote=Daniel Yoo;63957]</p>\n<p>I've put up my factorization machine code on github.</p>\n<p>[/quote]</p>\n<p>+1 for not using regularization in the first epoch for the latent features</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63974,
      "author_name": "marbel",
      "author_url": "",
      "post_date": "02/10/2015 21:53:41",
      "content": "<p>[quote=Dmitry Efimov;63909]</p>\n<p>[quote=Daniel Yoo;63878]</p>\n<p>@Dmitry Efimov, and @infinitezxc, I'm curious if you could share details on how you got your FM to work. How did you deal with overfitting? I&nbsp;played&nbsp;around with a FM, but ran into some challenges&nbsp;with&nbsp;overfitting.</p>\n<p>[/quote]</p>\n<p>I am going to write the detailed description of my solution soon. Regarding FM, I used the code of 3 idiots, with learning rate 0.02, 20 epochs and 20 latent factors. I have also tried Stephen Rendle's libfm, but I got only 0.38640 on lb with it. Some hints to avoid overfitting:</p>\n<p>1. Remove low-frequent levels (I used threshold 100).</p>\n<p>2. For continuous features I transformed it to binary features using discretisation or rounding. Regarding discretisation, there is a very nice package infotheo in R with function discretize there.</p>\n<p>3. The main problem was to add likelihood features to FM without overfitting, I constructed them in different ways, for example, for current day I used the previous day only. Likelihood features gave 0.002 improvement on the public lb.</p>\n<p>[/quote]</p>\n<p>Would you mind expanding on the likelihood feature&nbsp;design?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64016,
      "author_name": "efimov",
      "author_url": "",
      "post_date": "02/11/2015 10:55:21",
      "content": "<p>[quote=marbel;63974]</p>\n<p>Would you mind expanding on the likelihood feature&nbsp;design?</p>\n<p>[/quote]</p>\n<p>Actually, this is the first algorithm I tried in this competition. It gave 0.39400 on the public leaderboard with just 11 features with little feature engineering.</p>\n<p>Here is the algorithm:</p>\n<p>1) Choose the sequence of features, in my case I took the sequence:</p>\n<p>f = &quot;site_id&quot;,&nbsp;&quot;site_domain&quot;,&nbsp;&quot;app_id&quot;,&nbsp;&quot;banner_pos&quot;,&nbsp;&quot;device_id_count&quot;,&nbsp;&quot;device_conn_type&quot;,&nbsp;&quot;C16&quot;,&nbsp;&quot;device_ip_count&quot;,&nbsp;&quot;device_id_site_id_count&quot;,&nbsp;&quot;device_ip_site_id_count&quot;,&nbsp;&quot;device_model&quot;.</p>\n<p>2) Define the parameter M - reliable size of group (in my case I defined M = 28 by running grid search for different M).</p>\n<p>3) Define the sequence of jumps: j =&nbsp;11, 9, 8, 7, 4, 2.</p>\n<p>4) Start iteration by j:</p>\n<p>define likelihood inside the group: L = N1/N, where group is defined as f[1:j], N1 - number of clicks in the group, N - number of samples in the group.&nbsp;</p>\n<p>define weight for the group: W =&nbsp;1/(1+exp(-N+M)).</p>\n<p>After this step for each jump j I had likelihood L_j and weight W_j.</p>\n<p>5) Start iteration by reversed j:</p>\n<p>5.1) pred = global average of clicks;</p>\n<p>5.2) pred = W_j * L_j + (1-W_j)*pred.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64117,
      "author_name": "cydonia",
      "author_url": "",
      "post_date": "02/12/2015 15:49:44",
      "content": "<p>My solution(at 10th place) is as follows.</p>\n<p><strong>Working method:</strong></p>\n<ul>\n<li><span style=\"line-height: 1.4\">Tool I used: vowpal wabbit</span></li>\n<li><span style=\"line-height: 1.4\">Feature engineering:</span></li>\n</ul>\n<p style=\"padding-left: 60px\"><span style=\"line-height: 1.4\">- hour, device_ip and C17 were&nbsp;removed from my feature set, because they did not help.</span><br><span style=\"line-height: 1.4\">- quadratic interactions between major features and all others.</span><br><span style=\"line-height: 1.4\">&nbsp; The features which had greater impacts on my score were&nbsp;</span><br><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;device_model, app_id, site_id, site_domain and banner_pos.</span><br><span style=\"line-height: 1.4\">- cubic interactions among major features.</span><br><span style=\"line-height: 1.4\">- three types of count features (inspired by additions by Yannick Martel for tinrtgu code. &nbsp; &nbsp;Thanks Martel and tinrtgu):</span></p>\n<ol><ol><ol><ol><ol><ol>\n<li><span style=\"line-height: 1.4\">device_ip, device_id, device_ip * device_id and so on counted in all datasets.</span></li>\n<li><span style=\"line-height: 1.4\">the same features counted in past 24 hours.</span></li>\n<li><span style=\"line-height: 1.4\">the same features counted in reverse event order in 24 hours ahead.</span></li>\n</ol></ol></ol></ol></ol></ol>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - click rate for each feature with Laplace smoothing.</p>\n<ul>\n<li>Others:</li>\n</ul>\n<p style=\"padding-left: 30px\">- holdout was days 29 and 30</p>\n<p style=\"padding-left: 30px\">- parameter tuning of vowpal wabbit: --l1, -l, -b and --passes<br> - blending a model with click features and one without them</p>\n<p style=\"padding-left: 30px\">&nbsp;</p>\n<p><strong>Tried but not working methods:</strong></p>\n<ul>\n<ul>\n<li><span style=\"line-height: 1.4\">tinrtgu and Martel codes:</span></li>\n</ul>\n</ul>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;At first I used their codes as is, but oddly enough, the codes did not break 0.4 score barrier.</span></p>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I am not sure why, but I guess my preprocessed data files were corrupted or wrongly formatted.</span></p>\n<ul>\n<ul>\n<li><span style=\"line-height: 1.4\">neural network with or without dropout(--nn or --dropout).</span></li>\n<li><span style=\"line-height: 1.4\">stagewise polynomial feature(--stage_poly).</span></li>\n<li><span style=\"line-height: 1.4\">low rank quadratic feature with or without dropout(--lrq or --lrqdropout):</span></li>\n</ul>\n</ul>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I understand the lrq algorithm in vowpal wabbit has the same philosophy </span></p>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;as the factorization machine(FM)(if I am wrong, correct me!). Since lrq did not work,</span></p>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I did not try 3 idiots fm codes or libFM. Surprisingly (for me), it seems FM successfully </span></p>\n<p><span style=\"line-height: 1.4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; worked</span>&nbsp;in this competition. I should have tried FM!</p>\n<ul>\n<ul>\n<li><span style=\"line-height: 1.4\">3 idiots GBDT code, which I used for click rate features, only to overfit heavily.</span></li>\n<li><span style=\"line-height: 1.4\">removing rare features.</span></li>\n</ul>\n</ul>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64140,
      "author_name": "mamymo",
      "author_url": "",
      "post_date": "02/12/2015 20:09:11",
      "content": "<p>[quote=Julian de Wit;63888]</p>\n<ul>\n<li>Ideas to integrate FM / FTRL in a neural net.. That would be great if it's possible.</li>\n</ul>\n<p>[/quote]</p>\n<p>@Julian de Wit</p>\n<p>Interesting that you mentioned it. For this comp, I implemented an FM with drop out applying to the latent factors. This helps a lot in regularizing the FM and I was able to train it with a fairly high number of latent factors (48-64, took ages though, which is why I am also interested to see if it will work on a GPU, but I can't figure out how to align the sparse data.) Of course, once I did that I realize that I am treating the latent factors like hidden units in a neural net so I tried to stick another 'layer' in the back of these latent factors and apply an activation to turn it into a mini net. Unfortunately, these additions didn't really help me in this contest.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64177,
      "author_name": "ivanlobov",
      "author_url": "",
      "post_date": "02/13/2015 18:57:54",
      "content": "<p>My approach to 18th place:</p>\n<p><strong>Feature engineering: </strong></p>\n<p>user id by combining device id / device ip / device model + intraday frequency for user id. Removed all the features that were not present in test set.</p>\n<p><strong>Models:</strong></p>\n<p>Lots of different logistic regressions. I couldn't make FTRL work as good as a simple AdaGrad (thanks to Abnishek's code from Criteo!). I got 0.3663 on private leaderboard with a simple AdaGrad! That was a shock for me.</p>\n<p>I tried single hidden layer perceptron with no success. And after that I set out to build a working Stochastic Gradient Boosting Machine with weights from logistic regression as one of the inputs and it could improve the score. But mainly it didn't give me as good result as I was hoping for. An ensemble of it + best AdaGrad gave me 0.3856 on the private leaderboard.</p>\n\n<p>I would say that feature engineering and ensembling could get me much higher while I was putting to much effort into building and testing different alogithms. Anyway, It was real fun and I leant a lot from it. Thanks everybody!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64196,
      "author_name": "vvarkey",
      "author_url": "",
      "post_date": "02/13/2015 22:13:55",
      "content": "<p>[quote=KazAnova;63921]</p>\n<p>I did all of these in a manner that I made predictions for days 30 and 31. Then I used Extra trees and XGBoost as meta-models to combine these and to get my final submission.&nbsp;</p>\n<p>[/quote]</p>\n<p>Am I understanding this correctly: you take the output click probabilities of a number of models and feed them to XGBoost to get a final probability?</p>\n<p>I'm curious how many models and what improvement from your best single model you got.</p>\n<p>Cheers!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64205,
      "author_name": "kazanova",
      "author_url": "",
      "post_date": "02/14/2015 01:03:27",
      "content": "<p>[quote=laserwolf;64196]</p>\n<p>Am I understanding this correctly: you take the output click probabilities of a number of models and feed them to XGBoost to get a final probability?</p>\n<p>[/quote]</p>\n<p>So all my models were trained with the following logic:</p>\n<p>1) Choose a classifier</p>\n<p>2) Build a model with the selected classifier using data from 20-29 days</p>\n<p>3) make predictions (in probabilities) for day 30</p>\n<p>4) save the labels that correspond to day 30</p>\n<p>5) Build a model&nbsp;with the selected classifier using data from 20-30 days</p>\n<p>6)&nbsp; make predictions (in probabilities) for day 31</p>\n<p>7) once I have number of predictions for different classifiers, I use as new training set my predictions for day 30 and as test set the predictions of the different models for day 31</p>\n<p>8) i used XGBOOST to make this meta-model (that uses as inputs the predictions of all the models)</p>\n<p>A weak point of this approach is that the models are combined based on predictions for day 30 which might be slightly different than day 31</p>\n<p>[quote=laserwolf;64196]</p>\n<p>I'm curious how many models and what improvement from your best single model you got.</p>\n<p>[/quote]</p>\n<p>I made 17 models</p>\n<p>my best single model was 0.392</p>\n<p>The&nbsp;weighted average of my models was around 0.388+</p>\n<p>The XGBoost ensemble took me down to 0.385+</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64218,
      "author_name": "juliandewit",
      "author_url": "",
      "post_date": "02/14/2015 07:21:25",
      "content": "<p>I'm really interested in how far this really could be pushed.<br>For instance.. for me 29+30 was a better CV than 30 only. Perhaps that alone might improve the scores. I always hope to acquire general knowledge from a competition. Many feature engineering tricks just work once for one comp and not for the other. This ensembling approach is general knowledge. Of course it is known but I really thought it was not&nbsp;working in this competition.<br>But I'm worried&nbsp;of you can solve the problem of, say, converting the date-of-birth to an age..<br><br>But perhaps one of the first jobs that datascientists automate is their own job :)</p>\n<p><br>@mymo</p>\n<p>Of course I was wildly speculating but I was thinking the same thing.<br>Next to the &quot;normal&quot; neurons, have a number of latent factor-neurons... When you think of it. finding interactions is very hard for NN's. It's just not a natural fit. This would help them. Another idea was to put&nbsp;the FM on top of the network as the last layer..<br><br><br></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64340,
      "author_name": "vvarkey",
      "author_url": "",
      "post_date": "02/16/2015 14:42:27",
      "content": "<p>[quote=KazAnova;64205]</p>\n<p>I made 17 models</p>\n<p>my best single model was 0.392</p>\n<p>The&nbsp;weighted average of my models was around 0.388+</p>\n<p>The XGBoost ensemble took me down to 0.385+</p>\n<p>[/quote]</p>\n<p>Thanks so much KazAnova for this awesome post!</p>\n<p>I just can't seem to get XGBoost to ensemble better than a simple weighted average though. are you &nbsp;binary:logistic or something else? if you could post your configs that would be awesome.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64344,
      "author_name": "kazanova",
      "author_url": "",
      "post_date": "02/16/2015 15:08:46",
      "content": "<p>SEED=10</p>\n<p>param = {} <br> eta=0.04<br> max_depth=11<br> subs=1.0<br> thread=30<br> trees=600<br> param['objective'] = 'binary:logistic'<br> param['bst:eta'] = eta<br> param['bst:max_depth'] = max_depth<br> param['eval_metric'] = 'auc'<br> #param['bst:min_child_weight']=1<br> param['silent'] = 1<br> param['seed'] = SEED<br> param['nthread'] = thread<br> param['bst:subsample'] = subs</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64376,
      "author_name": "changyangfan",
      "author_url": "",
      "post_date": "02/17/2015 01:41:59",
      "content": "<p>[quote=infinitezxc;63870]</p>\n<p>Thanks guys. :) This competition is really long but fun.</p>\n<p>And special thanks to&nbsp;tingrtu and 3 idiots for their awesome code for ftrl, fm and gbdt. Our method is mainly built on their code with moderate modifications. But maybe it is feature engineering that is the most important.</p>\n<p>We make up about 10 numerical features by counting the times of impression to one person and time intervals. How to locate a person is an interesting question though. Device_id has too many nulls and device_ip is not that accurate. We use device_id if it is not null and device_ip+device_model for others. Then we use gbdt trained on numerical features to better &quot;bin&quot; these features and get some edge.</p>\n<p>Our final solution is the ensemble of several ftrl and fm models. In ftrl selected interactions and gbdt features are used and in fm both the model with gbdt features and without gbdt features are used. We will post the code and detailed document soon.</p>\n<p>[/quote]</p>\n<p>@infinitezxc</p>\n<p>&#20146;,&#22312;&#21738;&#37324;&#33021;&#24471;&#21040;&#24744;&#30340;&#25991;&#26723;,&#22914;&#26524;&#21457;&#25918;&#20986;&#26469;&#30340;&#35805;,&#35831;&#36890;&#30693;&#25105;&#20204;&#19968;&#19979;&#22909;&#21527;?&#26399;&#24453;..</p>\n<p>&#39034;&#20415;&#38382;&#19968;&#19979;,&#20146;&#22312;&#21738;&#37324;&#39640;&#23601;?&#25105;&#20204;&#24819;&#36992;&#35831;&#20146;&#26469;&#25105;&#20204;&#20844;&#21496;&#20570;&#19968;&#19979;&#35762;&#24231;.&#22914;&#26524;&#24744;&#26085;&#31243;&#33021;&#23433;&#25490;&#30340;&#35805;,&#35831;&#22238;&#22797;&#25105;&#19968;&#19979;.&#35874;&#35874;.</p>\n<p>&#25105;&#30340;&#37038;&#31665;:306388406@qq.com</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64382,
      "author_name": "xueerchen",
      "author_url": "",
      "post_date": "02/17/2015 04:58:00",
      "content": "<p>&#19968;&#33324;&#35201;&#22312;&#27604;&#36187;&#32467;&#26463;&#21518;&#20004;&#21608;&#20043;&#20869;&#19978;&#20256;&#25991;&#26723;&#21040;&#35770;&#22363;&#65292;&#25105;&#20204;&#20063;&#22909;&#24819;&#30475;&#21834;&#128064;&#65292; &#22826;&#21385;&#23475;&#20102;&#20320;&#20204;@infinitezxc&#65281;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64386,
      "author_name": "infinite",
      "author_url": "",
      "post_date": "02/17/2015 09:53:40",
      "content": "<p>@chang yangfan @Xueer Chen &#25991;&#26723;&#24050;&#32463;&#24046;&#19981;&#22810;&#25972;&#29702;&#22909;&#20102;&#65292;&#39532;&#19978;&#20250;&#26681;&#25454;&#35201;&#27714;&#25918;&#20986;&#26469;&#30340;&#12290;:&#65289;&#21487;&#20197;&#37038;&#31665;&#32852;&#31995; infinitezxc@gmail.com</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64463,
      "author_name": "harnalashok",
      "author_url": "",
      "post_date": "02/18/2015 04:43:23",
      "content": "<p>The problem appears to be tough for those who are new to ML. (Unfortunately) some students in my Institute have taken up this as a graduation Project and want to stick to it. I will be grateful if some simple and working code that achieves good enough results can be posted so they can further work upon it. Thanks.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64474,
      "author_name": "cartographic",
      "author_url": "",
      "post_date": "02/18/2015 09:11:20",
      "content": "<p>[quote=ashok k harnal;64463]</p>\n<p>I will be grateful if some simple and working code that achieves good enough results can be posted so they can further work upon it.</p>\n<p>[/quote]</p>\n<p>There are already several good examples on the forums: tinrtgu's FTRL in python; a few vowpal wabbit examples; and xgboost/R in the recent thread.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64476,
      "author_name": "gangbeng",
      "author_url": "",
      "post_date": "02/18/2015 09:15:29",
      "content": "<p>@chang yangfan @Xueer Chen&nbsp;@infinitezxc</p>\n<p>&#20170;&#22825;&#25165;&#30693;&#36947;&#12290;&#12290;&#21407;&#26469;&#21487;&#20197;&#25171;&#20013;&#25991;&#12290;&#12290;&#12290;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64480,
      "author_name": "harnalashok",
      "author_url": "",
      "post_date": "02/18/2015 09:40:16",
      "content": "<p>Thanks Lewis. Vowpal wabbit examples do appear easy to follow.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64549,
      "author_name": "orirafael",
      "author_url": "",
      "post_date": "02/19/2015 04:28:05",
      "content": "<p>For those deep learners among you - how would you use neural networks&nbsp;in this competition?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64799,
      "author_name": "owenzhang1",
      "author_url": "",
      "post_date": "02/24/2015 04:37:35",
      "content": "<p>Thanks everyone for sharing. Here is my solution:</p>\n\n<p>https://github.com/owenzhang/kaggle-avazu</p>\n\n<p>It is largely based 3 idiots' winning solution for criteo.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64855,
      "author_name": "yejiming",
      "author_url": "",
      "post_date": "02/25/2015 10:27:19",
      "content": "<p>[quote=Owen;64799]</p>\n<p>Thanks everyone for sharing. Here is my solution:</p>\n<p>https://github.com/owenzhang/kaggle-avazu</p>\n<p>It is largely based 3 idiots' winning solution for criteo.&nbsp;</p>\n<p>[/quote]</p>\n\n<p>Thanks so much!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64866,
      "author_name": "jiweiliu",
      "author_url": "",
      "post_date": "02/25/2015 14:40:09",
      "content": "<p>Time to learn from the best :D</p>\n<p>thank you Owen and 4 idiots for sharing their <a href=\"https://www.kaggle.com/c/avazu-ctr-prediction/forums/t/12608/4-idiots-solution-libffm\">solution</a>&nbsp;!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65015,
      "author_name": "changyangfan",
      "author_url": "",
      "post_date": "02/27/2015 09:18:38",
      "content": "<p>[quote=infinitezxc;64386]</p>\n<p>@chang yangfan @Xueer Chen &#25991;&#26723;&#24050;&#32463;&#24046;&#19981;&#22810;&#25972;&#29702;&#22909;&#20102;&#65292;&#39532;&#19978;&#20250;&#26681;&#25454;&#35201;&#27714;&#25918;&#20986;&#26469;&#30340;&#12290;:&#65289;&#25105;&#36824;&#26159;&#28165;&#21326;&#35745;&#31639;&#26426;&#30740;&#19968;&#30340;&#23398;&#29983;...&#21487;&#20197;&#37038;&#31665;&#32852;&#31995; infinitezxc@gmail.com</p>\n<p>[/quote]</p>\n<p>&#21457;&#36865;&#20102;&#37038;&#20214;,&#19981;&#30693;&#36947;&#26159;&#21542;&#25910;&#21040;!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65223,
      "author_name": "infinite",
      "author_url": "",
      "post_date": "03/02/2015 08:05:41",
      "content": "<p>Hi All,</p>\n<p>We have prepared our code and document&nbsp;<a href=\"https://github.com/infinitezxc/kaggle-avazu\">here</a>.</p>\n<p>Your comments are very welcome. :)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65282,
      "author_name": "guestwalk",
      "author_url": "",
      "post_date": "03/02/2015 19:32:08",
      "content": "<p>[quote=infinitezxc;65223]</p>\n<p>Hi All,</p>\n<p>We have prepared our code and document&nbsp;<a href=\"https://github.com/infinitezxc/kaggle-avazu\">here</a>.</p>\n<p>Your comments are very welcome. :)</p>\n<p>[/quote]</p>\n<p>Great work!</p>\n<p>I have a question. I see you added the first order terms into FFM. In my experience, removing first order terms works slightly better. (I can't remember the exact difference.)&nbsp;Did you observe any improvement by adding the first order terms back? Thanks!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65312,
      "author_name": "infinite",
      "author_url": "",
      "post_date": "03/03/2015 02:02:49",
      "content": "<p>[quote=guestwalk;65282]</p>\n<p>I have a question. I see you added the first order terms into FFM. In my experience, removing first order terms works slightly better. (I can't remember the exact difference.)&nbsp;Did you observe any improvement by adding the first order terms back? Thanks!</p>\n<p>[/quote]</p>\n<p>Yes. We got ~0.001 improvement on this dataset by adding first order terms at an early stage and we keep using it regarding the positive result.</p>\n<p>Thanks again for the excellent work in the two competitions, we learned a lot from your solutions. :)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65323,
      "author_name": "guestwalk",
      "author_url": "",
      "post_date": "03/03/2015 11:22:28",
      "content": "<p>[quote=infinitezxc;65312]</p>\n<p>[quote=guestwalk;65282]</p>\n<p>I have a question. I see you added the first order terms into FFM. In my experience, removing first order terms works slightly better. (I can't remember the exact difference.)&nbsp;Did you observe any improvement by adding the first order terms back? Thanks!</p>\n<p>[/quote]</p>\n<p>Yes. We got ~0.001 improvement on this dataset by adding first order terms at an early stage and we keep using it regarding the positive result.</p>\n<p>Thanks again for the excellent work in the two competitions, we learned a lot from your solutions. :)</p>\n<p>[/quote]</p>\n<p>I see. 0.001 is a significant improvement. I may need to check this issue again. Thanks a lot for your answer!&nbsp; :)</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "63845": "",
    "63846": "",
    "63850": "",
    "63852": "",
    "63866": "",
    "63870": "",
    "63871": "",
    "63872": "",
    "63873": "",
    "63875": "",
    "63876": "",
    "63877": "",
    "63878": "",
    "63881": "",
    "63888": "",
    "63890": "",
    "63906": "",
    "63907": "",
    "63908": "",
    "63909": "",
    "63913": "",
    "63915": "",
    "63921": "",
    "63949": "",
    "63957": "",
    "63968": "",
    "63969": "",
    "63974": "",
    "64016": "",
    "64117": "",
    "64140": "",
    "64177": "",
    "64196": "",
    "64205": "",
    "64218": "",
    "64340": "",
    "64344": "",
    "64376": "",
    "64382": "",
    "64386": "",
    "64463": "",
    "64474": "",
    "64476": "",
    "64480": "",
    "64549": "",
    "64799": "",
    "64855": "",
    "64866": "",
    "65015": "",
    "65223": "",
    "65282": "",
    "65312": "",
    "65323": ""
  },
  "source": "meta"
}