{
  "id": 3894,
  "title": "Solutions",
  "url": "/competitions/event-recommendation-engine-challenge/writeups/andrei-olariu-solutions",
  "author_name": "",
  "post_date": "2013-02-21T22:35:30.580Z",
  "votes": 15,
  "comment_count": 16,
  "views": 14501,
  "content": "<p>Well this was fun :)</p>\r\n<p>Congrats to the winners! GG</p>\r\n<p>I'd like to start this topic for participants that want to share their solutions. I'm really curious how others approached the problem.</p>\r\n<p>My code and comments are here: http://webmining.olariu.org/event-recommendation-contest-on-kaggle</p>",
  "messages": [
    {
      "id": "20690",
      "postDate": "02/21/2013 22:35:30",
      "content": "<p>Well this was fun :)</p>\r\n<p>Congrats to the winners! GG</p>\r\n<p>I'd like to start this topic for participants that want to share their solutions. I'm really curious how others approached the problem.</p>\r\n<p>My code and comments are here: http://webmining.olariu.org/event-recommendation-contest-on-kaggle</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20700",
      "postDate": "02/22/2013 07:39:23",
      "content": "<p>The contest was indeed exciting..&nbsp; If anything I learnt the perils of overfitting in this contest. Our code is in a bit of a mess.. :) .. I will put it up along with a blog post after we clean it, but here is a summary of what we did.</p>\r\n<p>We used regression (random forest, grad boost regressor in scikit) to score each (user, event) pair. A target of 1 if interested and 0 if not. (Funnily everytime we tried to use the 'not interested' column my score decreased hence we ignored it).</p>\r\n<p>Being amateurs in programming and python, we didn't know how to handle the 3 million events, but we noticed only 30k odd events featured in any other data file, hence we pruned the rest of the events and made a 13MB file out of the 1.1GB file and only worked\r\n with that.. :)</p>\r\n<p>Also we didn't do any clustering, (user or event) we just put all the event details also in the feature vector for the (user, event) pair. The feature vector had three parts : The user part (containing age, sex, locale, no. of events attended etc.) , the\r\n event part (no. of attendees, word freq count etc) and the 'User-Event' part. The main components of User-Event part is detailed below:</p>\r\n<p>&nbsp;# and fraction of friends who attended the event; friendship with event creator;&nbsp; if event city is a substring of user location; No of `similar' events attended by the user; No. of similar events attended by the friends of the user; Time between event start\r\n and event seen by the user;&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>After a cross validation and some careful weighting of the regressors, we managed 0.727 (3rd) by the time public leaderboard closed.&nbsp;\r\n</p>\r\n<p>In the last one week, we added more RFs/GBRs with different parameters and also added dolaameng's regression results to the already significant number of sub-learners. (Thanks to dolaameng for his code)</p>\r\n<p>Managed to get 0.707 and 6th place in the final result.</p>\r\n<p>&nbsp;</p>\r\n<p>Best,</p>\r\n<p>Harishgp.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20702",
      "postDate": "02/22/2013 08:55:59",
      "content": "<p>@Harishgp</p>\r\n<blockquote>\r\n<p>&nbsp;(Funnily everytime we tried to use the 'not interested' column my score decreased hence we ignored it).</p>\r\n</blockquote>\r\n<p>I was puzzled by this one too. Seem to remember doing a query and finding that after taking the funny business about time stamps into account, there weren't any not-interesteds in the remaining data.</p>\r\n<p>@Andrei</p>\r\n<blockquote>\r\n<p>&quot;I didn't manage to get anything out of user age and gender. I'm still wondering if (and how) that info can be used in some useful way.&quot;</p>\r\n</blockquote>\r\n<p>FWIW, I managed to get something out of that by adding up the keyword vectors of all people of a particular gender in a locale's attendances and interests, and taking the cosine similarity with the event in question. Worried now about over fitting (lost\r\n 20 places in the final cut perhaps from this and another feature.) Also my GLM results showed older people were a little less likely to be interested.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20706",
      "postDate": "02/22/2013 12:36:55",
      "content": "<p>@Andrei. Excellent solution!</p>\r\n<p>your blog says that &quot;<span>I chose a Random Forest (again.. scikit-learn), because it was able to work with missing values. &quot;</span></p>\r\n<p><span>I use sklearn, too. Could you illustrate how to work with missing values in sklearn? thanks in advance.</span></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20707",
      "postDate": "02/22/2013 13:03:51",
      "content": "<p>My team built several models and blended them together using logistic regression. &nbsp;We also found approaching this as a classification problem and ignoring 'not interested' worked best. &nbsp;Our models included libFM, svmrank, regularized greedy forests, R's\r\n gbm, and random forest on various subsets of the data. &nbsp;The regularized greedy forests gave the best single model.</p>\r\n<p>Over fitting was an issue in this competition and we expected to see a shake up in the private leader board. &nbsp;The regularization of the final logistic regression made a big difference in our final score. &nbsp;Specifically, L2 regularization worked better for\r\n us than L1 regularization. &nbsp;Varying the regularization parameter gave a 0.02 range of scores with better scores favoring more regularization.</p>\r\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20723",
      "postDate": "02/22/2013 21:45:42",
      "content": "<p>Congrats to the winners!</p>\r\n<p>It was a lot fun. I wrote a blog post about my solution and why the difference between public and private has so big(from 1th to 15th) and it has nothing to do with overfitting:</p>\r\n<p>http://datalab.lu/blog/2013/02/21/kaggle-event-recommentation-engine/</p>\r\n<p>Cheers,</p>\r\n<p>Dzidas</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20725",
      "postDate": "02/22/2013 22:13:05",
      "content": "<p>@Matthew - I tried adding the age and gender, as they were or by building an event profile (with the average age and gender of attendants). They were ranked as important by the random trees, but crossvalidation error increased.</p>\r\n<p>@hellofys - You don't have to do anything. Missing values were represented as None in the feature vectors. The Random Forest Classifier from scikit-learn will work with that. For SVM or Logistic Regression, you'll have to remove those features or use some\r\n averaging technique.</p>\r\n<p>@Dzidas - I also struggled with those locations. Having an API to get coordinates was so comfortable. But you could get the same results without. There are 1.6 million events with both location string and GPS coordinates. That's a big dataset. I used them\r\n to match the other locations to coordinates. Nonetheless, I also think that this sort of data should be provided already processed or tools that use public information should be allowed.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20728",
      "postDate": "02/22/2013 22:51:17",
      "content": "<p>@Andrei - yep, you right that users locations could be derived from events database. I didn't get such idea and it is why my score is lower ;)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20743",
      "postDate": "02/23/2013 02:17:07",
      "content": "<p><span>@Andrei - I try do nothing with missing value. For example,</span></p>\r\n<pre>a = np.array([[1,np.NaN,3],[4,5,6]])<br>clf = RandomForestClassifier()<br>clf.fit(a[:, :2], a[:,2])</pre>\r\n<pre>It comes with error &quot;ValueError: Array contains NaN or infinity.&quot;</pre>\r\n<p><span><br>\r\n</span></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20749",
      "postDate": "02/23/2013 05:59:47",
      "content": "<p><span>@Andrei @hellofys I may shed some light on this - it seems that the Random Forest in the latest relase of scikit-learn doesn't work well with missing values, while previous versions tolerated them. I've updated scikit-learn midway during the challenge,\r\n and suddenly encountered the error @hellofys is describing.&nbsp;</span></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20753",
      "postDate": "02/23/2013 11:19:23",
      "content": "<p>Hi guys,</p>\r\n<p>this competition was basically all about feature creation. So here is a list of my some of my features:</p>\r\n<ul>\r\n<li>There were 3 different dates ( the start time of the event, the jointed_at date, the timestamp). I added all time differences between each dates. They were all important.\r\n</li><li>Additionally I extracted the year, month, day, hour and weekday of each date, but of these features had only a small impact.\r\n</li><li>I clustered all events using only the c_1, c_2, ..., c_n-features with kmeans (about 30 categories).\r\n</li><li>I counted how many events each user had in the train/test file (very important feature).\r\n</li><li>I defined similar users as users, which have about the same age, same timezone and same gender and counted how many of them had a yes/maybe/no/invited for the given event. However, these features had no big impact.\r\n</li><li>Country was important, too. I only used the 10 most common countries and put all others into the category &quot;Other&quot;. I did the same for locale and city.\r\n</li><li>The &quot;usual&quot; stuff: Count of yes/maybe/no/invited of all friends and all other users. Lat and lng were very important as well\r\n</li></ul>\r\n<p>In the end I had about 60-70 features, which were all more or less important.</p>\r\n<p>With all these features I tried to predict the &quot;interested&quot;-column and for this I used the probability-output of a gbm. My aim was to minimize the LogLoss-error between my prediction and the actual solution. I never used the MAP-metric, because the lower\r\n the LogLoss-error the higher the MAP.</p>\r\n<p>The create a submission I ordered all events using my probability-prediction.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20754",
      "postDate": "02/23/2013 12:51:27",
      "content": "<p>[quote=jsf;20753]</p>\r\n<ul>\r\n<li>There were 3 different dates ( the start time of the event, the jointed_at date, the timestamp). I added all time differences between each dates. They were all important.\r\n</li><li>I clustered all events using only the c_1, c_2, ..., c_n-features with kmeans (about 30 categories).\r\n</li><li>The &quot;usual&quot; stuff: Count of yes/maybe/no/invited of all friends and all other users. Lat and lng were very important as well\r\n</li></ul>\r\n<p>[/quote]</p>\r\n<p>We also used the above features written by jsf as well as the proportion of count to the total response, and also did user community detection. Since the number of users are quite large, we first filtered out users to users whose info is available, that\r\n is, who are in users.csv file. We also tried to take into account that how many events each user had and it was actually top ranked in terms of relative inference by gbm, but we reconsidered and omitted from our final model. I think the reason the number of\r\n events is important when you make score in probability is obvious, probability of interested is 1/4, 1/5, 1/6 depending on the number of events 4, 5, 6 respectively, but we couldn't believe that it is relevant and in our experiments, it didn't give any improvement\r\n in MAP metric. We used about 30 features. Our final model was averaged over gbm w/ bernoulli, gbm w/ adaboost, and randomForest.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20759",
      "postDate": "02/23/2013 15:22:54",
      "content": "<p>Well my solution wasn't a lot different than the others and I attribute my high ranking mostly to luck. When the public leaderboard was frozen, I was at the 11th position, and since I did not get any significant breakthrough in the remaining week, I was\r\n a bit surprised to find myself in the third place.</p>\r\n<p>&nbsp;</p>\r\n<p>Two features that I think are unique in my solution involved directly comparing the events that were suggested to a given user each against the other. The first feature was the distance of each feature from the median of the locations of all the events shown\r\n to the user. This actually worked better than any other distance metric I've used (I didn't try any third party services, but I did leveraged the locations of the events in events.csv to estimate the coordinates of users). The other feature first found out\r\n which event was happening first from all those suggested and then calculated for each event the ratio between its delta and that minimum delta.</p>\r\n<p>&nbsp;</p>\r\n<p>You can read about the lessons I've learned here -&nbsp;http://www.rouli.net/2013/02/five-lessons-from-kaggles-event.html, which also details a sad twist in my story.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20761",
      "postDate": "02/23/2013 16:06:18",
      "content": "<p>I tried similar features as jsf, but used only &quot;gaussian&quot; gbm.</p>\r\n<p>I built two type of gbm models.The first model roughly estimated the probability of interestedness, then the second model refined the first model.</p>\r\n<p><span>https://github.com/tks0123456789/kaggle-event-recommendation</span></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20947",
      "postDate": "02/28/2013 12:34:18",
      "content": "<p>Hi,</p>\r\n<p>congrats to the winners too!!</p>\r\n<p>I spent a lot of time comparing various target modeling strategies: interested vs. not interested classif,&nbsp;&nbsp; interested vs not interested vs unknown,&nbsp;&nbsp; learning to rank (ala SVMRank).</p>\r\n<p>I ended up with the simplest one, interested vs. other classification using GBRTs using prediction score to rank the events. I was quite surprised that pure ranking solution did not work well for this contest. Did anybody also tried ranking strategies, pairwise\r\n or listwise?</p>\r\n<p>Also, I am sure you noticed some events had identical descriptions (only id differs in events.csv) but different attendees. I did not manage to tranform this into a informative feature.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "20972",
      "postDate": "03/01/2013 17:52:10",
      "content": "<p>I'd be really interested to hear what anyone that used clustering successfully did exactly. E.g.</p>\r\n<ul>\r\n<li>Clustered events... just on the keywords or on other features/ derived features?\r\n</li><li>Which set of events: all events; just ones mentioned somewhere in the train / test data; some other subset?\r\n</li><li>What use did you make of it?\r\n<ul>\r\n<li>I tried: rank the clusters by similarity to a user, assign the event the rank of the cluster it was most similar to. And a similar thing with all men/women in a locale.\r\n</li></ul>\r\n</li></ul>\r\n<p>Also, I found charting my performance on the public/private leaderboards interesting. Some morals for me:</p>\r\n<ul>\r\n<li>not to chuck stuff in at the end after having been cautious for most of the comp;\r\n</li><li>not to balk at rolling back features to earlier states from later, fancier ones;\r\n</li><li>if I've been 'good' (not using potentially leaky features) to consider trusting the public leaderboard as an unbiased estimate of success, and thus go with whatever score was highest (in this case .67, roughly 20 places up).\r\n</li></ul>\r\n<p><img title=\"scores\" src=\"https://docs.google.com/a/refute.me.uk/spreadsheet/oimg?key=0AlMeiFaXKYpJdFM1RnRrVVZqTXRUWUh3Yng1Ymt3X3c&amp;oid=1&amp;zx=a2tkvffgdw4a\" alt=\"scores\" width=\"626\" height=\"501\"></p>\r\n<p>Thanks for the joys of hindsight all.</p>\r\n<p>&nbsp;</p>\r\n<p>PS @Andrei, thanks for the insight.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "92227",
      "postDate": "09/12/2015 03:47:01",
      "content": "<p>I am building a product recommender system, instead of recommending event i have to recommend products. Please advise on the below question.</p>\n\n<p>I am treating this problem as a classification problem and for each user-product combination i am predicting the probability of purchase using (GBM etc). </p>\n\n<p>Given the class imbalance(6% event rate) &amp; that fact that I need to maximize map@k which is the best loss function &amp; evaluation criteria for evaluating result of a binary classifier( random forest/ gbm etc)? </p>\n\n<p>I am asking because I can't specify map@k as evaluation criteria in for a binary classifier right?</p>\n\n<p>Did you use recall or precision or kappa etc as a scoring criteria for tune the hyper parameters of the random forest? Please advise.</p>\n\n<p>Can someone explain how this statement by Josef Feigl. I didnt understand.</p>\n\n<blockquote>\n  <p>&quot;My aim was to minimize the LogLoss-error between my prediction and\n  the actual solution. I never used the MAP-metric, because the lower\n  the LogLoss-error the higher the MAP.&quot;</p>\n</blockquote>",
      "rawMarkdown": "I am building a product recommender system, instead of recommending event i have to recommend products. Please advise on the below question.\r\n\r\nI am treating this problem as a classification problem and for each user-product combination i am predicting the probability of purchase using (GBM etc). \r\n\r\nGiven the class imbalance(6% event rate) & that fact that I need to maximize map@k which is the best loss function & evaluation criteria for evaluating result of a binary classifier( random forest/ gbm etc)? \r\n\r\nI am asking because I can't specify map@k as evaluation criteria in for a binary classifier right?\r\n\r\nDid you use recall or precision or kappa etc as a scoring criteria for tune the hyper parameters of the random forest? Please advise.\r\n\r\nCan someone explain how this statement by Josef Feigl. I didnt understand.\r\n\r\n> \"My aim was to minimize the LogLoss-error between my prediction and\r\n> the actual solution. I never used the MAP-metric, because the lower\r\n> the LogLoss-error the higher the MAP.\"",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 20700,
      "author_name": "harishgp",
      "author_url": "",
      "post_date": "02/22/2013 07:39:23",
      "content": "<p>The contest was indeed exciting..&nbsp; If anything I learnt the perils of overfitting in this contest. Our code is in a bit of a mess.. :) .. I will put it up along with a blog post after we clean it, but here is a summary of what we did.</p>\r\n<p>We used regression (random forest, grad boost regressor in scikit) to score each (user, event) pair. A target of 1 if interested and 0 if not. (Funnily everytime we tried to use the 'not interested' column my score decreased hence we ignored it).</p>\r\n<p>Being amateurs in programming and python, we didn't know how to handle the 3 million events, but we noticed only 30k odd events featured in any other data file, hence we pruned the rest of the events and made a 13MB file out of the 1.1GB file and only worked\r\n with that.. :)</p>\r\n<p>Also we didn't do any clustering, (user or event) we just put all the event details also in the feature vector for the (user, event) pair. The feature vector had three parts : The user part (containing age, sex, locale, no. of events attended etc.) , the\r\n event part (no. of attendees, word freq count etc) and the 'User-Event' part. The main components of User-Event part is detailed below:</p>\r\n<p>&nbsp;# and fraction of friends who attended the event; friendship with event creator;&nbsp; if event city is a substring of user location; No of `similar' events attended by the user; No. of similar events attended by the friends of the user; Time between event start\r\n and event seen by the user;&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>After a cross validation and some careful weighting of the regressors, we managed 0.727 (3rd) by the time public leaderboard closed.&nbsp;\r\n</p>\r\n<p>In the last one week, we added more RFs/GBRs with different parameters and also added dolaameng's regression results to the already significant number of sub-learners. (Thanks to dolaameng for his code)</p>\r\n<p>Managed to get 0.707 and 6th place in the final result.</p>\r\n<p>&nbsp;</p>\r\n<p>Best,</p>\r\n<p>Harishgp.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20702,
      "author_name": "matthewpearce",
      "author_url": "",
      "post_date": "02/22/2013 08:55:59",
      "content": "<p>@Harishgp</p>\r\n<blockquote>\r\n<p>&nbsp;(Funnily everytime we tried to use the 'not interested' column my score decreased hence we ignored it).</p>\r\n</blockquote>\r\n<p>I was puzzled by this one too. Seem to remember doing a query and finding that after taking the funny business about time stamps into account, there weren't any not-interesteds in the remaining data.</p>\r\n<p>@Andrei</p>\r\n<blockquote>\r\n<p>&quot;I didn't manage to get anything out of user age and gender. I'm still wondering if (and how) that info can be used in some useful way.&quot;</p>\r\n</blockquote>\r\n<p>FWIW, I managed to get something out of that by adding up the keyword vectors of all people of a particular gender in a locale's attendances and interests, and taking the cosine similarity with the event in question. Worried now about over fitting (lost\r\n 20 places in the final cut perhaps from this and another feature.) Also my GLM results showed older people were a little less likely to be interested.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20706,
      "author_name": "hellofys",
      "author_url": "",
      "post_date": "02/22/2013 12:36:55",
      "content": "<p>@Andrei. Excellent solution!</p>\r\n<p>your blog says that &quot;<span>I chose a Random Forest (again.. scikit-learn), because it was able to work with missing values. &quot;</span></p>\r\n<p><span>I use sklearn, too. Could you illustrate how to work with missing values in sklearn? thanks in advance.</span></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20707,
      "author_name": "chaseos",
      "author_url": "",
      "post_date": "02/22/2013 13:03:51",
      "content": "<p>My team built several models and blended them together using logistic regression. &nbsp;We also found approaching this as a classification problem and ignoring 'not interested' worked best. &nbsp;Our models included libFM, svmrank, regularized greedy forests, R's\r\n gbm, and random forest on various subsets of the data. &nbsp;The regularized greedy forests gave the best single model.</p>\r\n<p>Over fitting was an issue in this competition and we expected to see a shake up in the private leader board. &nbsp;The regularization of the final logistic regression made a big difference in our final score. &nbsp;Specifically, L2 regularization worked better for\r\n us than L1 regularization. &nbsp;Varying the regularization parameter gave a 0.02 range of scores with better scores favoring more regularization.</p>\r\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20723,
      "author_name": "dzidas",
      "author_url": "",
      "post_date": "02/22/2013 21:45:42",
      "content": "<p>Congrats to the winners!</p>\r\n<p>It was a lot fun. I wrote a blog post about my solution and why the difference between public and private has so big(from 1th to 15th) and it has nothing to do with overfitting:</p>\r\n<p>http://datalab.lu/blog/2013/02/21/kaggle-event-recommentation-engine/</p>\r\n<p>Cheers,</p>\r\n<p>Dzidas</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20725,
      "author_name": "aolariu",
      "author_url": "",
      "post_date": "02/22/2013 22:13:05",
      "content": "<p>@Matthew - I tried adding the age and gender, as they were or by building an event profile (with the average age and gender of attendants). They were ranked as important by the random trees, but crossvalidation error increased.</p>\r\n<p>@hellofys - You don't have to do anything. Missing values were represented as None in the feature vectors. The Random Forest Classifier from scikit-learn will work with that. For SVM or Logistic Regression, you'll have to remove those features or use some\r\n averaging technique.</p>\r\n<p>@Dzidas - I also struggled with those locations. Having an API to get coordinates was so comfortable. But you could get the same results without. There are 1.6 million events with both location string and GPS coordinates. That's a big dataset. I used them\r\n to match the other locations to coordinates. Nonetheless, I also think that this sort of data should be provided already processed or tools that use public information should be allowed.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20728,
      "author_name": "dzidas",
      "author_url": "",
      "post_date": "02/22/2013 22:51:17",
      "content": "<p>@Andrei - yep, you right that users locations could be derived from events database. I didn't get such idea and it is why my score is lower ;)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20743,
      "author_name": "hellofys",
      "author_url": "",
      "post_date": "02/23/2013 02:17:07",
      "content": "<p><span>@Andrei - I try do nothing with missing value. For example,</span></p>\r\n<pre>a = np.array([[1,np.NaN,3],[4,5,6]])<br>clf = RandomForestClassifier()<br>clf.fit(a[:, :2], a[:,2])</pre>\r\n<pre>It comes with error &quot;ValueError: Array contains NaN or infinity.&quot;</pre>\r\n<p><span><br>\r\n</span></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20749,
      "author_name": "roulinir",
      "author_url": "",
      "post_date": "02/23/2013 05:59:47",
      "content": "<p><span>@Andrei @hellofys I may shed some light on this - it seems that the Random Forest in the latest relase of scikit-learn doesn't work well with missing values, while previous versions tolerated them. I've updated scikit-learn midway during the challenge,\r\n and suddenly encountered the error @hellofys is describing.&nbsp;</span></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20753,
      "author_name": "joseffeigl",
      "author_url": "",
      "post_date": "02/23/2013 11:19:23",
      "content": "<p>Hi guys,</p>\r\n<p>this competition was basically all about feature creation. So here is a list of my some of my features:</p>\r\n<ul>\r\n<li>There were 3 different dates ( the start time of the event, the jointed_at date, the timestamp). I added all time differences between each dates. They were all important.\r\n</li><li>Additionally I extracted the year, month, day, hour and weekday of each date, but of these features had only a small impact.\r\n</li><li>I clustered all events using only the c_1, c_2, ..., c_n-features with kmeans (about 30 categories).\r\n</li><li>I counted how many events each user had in the train/test file (very important feature).\r\n</li><li>I defined similar users as users, which have about the same age, same timezone and same gender and counted how many of them had a yes/maybe/no/invited for the given event. However, these features had no big impact.\r\n</li><li>Country was important, too. I only used the 10 most common countries and put all others into the category &quot;Other&quot;. I did the same for locale and city.\r\n</li><li>The &quot;usual&quot; stuff: Count of yes/maybe/no/invited of all friends and all other users. Lat and lng were very important as well\r\n</li></ul>\r\n<p>In the end I had about 60-70 features, which were all more or less important.</p>\r\n<p>With all these features I tried to predict the &quot;interested&quot;-column and for this I used the probability-output of a gbm. My aim was to minimize the LogLoss-error between my prediction and the actual solution. I never used the MAP-metric, because the lower\r\n the LogLoss-error the higher the MAP.</p>\r\n<p>The create a submission I ordered all events using my probability-prediction.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20754,
      "author_name": "naokazumizuta",
      "author_url": "",
      "post_date": "02/23/2013 12:51:27",
      "content": "<p>[quote=jsf;20753]</p>\r\n<ul>\r\n<li>There were 3 different dates ( the start time of the event, the jointed_at date, the timestamp). I added all time differences between each dates. They were all important.\r\n</li><li>I clustered all events using only the c_1, c_2, ..., c_n-features with kmeans (about 30 categories).\r\n</li><li>The &quot;usual&quot; stuff: Count of yes/maybe/no/invited of all friends and all other users. Lat and lng were very important as well\r\n</li></ul>\r\n<p>[/quote]</p>\r\n<p>We also used the above features written by jsf as well as the proportion of count to the total response, and also did user community detection. Since the number of users are quite large, we first filtered out users to users whose info is available, that\r\n is, who are in users.csv file. We also tried to take into account that how many events each user had and it was actually top ranked in terms of relative inference by gbm, but we reconsidered and omitted from our final model. I think the reason the number of\r\n events is important when you make score in probability is obvious, probability of interested is 1/4, 1/5, 1/6 depending on the number of events 4, 5, 6 respectively, but we couldn't believe that it is relevant and in our experiments, it didn't give any improvement\r\n in MAP metric. We used about 30 features. Our final model was averaged over gbm w/ bernoulli, gbm w/ adaboost, and randomForest.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20759,
      "author_name": "roulinir",
      "author_url": "",
      "post_date": "02/23/2013 15:22:54",
      "content": "<p>Well my solution wasn't a lot different than the others and I attribute my high ranking mostly to luck. When the public leaderboard was frozen, I was at the 11th position, and since I did not get any significant breakthrough in the remaining week, I was\r\n a bit surprised to find myself in the third place.</p>\r\n<p>&nbsp;</p>\r\n<p>Two features that I think are unique in my solution involved directly comparing the events that were suggested to a given user each against the other. The first feature was the distance of each feature from the median of the locations of all the events shown\r\n to the user. This actually worked better than any other distance metric I've used (I didn't try any third party services, but I did leveraged the locations of the events in events.csv to estimate the coordinates of users). The other feature first found out\r\n which event was happening first from all those suggested and then calculated for each event the ratio between its delta and that minimum delta.</p>\r\n<p>&nbsp;</p>\r\n<p>You can read about the lessons I've learned here -&nbsp;http://www.rouli.net/2013/02/five-lessons-from-kaggles-event.html, which also details a sad twist in my story.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20761,
      "author_name": "tks0123456789",
      "author_url": "",
      "post_date": "02/23/2013 16:06:18",
      "content": "<p>I tried similar features as jsf, but used only &quot;gaussian&quot; gbm.</p>\r\n<p>I built two type of gbm models.The first model roughly estimated the probability of interestedness, then the second model refined the first model.</p>\r\n<p><span>https://github.com/tks0123456789/kaggle-event-recommendation</span></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20947,
      "author_name": "jmeynet",
      "author_url": "",
      "post_date": "02/28/2013 12:34:18",
      "content": "<p>Hi,</p>\r\n<p>congrats to the winners too!!</p>\r\n<p>I spent a lot of time comparing various target modeling strategies: interested vs. not interested classif,&nbsp;&nbsp; interested vs not interested vs unknown,&nbsp;&nbsp; learning to rank (ala SVMRank).</p>\r\n<p>I ended up with the simplest one, interested vs. other classification using GBRTs using prediction score to rank the events. I was quite surprised that pure ranking solution did not work well for this contest. Did anybody also tried ranking strategies, pairwise\r\n or listwise?</p>\r\n<p>Also, I am sure you noticed some events had identical descriptions (only id differs in events.csv) but different attendees. I did not manage to tranform this into a informative feature.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 20972,
      "author_name": "matthewpearce",
      "author_url": "",
      "post_date": "03/01/2013 17:52:10",
      "content": "<p>I'd be really interested to hear what anyone that used clustering successfully did exactly. E.g.</p>\r\n<ul>\r\n<li>Clustered events... just on the keywords or on other features/ derived features?\r\n</li><li>Which set of events: all events; just ones mentioned somewhere in the train / test data; some other subset?\r\n</li><li>What use did you make of it?\r\n<ul>\r\n<li>I tried: rank the clusters by similarity to a user, assign the event the rank of the cluster it was most similar to. And a similar thing with all men/women in a locale.\r\n</li></ul>\r\n</li></ul>\r\n<p>Also, I found charting my performance on the public/private leaderboards interesting. Some morals for me:</p>\r\n<ul>\r\n<li>not to chuck stuff in at the end after having been cautious for most of the comp;\r\n</li><li>not to balk at rolling back features to earlier states from later, fancier ones;\r\n</li><li>if I've been 'good' (not using potentially leaky features) to consider trusting the public leaderboard as an unbiased estimate of success, and thus go with whatever score was highest (in this case .67, roughly 20 places up).\r\n</li></ul>\r\n<p><img title=\"scores\" src=\"https://docs.google.com/a/refute.me.uk/spreadsheet/oimg?key=0AlMeiFaXKYpJdFM1RnRrVVZqTXRUWUh3Yng1Ymt3X3c&amp;oid=1&amp;zx=a2tkvffgdw4a\" alt=\"scores\" width=\"626\" height=\"501\"></p>\r\n<p>Thanks for the joys of hindsight all.</p>\r\n<p>&nbsp;</p>\r\n<p>PS @Andrei, thanks for the insight.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 92227,
      "author_name": "deepakgeorge",
      "author_url": "",
      "post_date": "09/12/2015 03:47:01",
      "content": "<p>I am building a product recommender system, instead of recommending event i have to recommend products. Please advise on the below question.</p>\n\n<p>I am treating this problem as a classification problem and for each user-product combination i am predicting the probability of purchase using (GBM etc). </p>\n\n<p>Given the class imbalance(6% event rate) &amp; that fact that I need to maximize map@k which is the best loss function &amp; evaluation criteria for evaluating result of a binary classifier( random forest/ gbm etc)? </p>\n\n<p>I am asking because I can't specify map@k as evaluation criteria in for a binary classifier right?</p>\n\n<p>Did you use recall or precision or kappa etc as a scoring criteria for tune the hyper parameters of the random forest? Please advise.</p>\n\n<p>Can someone explain how this statement by Josef Feigl. I didnt understand.</p>\n\n<blockquote>\n  <p>&quot;My aim was to minimize the LogLoss-error between my prediction and\n  the actual solution. I never used the MAP-metric, because the lower\n  the LogLoss-error the higher the MAP.&quot;</p>\n</blockquote>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "20690": "",
    "20700": "",
    "20702": "",
    "20706": "",
    "20707": "",
    "20723": "",
    "20725": "",
    "20728": "",
    "20743": "",
    "20749": "",
    "20753": "",
    "20754": "",
    "20759": "",
    "20761": "",
    "20947": "",
    "20972": "",
    "92227": "I am building a product recommender system, instead of recommending event i have to recommend products. Please advise on the below question.\r\n\r\nI am treating this problem as a classification problem and for each user-product combination i am predicting the probability of purchase using (GBM etc). \r\n\r\nGiven the class imbalance(6% event rate) & that fact that I need to maximize map@k which is the best loss function & evaluation criteria for evaluating result of a binary classifier( random forest/ gbm etc)? \r\n\r\nI am asking because I can't specify map@k as evaluation criteria in for a binary classifier right?\r\n\r\nDid you use recall or precision or kappa etc as a scoring criteria for tune the hyper parameters of the random forest? Please advise.\r\n\r\nCan someone explain how this statement by Josef Feigl. I didnt understand.\r\n\r\n> \"My aim was to minimize the LogLoss-error between my prediction and\r\n> the actual solution. I never used the MAP-metric, because the lower\r\n> the LogLoss-error the higher the MAP.\""
  },
  "source": "existing_discussion",
  "complete": true,
  "competition_id": 3288,
  "competition_slug": "event-recommendation-engine-challenge",
  "team_id": 33524,
  "solution_url": "/competitions/event-recommendation-engine-challenge/writeups/andrei-olariu-solutions"
}