{
  "id": 7688,
  "title": "Feature engineering and beat the benchmark (~0.59347)",
  "url": "/competitions/acquire-valued-shoppers-challenge/discussion/7688",
  "author_name": "",
  "post_date": "2014-04-15T05:37:47.573Z",
  "votes": 77,
  "comment_count": 132,
  "views": 59898,
  "content": "<p>Here is some code and ideas to get a score of around 0.59347. It uses Python and Vowpal Wabbit, but the idea should work with other languages and other algorithms.</p>\n<p><strong>Data reduction</strong></p>\n<p>Check out the <a href=\"http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7666/getting-started-data-reduction\">data reduction thread</a>&nbsp;to understand what this is about. For this benchmark we create the category and company union.</p>\n<p><strong>Feature engineering</strong></p>\n<p>Feature engineering will be important in this competition, no matter the language or algorithms used. We can check out the benchmarks on the leaderboard to get a feel for features to use.</p>\n<p>We will generate the following features:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">has_bought_company: the number of times a shopper has bought from the company on offer</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_a: the total amount the shopper has bought from the company on offer</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_q: the quantity of items bought from the company on offer.</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_30: the number of times a shopper has bought from the company on offer in the 30 days before the date the coupon was offered.</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_60: the number of times a shopper has bought from the company on offer in the 60 days before the date the coupon was offered.</span></li>\n<li><span style=\"line-height: 1.4\">...</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_180: 180 days before</span></li>\n<li><span style=\"line-height: 1.4\">has_never_bought_company: a negative feature for when the shopper has never bought from the company on offer before.</span></li>\n</ul>\n<p>These same features for:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">has_bought_category: the number of times a shopper has bought from the category on offer</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_brand: the number of times a shopper has bought from the brand on offer</span></li>\n</ul>\n<p>Combinations of these:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">has_bought_company_brand_category: if this feature is present the shopper has bought from the company, brand, and category on offer.</span></li>\n<li><span style=\"line-height: 1.4\">has_never_bought_company_brand: negative feature for the combination of brand and company purchase history.</span></li>\n</ul>\n<p>Offer-related:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">offer_value: The value of the coupon offer</span></li>\n<li><span style=\"line-height: 1.4\">offer_quantity: The number of products to redeem with the coupon</span></li>\n</ul>\n<p>Total shopper spend:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">total_shopper_spend: We take the total amount spend by the shopper in the reduced dataset.</span></li>\n</ul>\n<p>Can you name some other possibly interesting features to generate?</p>\n<p><strong>Vowpal Wabbit</strong></p>\n<p>We train Vowpal Wabbit using quantile regression, 40 passes and a learning rate of 0.85. We turn the predictions into Kaggle's submission format.</p>\n<p><strong>Feature visualisation</strong></p>\n<p>Using the output from Vowpal Wabbit's wrapper vw-varinfo we generate the feature relevance plot below (code to generate this included):</p>\n<p><img src=\"http://i.imgur.com/zajHeiz.png\" alt=\"feature plot\" width=\"597\" height=\"433\"></p>\n<p><strong>Improvements</strong></p>\n<p>If you use this code or feature ideas to improve the score of 0.59347 I'd really appreciate it if you let me know these improvements. It's very possible that another algorithm may do better with these exact features.</p>\n<p>If you do improve the score I'd love to team up. I am still working on a few new features and we could combine our approaches for an ever better score.</p>\n<p><strong>Code &amp; Tutorial</strong></p>\n<p>For latest code see the Github repo: https://github.com/MLWave/kaggle_acquire-valued-shoppers-challenge, for the tutorial/description read: http://mlwave.com/predicting-repeat-buyers-vowpal-wabbit/</p>\n<p>All of this runs in about 15 minutes for me, from raw data to submission. Takes less than 1GB of memory.</p>\n<p><strong>Todo</strong></p>\n<p>Generate more features. Set up local validation. Tweak algorithms. Try other algorithms than quantile regression (sklearn has plenty).</p>",
  "messages": [
    {
      "id": "41913",
      "postDate": "04/15/2014 05:37:47",
      "content": "<p>Here is some code and ideas to get a score of around 0.59347. It uses Python and Vowpal Wabbit, but the idea should work with other languages and other algorithms.</p>\n<p><strong>Data reduction</strong></p>\n<p>Check out the <a href=\"http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7666/getting-started-data-reduction\">data reduction thread</a>&nbsp;to understand what this is about. For this benchmark we create the category and company union.</p>\n<p><strong>Feature engineering</strong></p>\n<p>Feature engineering will be important in this competition, no matter the language or algorithms used. We can check out the benchmarks on the leaderboard to get a feel for features to use.</p>\n<p>We will generate the following features:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">has_bought_company: the number of times a shopper has bought from the company on offer</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_a: the total amount the shopper has bought from the company on offer</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_q: the quantity of items bought from the company on offer.</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_30: the number of times a shopper has bought from the company on offer in the 30 days before the date the coupon was offered.</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_60: the number of times a shopper has bought from the company on offer in the 60 days before the date the coupon was offered.</span></li>\n<li><span style=\"line-height: 1.4\">...</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_company_180: 180 days before</span></li>\n<li><span style=\"line-height: 1.4\">has_never_bought_company: a negative feature for when the shopper has never bought from the company on offer before.</span></li>\n</ul>\n<p>These same features for:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">has_bought_category: the number of times a shopper has bought from the category on offer</span></li>\n<li><span style=\"line-height: 1.4\">has_bought_brand: the number of times a shopper has bought from the brand on offer</span></li>\n</ul>\n<p>Combinations of these:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">has_bought_company_brand_category: if this feature is present the shopper has bought from the company, brand, and category on offer.</span></li>\n<li><span style=\"line-height: 1.4\">has_never_bought_company_brand: negative feature for the combination of brand and company purchase history.</span></li>\n</ul>\n<p>Offer-related:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">offer_value: The value of the coupon offer</span></li>\n<li><span style=\"line-height: 1.4\">offer_quantity: The number of products to redeem with the coupon</span></li>\n</ul>\n<p>Total shopper spend:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">total_shopper_spend: We take the total amount spend by the shopper in the reduced dataset.</span></li>\n</ul>\n<p>Can you name some other possibly interesting features to generate?</p>\n<p><strong>Vowpal Wabbit</strong></p>\n<p>We train Vowpal Wabbit using quantile regression, 40 passes and a learning rate of 0.85. We turn the predictions into Kaggle's submission format.</p>\n<p><strong>Feature visualisation</strong></p>\n<p>Using the output from Vowpal Wabbit's wrapper vw-varinfo we generate the feature relevance plot below (code to generate this included):</p>\n<p><img src=\"http://i.imgur.com/zajHeiz.png\" alt=\"feature plot\" width=\"597\" height=\"433\"></p>\n<p><strong>Improvements</strong></p>\n<p>If you use this code or feature ideas to improve the score of 0.59347 I'd really appreciate it if you let me know these improvements. It's very possible that another algorithm may do better with these exact features.</p>\n<p>If you do improve the score I'd love to team up. I am still working on a few new features and we could combine our approaches for an ever better score.</p>\n<p><strong>Code &amp; Tutorial</strong></p>\n<p>For latest code see the Github repo: https://github.com/MLWave/kaggle_acquire-valued-shoppers-challenge, for the tutorial/description read: http://mlwave.com/predicting-repeat-buyers-vowpal-wabbit/</p>\n<p>All of this runs in about 15 minutes for me, from raw data to submission. Takes less than 1GB of memory.</p>\n<p><strong>Todo</strong></p>\n<p>Generate more features. Set up local validation. Tweak algorithms. Try other algorithms than quantile regression (sklearn has plenty).</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "41962",
      "postDate": "04/15/2014 19:54:40",
      "content": "<p>So I noticed that the offer_quantity is equal to 1 for all offers of trainHistory, while it is sometimes equal to 2 for some of the offers in testHistory. &nbsp;This explain why it is not a good feature as it is. &nbsp;</p>\n<p>However, I can imagine someone getting a &quot;good&quot; feature out of this by probing the test data a few times with the kaggle score, though I doubt this is a good use of one's time. &nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "41978",
      "postDate": "04/15/2014 22:58:15",
      "content": "<p>[quote=Mathieu Cliche;41962]</p>\n<p>So I noticed that the offer_quantity is equal to 1 for all offers of trainHistory, while it is sometimes equal to 2 for some of the offers in testHistory.</p>\n<p>[/quote]</p>\n<p>Astute observation! I probably should have checked that myself. Seemed such a nice feature. I think it is useless now.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42021",
      "postDate": "04/16/2014 10:41:50",
      "content": "<p>Great job!</p>\n<p>good start!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42047",
      "postDate": "04/16/2014 14:49:38",
      "content": "<p>Triskelion</p>\n<p>Your thoughts of creating new features from the transaction data are absolutely right. One note though. Brand is associated with category and company, So, if a shopper buys a brand, he/she buys the category, and the company as well. So, you can combine these three into one feature. To be more accurate, I think category and company could be left out, because the offers are made on brands, not categories or companies. I think a new binary feature, that indicates if a shopper has purchased the brand prior to the offer, would be sufficient. In other words, a shopper who has prior exposure to the brand, is more likely to respond to the offer, than the shopper who has not had the exposure.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42056",
      "postDate": "04/16/2014 15:47:52",
      "content": "<p>[quote=Art_Ghazaryan;42047]</p>\n<p>Triskelion</p>\n<p>Your thoughts of creating new features from the transaction data are absolutely right. One note though. Brand is associated with category and company, So, if a shopper buys a brand, he/she buys the category, and the company as well. So, you can combine these three into one feature. To be more accurate, I think category and company could be left out, because the offers are made on brands, not categories or companies. I think a new binary feature, that indicates if a shopper has purchased the brand prior to the offer, would be sufficient. In other words, a shopper who has prior exposure to the brand, is more likely to respond to the offer, than the shopper who has not had the exposure.&nbsp;</p>\n<p>[/quote]</p>\n<p>No.</p>\n<p>Brand is not associated with category (with company?). A sparkling water bottle is a category. A company can make many brands but all brands do not belong to one company. Brand is a trademark of a given company. If you buy kinley still mineral water, you are buying from department = water, category = still water, brand = kinley, company = coca cola</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42058",
      "postDate": "04/16/2014 15:54:47",
      "content": "<p>[quote=Triskelion;41913]</p>\n<p>Here is some code and ideas to get a score of around 0.59347. It uses Python and Vowpal Wabbit, but the idea should work with other languages and other algorithms.</p>\n<p>[/quote]</p>\n\n<p>Do you get this same (or similar) score when doing crossvalidation on your end, or do you get a&nbsp;much higher one?</p>\n<p>It seems to me that an important factor in this competition is generating a validation set that actually works. I had tried using similar features to the ones you described and got a score of ~0.67&nbsp;in CV, but only 0.55 in the public leaderboard. For my best submission (currently 0.588), I get ~0.60 in CV, which makes this really confusing.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42059",
      "postDate": "04/16/2014 16:12:32",
      "content": "<p>Abhishek,</p>\n\n<p>When you get a coupon, it is for a specific brand. You cannot redeem that coupon to get another brand of the same company, or category, or department.</p>\n<p>There is also another issue here. What type of association we have between each shopper and coupons? Is it one to one? Were the coupons provided as a collection(coupon book, newspaper insert, etc), or they were provided in some other way?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42069",
      "postDate": "04/16/2014 17:20:10",
      "content": "<p>[quote=Martin Martin;42058]</p>\n<p>[quote=Triskelion;41913]</p>\n<p>Here is some code and ideas to get a score of around 0.59347. It uses Python and Vowpal Wabbit, but the idea should work with other languages and other algorithms.</p>\n<p>[/quote]</p>\n<p>Do you get this same (or similar) score when doing crossvalidation on your end, or do you get a&nbsp;much higher one?</p>\n<p>[/quote]</p>\n<p>I get a higher one. (~3-5 AUC higher) I think this may be due to outliers in the train set (and test set). I suspect that if you denoise the train and test set, your model will be more robust, and your validation scores are then closer to the leaderboard.</p>\n<p>I am familiar with removing noisy features (PCA, topkfeatures etc.), not too familiar with removing noisy feature values (more like fraud detection). EDIT:&nbsp;<a href=\"http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7671/evaluation/\">This thread</a>&nbsp;seems to suggest it is not due to noise/outliers, but due to temporal issues. I think that means in 5-year-old speak that the train set and test set are fairly different from each other. CV on only the train set will be higher than public leader board score, as the train set itself is more internally consistent. This may be a hard problem to solve, though an increase in local CV may very well mean an increase in public leaderboard score.</p>\n<p>I'll take a better look soon, for now I have a few other competitions that demand my attention.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42072",
      "postDate": "04/16/2014 17:25:33",
      "content": "<p>[quote=Art_Ghazaryan;42059]</p>\n<p>Abhishek,</p>\n<p>When you get a coupon, it is for a specific brand. You cannot redeem that coupon to get another brand of the same company, or category, or department.</p>\n<p>There is also another issue here. What type of association we have between each shopper and coupons? Is it one to one? Were the coupons provided as a collection(coupon book, newspaper insert, etc), or they were provided in some other way?</p>\n<p>[/quote]</p>\n<p>Hey Art Ghazaryan. I think you may be right. Some features are superfluous. Has_never_bought_brand_company would probably be the same as has_never_bought_brand. As it is unlikely that another company creates the same brand.</p>\n<p>I was not too sure of this beforehand. I just extracted some features and ran it through Vowpal Wabbit. I don't like relying on domain expertise too much (as I have very little in all domains). Basically I hope I use tools that are good enough to discard useless features and focus only on the indicative features. Vowpal Wabbit is pretty good at that, sklearn has some algorithms that are better. Most of them need feature values to be scaled between 0-1 and demand all data to be loaded into memory. While a bit more work, this may reduce the hard-to-normalize noise in the data sets.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42125",
      "postDate": "04/17/2014 02:09:35",
      "content": "<p>6,089 out of 35689&nbsp;brands belong to more than one company ... I am very confused ...</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42142",
      "postDate": "04/17/2014 05:51:48",
      "content": "<p>[quote=Y Zhao;42125]</p>\n<p>6,089 out of 35689 brands belong to more than one company ... I am very confused ...</p>\n<p>[/quote]</p>\n<p>My guessing is because in the data description they say:</p>\n<p>'The transactions file can be joined to the offers file by (category, brand, company).'</p>\n<p>We should consider&nbsp;category, brand, company as a key, so different brands for different companies can have the same code but they are actually different brands.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42326",
      "postDate": "04/18/2014 15:46:32",
      "content": "<p>[quote=Mike Demurtas;42142]</p>\n<p>My guessing is because in the data description they say:</p>\n<p>'The transactions file can be joined to the offers file by (category, brand, company).'</p>\n<p>We should consider&nbsp;category, brand, company as a key, so different brands for different companies can have the same code but they are actually different brands.</p>\n<p>[/quote]</p>\n<p>I'd really love to get an answer from the competition admin on this-- do we need to combine company and category to get a unique brand id?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42328",
      "postDate": "04/18/2014 16:38:07",
      "content": "<p>My guess is this is due to corporate actions. I know there are quite a few food companies got acquired and spin-off-ed during the past two years, (Kraft, white plain??, etc). I probably will take a look at the time series of brand/company instances to verify my guess.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42346",
      "postDate": "04/18/2014 19:46:58",
      "content": "<p>This is the&nbsp;answer I received from the sponsor admin (who is not at their computer today):</p>\n\n<p style=\"padding-left: 30px\"><em>The combination of &#8220;category, brand, company&#8221; could be consider a unique key.</em></p>\n<p style=\"padding-left: 30px\"><em>Brands are unique to companies, but brands-company combinations can cross categories.</em></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42356",
      "postDate": "04/18/2014 21:43:30",
      "content": "<p>[quote=Ramzi R;42346]</p>\n<p style=\"padding-left: 30px\"><em>Brands are unique to companies,&nbsp;...</em></p>\n<p>[/quote]</p>\n<p>I think we know this statement is&nbsp;false, right? Is there a problem with the data?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42557",
      "postDate": "04/21/2014 00:07:06",
      "content": "<p>The sponsor admin's remark is in line with what Mike wrote before:</p>\n<p>[quote=Mike Demurtas;42142]</p>\n<p>We should consider category, brand, company as a key, so different brands for different companies can have the same code but they are actually different brands.</p>\n<p>[/quote]</p>\n\n<p>This is also supported by the observation that the brand occuring for the largest number of companies is brand '0', which occurs for 9150 companies (making other explanations like corporate actions very unlikely).</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42563",
      "postDate": "04/21/2014 01:48:15",
      "content": "<p>Are there similar duplicates of companies between categories? &nbsp;Or since companies can have brands in different categories, are all company IDs unique?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42622",
      "postDate": "04/21/2014 17:32:45",
      "content": "<p>Point of clarification:&nbsp; it is possible for brands to have more than 1 (one) company.&nbsp;</p>\n<p>The combination of &quot;category, brand, company&quot; can be considered a unique key.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "42626",
      "postDate": "04/21/2014 18:18:27",
      "content": "<p>First of all, thank you for submitting your code. &nbsp;This submissions is better than anything I've been able to put together on my own, after many hours of work.</p>\n\n<p>Some questions:</p>\n<p>1. Why did you choose to use quantile regression? &nbsp;Isn't this problem a perfect fit for the logistic regression function in vowpal wabbit?</p>\n<p>2. Why 0.6 for the quantile tau? &nbsp;Did you try any other values, and if so, how did you decide if they were good or bad?</p>\n<p>3. Why 40 passes? &nbsp;Did you try any other values, and if so, how did you decide 40 was optimal?</p>\n<p>4. Why 0.85 for the learning rate?</p>\n<p>5. Are you worried at all about over-fitting? &nbsp;I noticed that the self-reported loss for VW was 0 for a very long time before the model stopped. &nbsp;Should you have stopped the model after some number of passes where the self-reported loss was still about zero?</p>\n<p>Questions 2-4 are basically the same question: how did you tune the model prior to submission, and how confident are you in your tuning?</p>\n\n<p>Thanks again for the code, you've helped me out immensely.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "43523",
      "postDate": "05/02/2014 18:32:43",
      "content": "<p>[quote=Zach;42626]</p>\n<p>Some questions:</p>\n<p>1. Why did you choose to use quantile regression? &nbsp;Isn't this problem a perfect fit for the logistic regression function in vowpal wabbit?</p>\n<p>[/quote]</p>\n<p>It probably is a good fit (if it is better, it very well could be: try it!). Langford says that for binary classification problems Vowpal Wabbit usually performs well using the --binary --loss_function logistic operator. This demands labels to be [-1,1] instead of [0,1]</p>\n<ul>\n<li><span style=\"line-height: 1.4\">If the problem is a binary classification problem your choices should be Logistic or hinge loss. Example: spam vs non-spam, odds of click vs no-click. (Q: when should hinge-loss be used vs logistic?)</span></li>\n</ul>\n<p><span style=\"line-height: 1.4\">But I am not actually doing classification. I am doing a regression between 0 and 1. This will skip the need to post-process the predictions (running through a sigmoid etc.). They already score good for AUC/ROC.</span></p>\n<ul>\n<li><span style=\"line-height: 1.4\">If the problem is a regression problem, meaning the target label you're trying to predict is a real value -- you should be using Squared or Quantile loss. I</span><span style=\"line-height: 1.4\">f OTOH you're trying to predict rank/order and you don't mind the mean error to increase as long as you get the relative order correct, you need to minimize the error vs the median (or any other quantile), in this case, you should use quantile-loss. See: http://en.wikipedia.org/wiki/Quantile_regression</span></li>\n</ul>\n<p><span style=\"line-height: 1.4\">[quote=Zach;42626]</span></p>\n<p>2. Why 0.6 for the quantile tau? &nbsp;Did you try any other values, and if so, how did you decide if they were good or bad?</p>\n<p>[/quote]</p>\n<p>I always try the standard 0.5 first. There are ways to find out which parameter is the best (its an obvious tweak when using quantile regression), but the easiest for me was just generating a submission with quantile tau 0.4 and 0.6 and see if it improves or decreases the score. You obviously would use local validation and performance evaluation for this if you were to do this properly.</p>\n<p>[quote=Zach;42626]</p>\n<p>3. Why 40 passes? &nbsp;Did you try any other values, and if so, how did you decide 40 was optimal?</p>\n<p>[/quote]</p>\n<p>This used to be based on a hunch more than anything (or I just did not know how to find out, I just tried 20 passes as the standard that just seems to work alright, <a href=\"http://fastml.com/go-non-linear-with-vowpal-wabbit/\">fastml confirms</a>). The newer version of Vowpal Wabbit has holdout features build-in. This means one in n samples is used to calculate the loss now (standard 1 in 10). Quantile regression seems to need fewer passes to converge to a good solution in general. With new holdout functionality Vowpal Wabbit will stop doing passes if it does not increase performance over the last n passes. So that is why Vowpal Wabbit 7.6 will increase the score on leaderboard. Maybe it only does 9 passes and finds that is optimal over 40 passes. This, you could say, is Vowpal Wabbit's build-in overfitting mechanism.</p>\n<p>[quote]</p>\n<p>4. Why 0.85 for the learning rate?</p>\n<p>[/quote]</p>\n<p>This caused a lower average loss. You can manually check parameters like these (--decay_learning_rate, --power_t, l). Usually you don't even need to fiddle with it (it can also mess up your results), but it can improve the score a bit. BTW: From&nbsp;https://raw.githubusercontent.com/wiki/gdfm/vowpal_wabbit/v5.1_tutorial.pdf &quot;for multiple passes --decay_learning_rate between [0.5-1] is sensible. Values&nbsp;smaller than&nbsp;1 protect against overfitting.&quot;</p>\n<p>[quote]</p>\n<p>5. Are you worried at all about over-fitting? &nbsp;I noticed that the self-reported loss for VW was 0 for a very long time before the model stopped. &nbsp;Should you have stopped the model after some number of passes where the self-reported loss was still about zero?</p>\n<p>[/quote]</p>\n<p>Not with Vowpal Wabbit and with this dataset. Especially not with the <a href=\"https://github.com/JohnLangford/vowpal_wabbit/wiki/Zhen.pdf\">new holdout functionality</a>. If you are really worried about over-fitting you could add l1 and l2 regularization with --l1 and --l2. And try&nbsp;ensemble learning to reduce fitting.</p>\n<p>[quote]</p>\n<p>Questions 2-4 are basically the same question: how did you tune the model prior to submission, and how confident are you in your tuning?</p>\n<p>[/quote]</p>\n<p>I check average loss and if the learning process looks ok: (average loss and since last decreasing). This is the quick way, because you don't need to set up a holdout set or do k-fold validation, average loss is a pretty decent indicator of leaderboard performance.&nbsp;</p>\n<p>Debug process from the 5.1 tutorial:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">Is your progressive validation loss going down as you train? No =&gt; malordered examples or bad choice of parameter.</span></li>\n<li><span style=\"line-height: 1.4\">If you test on the train set, does it work? No =&gt; something crazy</span></li>\n<li><span style=\"line-height: 1.4\">Are the predictions sensible?&nbsp;</span></li>\n<li><span style=\"line-height: 1.4\">Do you see the right number of features coming up?</span></li>\n</ul>\n<p><span style=\"line-height: 1.4\">If you want more precise way: Create a holdout set or two from your train set. Evaluate AUC on the holdout set(s). Parameter tweak (i try bruteforce gridsearch or random search) according to this fitness factor.</span></p>\n<p>You can also employ PERF software to find good cutt-off and min_prediction and max_prediction I think, but I have not figured that out yet.&nbsp;</p>\n<p>I may even output in libsvm format so you can do most of this with sklearn or try other solvers like Sofia-ML.&nbsp;</p>\n<p>[quote]</p>\n<p>Thanks again for the code, you've helped me out immensely.</p>\n<p>[/quote]</p>\n<p>No problem! Happy competition!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "43657",
      "postDate": "05/04/2014 09:03:23",
      "content": "<p>As for the choice of the loss function, I tried Triskelions features with all 4 loss functions implemented in Vowpal Wabbit. At first, I also thought logistic regression might be a better fit. Quantile regression scored highest on&nbsp;the leaderboard though.<br>What kind of problem we are solving is actually not that important afaik, at least in terms of the numbers you want to submit. You can create&nbsp;scores in any range, not just [0,1]. AUC can handle that.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44253",
      "postDate": "05/08/2014 10:59:41",
      "content": "<p>Hi&nbsp;Triskelion,</p>\n<p>Many thanks for the detailed explanation. Really impressed with your knowledge.</p>\n<p>Being novice, i am participating in this contest and I am trying to create new features in SAS/R so just wanted to check if what I understood from these posts is correct or not. I think one should try to create new features like How many times person bought from a company/category on offer, what is the total amount amount transacted on company/category etc. Now my question is, are you guys suggesting that we should have this count of transactions/amount of transaction variables for each company present in the offers.csv i.e we should have <strong>no_of_trxn_comp1</strong>,&nbsp;<strong>no_of_trxn_comp2,&nbsp;no_of_trxn_comp3,&nbsp;no_of_trxn_comp4,&nbsp;no_of_trxn_comp5&nbsp;</strong>and so on for each company until <strong>comp18&nbsp;</strong>that we have in offers.csv (18 companies) and similarly for <strong>20 categories&nbsp;</strong> in offers.csv file. This way we will so many variables for company and categories. In total my question is that we need to create the variables for <strong>each company</strong>&nbsp;for whatever parameter (i.e amount, count etc.) we are creating.&nbsp;</p>\n<p>Anyone's help on this would be really appreciated. &nbsp;Thanks in advance.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44259",
      "postDate": "05/08/2014 14:24:32",
      "content": "<p>Hi Decipher</p>\n\n<p>Your thinking process is absolutely correct. That is a correct approach to extract intelligence and create variables. I have created 114 variables so far.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44273",
      "postDate": "05/08/2014 18:22:38",
      "content": "<p>@Decipher</p>\n<p>Well you do need to calculate all those, but in terms of features to train on you only use the variables for the specific offer.</p>\n<p>So if an offer is on company XX you would use the no_of_trxn_compXX variable as a feature. Hope this helps.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44396",
      "postDate": "05/12/2014 04:24:38",
      "content": "<p>Thanks for your sharing, it's a good start</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44410",
      "postDate": "05/12/2014 16:07:34",
      "content": "<p>Did anyone use exactly the same features with logistic regression?</p>\n<p>My auc using logistic regression is only 0.53, I'm checking whether there is something wrong with my feature extraction process, or it's due to logistic regression.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44411",
      "postDate": "05/12/2014 16:10:52",
      "content": "<p>[quote=&#36523;&#32463;&#30334;&#25112;&#38271;&#32773;;44410]</p>\n<p>Did anyone use exact the same features with logistic regression?</p>\n<p>My auc using logistic regression is only 0.53, I'm checking whether there is something wrong with my feature extraction process, or is due to logistic regression.</p>\n<p>[/quote]</p>\n\n<p>Yes. &nbsp;Logistic regression using vowpal wabbit is a fair bit worse than quantile regression using vowpal wabbit, and logistic regression using another tool seems to be even worse.</p>\n<p>Try quantile regression with your features and see what happens.</p>\n<p>There's already <a href=\"https://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7917/performance-of-logistic-regression-on-features-described-by-triskelion\">a discussion on this topic here</a>.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44412",
      "postDate": "05/12/2014 16:16:20",
      "content": "<p>Thanks for reply</p>\n<p>Are there any tools in python or R for quantile regression? It seems that sklearn does not implement quantile regression</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44413",
      "postDate": "05/12/2014 16:17:21",
      "content": "<p>statsmodels</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44414",
      "postDate": "05/12/2014 16:18:47",
      "content": "<p>I'm actually using logistic regression with scikit-learn and roughly the same features, and for me it's working well, but you need to use some sort of regularization to avoid over-fitting.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44429",
      "postDate": "05/13/2014 03:23:56",
      "content": "<p>But I'm still a little confused about applying a regression algorithm(like quantile regression) to a classification problem...</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44441",
      "postDate": "05/13/2014 08:22:00",
      "content": "<p>Can you please explain your feature extraction process?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44451",
      "postDate": "05/13/2014 12:55:08",
      "content": "<p>It generate the features provided by&nbsp;Triskelion</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44479",
      "postDate": "05/13/2014 18:50:06",
      "content": "<p>@&#36523;&#32463;&#30334;&#25112;&#38271;&#32773;</p>\n<p>&gt; It seems that sklearn does not implement quantile regression.</p>\n<p>&gt; ... Confused about using regression for a classification problem.</p>\n<p>See:&nbsp;<a href=\"http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingRegressor.html\">sklearn.ensemble.GradientBoostingRegressor</a>&nbsp;which has quantile loss.</p>\n<p>You can treat a classification problem as a regression problem, if you regress between 0 (the negative class) and 1 (the positive class). I don't know if this is unorthodox, probably it is&nbsp;--&nbsp;It looks like standard sklearn in-memory logistic regression with these features (and some regularization) already&nbsp;outperforms this benchmark.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44513",
      "postDate": "05/14/2014 10:14:32",
      "content": "<p>Hmm, but in a machine learning&nbsp;<a href=\"https://class.coursera.org/ml-005/lecture\">MOOC course</a>&nbsp; &nbsp;. When introducing logistic regression (the first video lecture of logistic regression), the professor showed how bad it is to apply OLS linear regression to a classification problem.</p>\n<p>So, I'm amazed that quantile regression can produce good result.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44562",
      "postDate": "05/14/2014 22:58:37",
      "content": "<p>@&#36523;&#32463;&#30334;&#25112;&#38271;&#32773;</p>\n<p><em>&gt;So, I'm amazed that quantile regression can produce good result.</em></p>\n<p>Try all, keep the best. Sometimes theoretical knowledge on what is possible or accepted practice can be a burden. Most of the time it is beneficial though. Don't be afraid to experiment or break some rules and you got the best of both worlds!</p>\n<p>See: <a href=\"http://www.kaggle.com/c/job-salary-prediction/forums/t/4208/congratulations-to-the-preliminary-winners?page=2#post22305\">Forum thread</a>&nbsp;and <a href=\"http://fastml.com/regression-as-classification/ \">FastML experiment</a>&nbsp;for an&nbsp;opposite example: someone using classification for a regression problem, and ending up in 3rd position.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44796",
      "postDate": "05/18/2014 23:30:35",
      "content": "<p>@&#36523;&#32463;&#30334;&#25112;&#38271;&#32773;</p>\n<p>I am following the MOOC you are referring to. Here is how I see the problem.</p>\n<p>If I remember correctly the professor explained that linear regression is not good for classification because it is very sensitive to outliers. What linear regression is doing is to estimate the conditional mean so if you add a data point far away from the others this will greatly affect the value of the mean.</p>\n<p>According to <a href=\"http://en.wikipedia.org/wiki/Quantile_regression\">Wikipedia</a> quantile regression aims at estimating either the conditional median or other quantiles of the response variable. </p>\n<p>Now if your features are quite dense around e.g. the median then adding features far away will not affect a lot the value of the median.</p>\n<p>If anyone has a better understanding of this please share!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "47421",
      "postDate": "06/01/2014 01:05:24",
      "content": "<p>Dear Triskelion and all friends,</p>\n<p>First, thanks for the provided code. Great job!</p>\n<p>I am new to Python and I just start this competition. &nbsp;Previously, I mostly work with R, Matlab and C. Today, I run&nbsp;your posted python code on&nbsp;https://github.com/MLWave/kaggle_acquire-valued-shoppers-challenge, but run into some errors.</p>\n<p>My environment is Python 3.4.1 IDLE ( p.s., what's your python programming environment for this posted Python code?). When I run your posted code, I run into two following errors:</p>\n<p>1) invalid syntax at line &quot;print e, reduced, datetime.now() - start&quot;. I then changed this line to &quot;print (e, reduced, datetime.now() - star)&quot;, and then it doesn't report error, but I am not quite sure whether this indeed solve the problem.</p>\n<p>2) &nbsp;after fixing the invalid syntax error, I run the code again, and it showed following error:</p>\n<p>Traceback (most recent call last):<br> File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_vw_features.py&quot;, line 231, in</p>\n<p>&lt;module&gt;&nbsp;reduce_data(loc_offers, loc_transactions, loc_reduced)</p>\n<p>File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_vw_features.py&quot;, line 41, in</p>\n<p>reduce_data &nbsp;outfile.write( line ) #print header</p>\n<p><strong>TypeError: 'str' does not support the buffer interface</strong></p>\n<p>I have no idea about how to fix this problem. Would you be so kind to give me some hint to solve this problem? Thanks so much!</p>\n<p>Besides, I did following things to run the python code. Correct me if I make some stupid mistakes.</p>\n<p>1) I install Python 3.4.1 IDLE in C disk.</p>\n<p>2) the python code and data files are located in D disk.</p>\n<p>3) I start the Python 3.4.1 IDLE, and use open option to open your python code, and use Run Modules option in the IDLE to run the python code, and I run into these two errors.</p>\n<p>Any help are pretty appreciated. Thanks!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "47422",
      "postDate": "06/01/2014 01:21:38",
      "content": "<p>Shize, there are two major versions of python, 3.x and 2.x. Try python 2.7. The different versions have quite different syntax.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "47423",
      "postDate": "06/01/2014 01:29:08",
      "content": "<p>Hi Scott,</p>\n<p>Thanks for your reply. Besides, does Python 2.7 also have GUI IDLE programming environment? You see, I prefer the user-friendly GUI IDLE environment rather than a DOS-like terminal environment. Thanks, and have a great night!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "47424",
      "postDate": "06/01/2014 02:08:22",
      "content": "<p>Dear Scott,</p>\n<p>I download Python 2.7.6 and install it on my laptop. Now the Python code works. Thanks so much, and have &nbsp;a great night!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48413",
      "postDate": "06/01/2014 03:19:55",
      "content": "<p>Dear friends,</p>\n<p>I run into another problem when run the posted Python code of&nbsp;Triskelion in Python 2.7.</p>\n<p>Actually, when I run the code, it generate the reduce.csv correctly, but when it run the generat_features function, it throw out an error about date format. The error is as follows:</p>\n<p>Traceback (most recent call last):<br> File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_features_updated.py&quot;, line 232, in &lt;module&gt;</p>\n<p><br> generate_features(loc_train, loc_test, loc_reduced, loc_out_train, loc_out_test)<br> File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_features_updated.py&quot;, line 162, in generate_features</p>\n<p><br> date_diff_days = diff_days(row[6],history[-1])<br> File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_features_updated.py&quot;, line 57, in diff_days</p>\n<p><br> a = datetime.strptime(s1, date_format)<br> File &quot;C:\\Python27\\lib\\_strptime.py&quot;, line 325, in _strptime<br> (data_string, format))</p>\n<p><br><strong>ValueError: time data ''6/27/2013'' does not match format '%Y-%m-%d'</strong></p>\n<p>Trying to fix this error, I changed the line of Python code &quot;date_format = &quot;%Y-%m-%d&quot; &nbsp;to &quot;date_format = &quot;%m/%d/%Y&quot;, and run the Python code again.</p>\n<p>But this time I run into another date format error as follows:</p>\n<p><strong>ValueError: time data '2012-03-17' does not match format '%m/%d/%Y'</strong></p>\n<p>So it seems that there are more than one kind of date format in the data. I don't have any ideas to solve this problem. Would anyone be so kind to provide some hints? Thanks so much!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48416",
      "postDate": "06/01/2014 04:03:04",
      "content": "<p>try:</p>\n<p>&nbsp; &nbsp; first date format</p>\n<p>except ValueError:</p>\n<p>&nbsp; &nbsp; second date format</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48417",
      "postDate": "06/01/2014 04:07:48",
      "content": "<p>Dear Neil,</p>\n<p>Thanks!</p>\n\n<p>I am new to Python, and I am not quite sure how to code in Python about your suggestion of&nbsp;</p>\n<p>try:</p>\n<p>first date format</p>\n<p>except ValueError:</p>\n<p>second date format</p>\n\n<p>To be specific,&nbsp;how should I change the Python code? Thanks so much, and good night!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48418",
      "postDate": "06/01/2014 04:23:47",
      "content": "<p>I suggest you read the python documentation on python handling of errors.</p>\n<p>https://docs.python.org/2/tutorial/errors.html</p>\n<p>What you can do is catch the exception and execute a different piece of code instead of throwing the exception.</p>\n<p>I have not looked at the code you are having trouble with but it appears you are getting the exception at the line</p>\n<p>a = datetime.strptime(s1, date_format)</p>\n<p>so you want to put the try/except clause around this, but you want to change the date_format when you catch the exception. date_format appears to be set in another part of the script, so you need to reset this after you catch the exception. I would set date_format within the try/except clause for clarity, so the code would look something like this (put the most common date format first).</p>\n<p>try:</p>\n<p>&nbsp;&nbsp;&nbsp; date_format = &quot;%Y-%m-%d</p>\n<p>&nbsp;&nbsp;&nbsp; a = datetime.strptime(s1, date_format)</p>\n<p>except ValueError:</p>\n<p>&nbsp;&nbsp;&nbsp; date_format = &quot;%m/%d/%Y&quot;</p>\n<p>&nbsp;&nbsp;&nbsp; a = datetime.strptime(s1, date_format)</p>\n\n<p>Edit: I now see that &quot;a&quot; is set within the one of the python modules. I cannot see all of your code, but you need to traceback to where in your code the exception is thrown and the date_format is set, and wrap the try/except clause around it there.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48419",
      "postDate": "06/01/2014 04:33:18",
      "content": "<p>Dear Neil,</p>\n\n<p>Thanks for your suggestion. It works now. Good night!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48420",
      "postDate": "06/01/2014 04:55:11",
      "content": "<p>Dear Friends,</p>\n<p>I use Python 2.7.6 and VM 7.6 (Latest version) to run&nbsp;Triskelion's Python code, but I got a leader board score of 0.59104 rather than 0.59410. And I found that there are a couple of other competitors also have &nbsp;such same score 0.59104.&nbsp;</p>\n\n<p>Does anyone has ideas about what might cause such difference? Thanks in advance.</p>\n\n<p>Good night!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48437",
      "postDate": "06/01/2014 16:36:16",
      "content": "<p>[quote=Shize Su;48420]</p>\n<p>VM 7.6 (Latest version)&nbsp;</p>\n<p>[/quote]</p>\n<p>Use VW version 7.1</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48439",
      "postDate": "06/01/2014 16:56:22",
      "content": "<p>Really?</p>\n<p>But Zach said that he used VW version 7.6 and got score of 0.59410. See the post at&nbsp;</p>\n<p>http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7908/0-59410</p>\n<p>Thanks!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48448",
      "postDate": "06/01/2014 21:17:08",
      "content": "<p>Valid point! &nbsp;I tested my code on version 7.6 and only got 0.59104.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48450",
      "postDate": "06/01/2014 21:43:29",
      "content": "<p>Hi friends,</p>\n<p>I download VW 7.1 and test the code again, but still got the same score 0.59104.&nbsp;</p>\n<p>Dear&nbsp;Odessa, are you sure that you run the code with VW 7.1 and got a score of 0.59410, while you run the same code with VW 7.6 and got a score of 0.59104? I thought there should be some other contributing factors for such difference.</p>\n\n<p>Thanks, and have a great day!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48451",
      "postDate": "06/01/2014 22:00:53",
      "content": "<p>No, with VW 7.1 I got only&nbsp;0.59347, not 0.59410. I use 64 bit version of Cygwin for both.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48453",
      "postDate": "06/01/2014 22:06:46",
      "content": "<p>Hi Odessa,</p>\n<p>I also use 64 bit version Cygwin for both, and I got score 0.59104 for both VW 7.1 and VW 7.6. &nbsp; &nbsp;I have no idea what might cause such difference....</p>\n<p>Anyway, thanks!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48454",
      "postDate": "06/01/2014 22:28:14",
      "content": "<p>[quote=Shize Su;48420]</p>\n<p>Does anyone has ideas about what might cause such difference? Thanks in advance.</p>\n<p>[/quote]</p>\n<p>The difference between Python 2.7 and 3.x should be in changing a few print statements.&nbsp;0.59410 is caused by newer version of Vowpal Wabbit (equal to using no passes in 7.1 version I think). Since 7.4 VW has holdout functionality and stops after doing 4 passes or so.</p>\n<p>Try running any version without&nbsp;doing any&nbsp;passes at all.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48457",
      "postDate": "06/01/2014 23:34:27",
      "content": "<p>Hi Triskelion,</p>\n<p>I tried VW 7.1 with no pass just now but got a score of 0.58717.</p>\n<p>As I said in my previous post, I actually once tried the latest version of VW, namely, VW 7.6, but got a score of 0.59104 rather than 0.59410. This is what make me confused, since Zach said that he used VW 7.6 and got a score of 0.59410.</p>\n<p>Any other thoughts?</p>\n\n<p>Thanks, and have a great day!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48473",
      "postDate": "06/02/2014 13:21:57",
      "content": "<p>[quote=Shize Su;48439]</p>\n<p>Really?</p>\n<p>But Zach said that he used VW version 7.6 and got score of 0.59410. See the post at&nbsp;</p>\n<p>http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7908/0-59410</p>\n<p>Thanks!</p>\n<p>Best wishes,</p>\n<p>Shize</p>\n<p>[/quote]</p>\n\n<p>I'm pretty certain I was using 7.6. &nbsp;Did you run the code exactly as written, or did you make any changes?</p>\n\n<p>Try with both 7.1 and 7.6 and see what happens.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48476",
      "postDate": "06/02/2014 13:49:05",
      "content": "<p>I'm finding I need to change the learning rate significantly with recent VW builds, in order to get similar results results to a VW version pulled a couple weeks ago. &nbsp;My guess is folks following the tutorial with very recent builds are going to get very different results from those originally posted.</p>\n\n<p>More specifically, with recent builds I seem to get similar results with 0.5 as a learning rate, vice the original recommendation of 0.85. &nbsp;Unfortunately the loss function seems to be less of a reliable indicator with VW now exiting / converging much earlier than in previous versions.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48482",
      "postDate": "06/02/2014 14:39:54",
      "content": "<p>Hi Zach,&nbsp;</p>\n<p>I run the code exactly as written, except that I change the paths for the data files (e.g., I change&nbsp;loc_offers = &quot;data/offers.csv&quot; to &nbsp;loc_offers = &quot;offers.csv&quot;.)</p>\n\n<p>I don't think such change about the data file paths would cause any difference about the accuracy, so I am a bit&nbsp;confused about what might cause the difference.</p>\n\n<p>I do have tried both VW 7.1 and VW 7.6, and they gave me exactly same score 0.59104.</p>\n\n<p>Thanks, and have a great day!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48485",
      "postDate": "06/02/2014 14:46:50",
      "content": "<p>Hi Phil,</p>\n\n<p>I tried learning rate 0.5 with VW 7.6 just now, but it gave me a score of &nbsp;0.58984. What's the version of your VW?</p>\n<p>Thanks!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48486",
      "postDate": "06/02/2014 14:49:05",
      "content": "<p>0.59104 is also good. You might wanna improve on that.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48487",
      "postDate": "06/02/2014 14:53:09",
      "content": "<p>[quote=Shize Su;48482]</p>\n<p>Hi Zach,&nbsp;</p>\n<p>I run the code exactly as written, except that I change the paths for the data files (e.g., I change&nbsp;loc_offers = &quot;data/offers.csv&quot; to &nbsp;loc_offers = &quot;offers.csv&quot;.)</p>\n<p>I don't think such change about the data file paths would cause any difference about the accuracy, so I am a bit&nbsp;confused about what might cause the difference.</p>\n<p>I do have tried both VW 7.1 and VW 7.6, and they gave me exactly same score 0.59104.</p>\n<p>Thanks, and have a great day!</p>\n<p>Best wishes,</p>\n<p>Shize</p>\n<p>[/quote]</p>\n\n<p>Interesting. &nbsp;For what it's worth, I'm on a mac. &nbsp;0.59104 is the score a lot of other people got with the earlier version of VW, and they may have been on windows.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48488",
      "postDate": "06/02/2014 14:55:30",
      "content": "<p>Hi Abhishek,</p>\n<p>I do agree that 0.59104 is good. And currently I don't care about the performance at all since I just start this competition. In fact,&nbsp; I am just curious about what might cause such difference, since everything seems to be pretty clear. &nbsp;It seems interesting for me!</p>\n<p>Thanks,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48489",
      "postDate": "06/02/2014 14:57:52",
      "content": "<p>Hi Zach,</p>\n<p>You're right, I do run the code on Windows. Both VW 7.1 and VW 7.6 gave me same score 0.59104. So based on this, maybe the difference between 0.59410 and 0.59104 is simply caused by Mac and Windows? Seems pretty interesting!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48490",
      "postDate": "06/02/2014 15:05:54",
      "content": "<p>I'm on a mac too and my score with VW in the begining was also 0.59410</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48494",
      "postDate": "06/02/2014 15:26:24",
      "content": "<p>[quote=Shize Su;48485]</p>\n<p>Hi Phil,</p>\n<p>I tried learning rate 0.5 with VW 7.6 just now, but it gave me a score of 0.58984. What's the version of your VW?</p>\n<p>Thanks!</p>\n<p>[/quote]</p>\n\n<p>I'm using 7.6.1. &nbsp;I'm also (mostly) on a Mac, although I'm using Windows and Linux builds as well.</p>\n<p>WRT to the score you got - yeah, I haven't quite matched my 7.6 results with 7.6.1. &nbsp;For now I'm using a 7.6 build for most of my VW work. &nbsp;0.85 doesn't give me good results in 7.6.1, so anyone using 7.6.1 may want to play with the learning rate a bit.</p>\n<p>I suppose my main point is that&nbsp;VW changes often. &nbsp;People following the (excellent) MLWave install tutorial for Windows are going to end up with brand new code which may or may not behave very differently.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48495",
      "postDate": "06/02/2014 15:27:55",
      "content": "<p>AFAIK, Triskelion is using Windows.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48499",
      "postDate": "06/02/2014 16:19:24",
      "content": "<p>Hi Abhishek,</p>\n\n<p>Thanks for your provided information. But maybe&nbsp;Triskelion run the code to get score of 0.59347 a couple of weeks ago, and the reason posted by Phil in this posting might cause the difference between my result of&nbsp;0.59104 and his result of 0.59347.</p>\n\n<p>And Phil, could you let me know your operation system (windows or mac?) and the version of VW you use? Thanks!</p>\n\n<p>Anyway, can anyone who uses Windows and VW 7.6 (or VW 7.1) verify that they run the same python code recently and get a score of 0.59410 (or 0.59347)?</p>\n\n<p>Thanks in advance.</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48514",
      "postDate": "06/02/2014 19:49:17",
      "content": "<p>It is possible that different builds of Vowpal Wabbit give slightly different results. As far as I see this is mostly irrelevant: focus on getting the best score for your build and features. The difference is small enough to be variance in public leaderboard. You can't say for sure which is better.</p>\n<p>The settings I gave were for a quick start, they are not the best settings possible.</p>\n<p>Vowpal Wabbit's hashing algorithm then also gives different results for little endian and big endian systems:&nbsp;https://github.com/JohnLangford/vowpal_wabbit/blob/master/vowpalwabbit/hash.cc</p>\n<p>For the record:</p>\n<p>7.1 64-bit Windows = ~0.59347</p>\n<p>7.6.1 64-bit Cygwin on Windows = ~0.59410</p>\n<p>@Shize Su, I don't know why you are getting&nbsp;0.59347 with 7.6.1, most are getting 0.59410&nbsp;with 7.6.1.</p>\n<p>I got my current score with 7.1 BTW using just small adjustments (mostly removing things I thought were fancy). I may share these when I optimize my current score some more (if I ever get time for this).</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48515",
      "postDate": "06/02/2014 20:37:54",
      "content": "<p>Hi Triskelion,</p>\n<p>Thanks for your reply. Actually, I do agree with you that there is no significant difference between 0.59410 and 0.59104 at all. I was not caring about the score since I just start this competition; instead, I am just quite curious about what subtle reasons might cause such difference since everything seems to be that straight forward and clear for me.&nbsp;</p>\n<p>Anyway, if no one can give an precise answer for&nbsp;this issue, I will just forget about it and start to work on my progress.</p>\n<p>P.S.: Triskelion, to clarify, I got score of 0.59104 on both VW 7.6 and VW 7.1, not 0.59347. I use windows operation system.</p>\n<p>Thanks, and have a great day!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48516",
      "postDate": "06/02/2014 20:45:05",
      "content": "<p>Hmm, thanks. &nbsp;I got wildly different leaderboard scores between 7.6 and 7.6.1 (0.59990 vs 0.59033) on the same data / VW settings / machine, and had assumed it was due to changes made to the learning algorithm, hence my warning. &nbsp;However, if everybody else is getting very similar scores between versions I may need to dig deeper at some point and find out what's really going on. &nbsp;:-)</p>\n\n<p>Edit: I was able to reproduce it just now - my current high score 0.60393 (IIRC) set, when run against the latest VW, gets ~0.594 or so. &nbsp;Must be something I'm doing... but this one took place under sterile conditions, everything matched up correctly, so definitely not a one-off mistake. &nbsp;Odd.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48527",
      "postDate": "06/02/2014 22:43:21",
      "content": "<p>Can somebody give me access to the reduced 1.6 GB file? I tried the Python script, but I always get a syntax error</p>\n\n<p>Kind regards,</p>\n<p>Alex</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48535",
      "postDate": "06/03/2014 00:07:20",
      "content": "<p>I may be able to provide a link to a reduced file if necessary, but it'd probably be best to get you up and running - the script is *really* useful! &nbsp;:-) &nbsp;What kind of syntax error are you getting?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48541",
      "postDate": "06/03/2014 01:18:42",
      "content": "<p>Hi&nbsp;Alexander,</p>\n<p>Are you using Python version 3.* to run the code?</p>\n<p>Try to use Python version 2.*, for example, python 2.7 to run the code as written (except changing the paths for the data files), and there should not be any syntax errors.</p>\n<p>I once use python 3.4 to run the code and came across the same syntax error problems, and then as suggested by Scott, I turned to python 2.7, and then there were no syntax errors.</p>\n<p>Hope this would be helpful.</p>\n<p>Have a great night!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48547",
      "postDate": "06/03/2014 05:25:42",
      "content": "<p>While VW is used widely&nbsp;for this completion , I &nbsp;tried with&nbsp;my&nbsp;favorite scikit-learn. With few more features along with what is mentioned by&nbsp;Triskelion's benchmark code, I could fetch 0.59449 (little better than VW benchmark&nbsp;0.59410). I used RF without any tuning.&nbsp;I am hoping for better scores with tuning the params.</p>\n\n<p>My point is, one shouldn't stuck with VW version issues while there are alternate options to try out.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48549",
      "postDate": "06/03/2014 07:03:23",
      "content": "<p>I also tried these both, so I can say that it has close results, so we&nbsp;hope to use them both</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48555",
      "postDate": "06/03/2014 12:37:53",
      "content": "<p>[quote=Chitrasen;48547]</p>\n<p>While VW is used widely&nbsp;for this completion , I &nbsp;tried with&nbsp;my&nbsp;favorite scikit-learn. With few more features along with what is mentioned by&nbsp;Triskelion's benchmark code, I could fetch 0.59449 (little better than VW benchmark&nbsp;0.59410). I used RF without any tuning.&nbsp;I am hoping for better scores with tuning the params.</p>\n<p>My point is, one shouldn't stuck with VW version issues while there are alternate options to try out.</p>\n<p>[/quote]</p>\n<p>Agreed. &nbsp;Would you mind posting your early-benchmark sklearn code somewhere to help&nbsp;folks get started down that path? &nbsp;If it's really simple all the better.</p>\n<p>Edit: without the extra features, etc., of course. &nbsp;Not asking you to give anything away, just the sklearn boilerplate. &nbsp;:-)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48558",
      "postDate": "06/03/2014 13:20:46",
      "content": "<p>Hi Phil, Hi Shize</p>\n\n<p>I use Python 2.7 but I am a beginner. I changed the code to my home directory, where I saved my&nbsp; csv.files:</p>\n<p><code>loc_offers = &quot;offers.csv&quot;<br>loc_transactions = &quot;transactions.csv&quot;<br>loc_reduced = &quot;reduced2.csv&quot; # will be created</code></p>\n<p>But after copy and paste the first line of code I get a syntax error:</p>\n<p><code>def&nbsp;reduce_data(loc_offers, loc_transactions, loc_reduced):</code><code>&nbsp; start = datetime.now()<br>&nbsp; #get all categories on offer in a dict<br>&nbsp; offers = {}<br>&nbsp; for e, line in enumerate( open(loc_offers) ):<br>&nbsp; &nbsp; offers[ line.split(&quot;,&quot;)[1] ] = 1</code></p>\n<p>Actually I need the 1.6GB csv for a test if I can read 1.6 GB file from S3 to Graphlabb Create:</p>\n<p>http://forum.graphlab.com/discussion/251/s3-sframe-read-problems</p>\n<p>Kind regards,</p>\n<p>Alex</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48561",
      "postDate": "06/03/2014 14:07:14",
      "content": "<p>If you're doing this in&nbsp;the python console you might be better served by running the whole file all at once:</p>\n<p>run &quot;gen_vw_features.py&quot;</p>\n<p>Also, if you're not going to provide specific paths, make sure you're running python / ipython from the directory where the data files reside, or set the working directory in some other way.</p>\n\n<p>Lastly, here's a link to the reduced csv:</p>\n<p>https://dl.dropboxusercontent.com/u/12189505/reduced.csv.zip</p>\n\n<p>If anyone decides to put it somewhere more performant, let me know and I'll take the link down. &nbsp;:-)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48595",
      "postDate": "06/04/2014 05:22:07",
      "content": "<p>[quote=Phil Culliton;48555]</p>\n\n<p>Agreed. &nbsp;Would you mind posting your early-benchmark sklearn code somewhere to help&nbsp;folks get started down that path? &nbsp;If it's really simple all the better.</p>\n<p>Edit: without the extra features, etc., of course. &nbsp;Not asking you to give anything away, just the sklearn boilerplate. &nbsp;:-)</p>\n<p>[/quote]</p>\n\n<p>Here is my skeleton code using Pandas and scikit-learn.</p>\n<p>Note: My original features have been removed from the code. Code is extracted from my ipython notebook, hence may not be in proper python coding standard. I am sorry for that.</p>\n\n\n\n<p>I also added the code to <a href=\"http://chitcode.wordpress.com/2014/06/04/python-skeleton-code-for-kaggle-acquire-valued-shoppers-challenge/\" target=\"_blank\">my blog</a>.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48615",
      "postDate": "06/04/2014 11:39:05",
      "content": "<p>Chitrasen, thank you for code sharing. Did you do&nbsp;a cross validation via sklearn?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48616",
      "postDate": "06/04/2014 11:51:40",
      "content": "<p>[quote=rzykov;48615]</p>\n<p>Chitrasen, thank you for code sharing. Did you do&nbsp;a cross validation via sklearn?</p>\n<p>[/quote]</p>\n\n<p>Yes, I did some CV testing, but seems test and train data distributions are either different, or there seems some pattern I am missing to account into. I am getting similar results as mentioned in <a href=\"https://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7845/cross-validation-fails-to-evaluate-the-model\" target=\"_blank\">this thread</a>.</p>\n\n<p>I was getting 4 fold CV score of 0.68XXX with the sample code, I provided. (my current CV score improved to 0.715).</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48617",
      "postDate": "06/04/2014 12:05:09",
      "content": "<p>I do a cross validation over all offers. It is like K-fold CV where each fold is a an offer.</p>\n<p>Then calculate mean of CV's errors. It's very close to my test results.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48623",
      "postDate": "06/04/2014 12:49:27",
      "content": "<p>I just wanted to leave my contribution to this great, collaborative, thread.</p>\n<p>I used the whole 22Gb transaction data and ran svm + logistic regression with the features as suggested by&nbsp;Triskelion. The result was a 0.59735 score. Running the same set up with the reduced data set produced a 0.58627 score. Therefore, in this case,&nbsp;using more data improved the score by 0.01 .&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48630",
      "postDate": "06/04/2014 14:11:30",
      "content": "<p>[quote=Chitrasen;48595]</p>\n<p>Here is my skeleton code using Pandas and scikit-learn.</p>\n<p>[/quote]</p>\n<p>What score does this give on public leaderboard?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48632",
      "postDate": "06/04/2014 15:02:25",
      "content": "<p>[quote=Paulo;48623]</p>\n<p>I just wanted to leave my contribution to this great, collaborative, thread.</p>\n<p>I used the whole 22Gb transaction data and ran svm + logistic regression with the features as suggested by&nbsp;Triskelion. The result was a 0.59735 score. Running the same set up with the reduced data set produced a 0.58627 score. Therefore, in this case,&nbsp;using more data improved the score by 0.01 .&nbsp;</p>\n<p>[/quote]</p>\n<p>Cool, this is a useful tip. I wonder why this gives so much of a difference though. Maybe the features that hold &quot;total amount spend&quot; become more indicative?</p>\n\n<p>I'll try these with my new settings and report back if it improves. I finally got a little time to optimize my current near-leaderboard score and try out some new features.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48669",
      "postDate": "06/04/2014 22:41:06",
      "content": "<p>[quote=Triskelion;48630]</p>\n<p>[quote=Chitrasen;48595]</p>\n<p>Here is my skeleton code using Pandas and scikit-learn.</p>\n<p>[/quote]</p>\n<p>What score does this give on public leaderboard?</p>\n<p>[/quote]</p>\n\n<p>The additional features&nbsp;like 'median price' and 'median amount' and some others worked better.&nbsp;My initial score with those features and the skeleton code, was&nbsp;0.59449 on&nbsp;leaderboard.</p>\n<p>My current&nbsp;leaderboard score(0.60343) uses some more features and tuning of RF params.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48696",
      "postDate": "06/05/2014 09:20:46",
      "content": "<p>Only one question,</p>\n\n<p>how well the model classifies among repeaters (t) ?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48710",
      "postDate": "06/05/2014 12:21:09",
      "content": "<p>Hmm. &nbsp;I tried your code (exactly as-is, with no changes), Chitrasen, and got a submission error regarding the ids - they were float64 and the submission code wanted them not to be. &nbsp;I switched them to int64, and got a leaderboard score of 0.54190. &nbsp;Wonder what's going on there?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48716",
      "postDate": "06/05/2014 13:24:45",
      "content": "<p>I think 0.54190 is OK for this code, it only has features that include only category and company information.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48721",
      "postDate": "06/05/2014 14:08:29",
      "content": "<p>[quote=Selfish Gene;48716]</p>\n<p>I think 0.54190 is OK for this code, it only has features that include only category and company information.</p>\n<p>[/quote]</p>\n<p>True, but I figured I'd ask to make sure! &nbsp;Since newcomers might be using this code, I thought it would be useful to know what the approximate leaderboard score might be, and wanted to double-check my result. &nbsp;Also, to report the id bug. &nbsp;:-)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48747",
      "postDate": "06/06/2014 02:34:43",
      "content": "<p>I face this errors...</p>\n<p>Can anyone help me &quot;how to solve this problem?&quot;</p>\n<p>ValueError: time data '1' does not match format '%Y-%m-%d'</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48755",
      "postDate": "06/06/2014 06:26:36",
      "content": "<p>[quote=Chitrasen;48669]<br>The additional features like 'median price' and 'median amount' and some others worked better. My initial score with those features and the skeleton code, was 0.59449 on leaderboard.<br>My current leaderboard score(0.60343) uses some more features and tuning of RF params.<br>[/quote]</p>\n<p>Hi Chitrasen, I used RF model with 5-fold CV on my training set and got score 0.675xx. But when I applied the same model on my test set, my prediction was just like random, score 0.49476. Did you see any similar thing? Do you have any suggestions? Thanks!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48758",
      "postDate": "06/06/2014 07:01:27",
      "content": "<p>[quote=Kien Trinh;48755]</p>\n<p>Hi CHi Chitrasen, I used RF model with 5-fold CV on my training set and got score 0.675xx. But when I applied the same model on my test set, my prediction was just like random, score 0.49476. Did you see any similar thing? Do you have any suggestions? Thanks!</p>\n<p>[/quote]</p>\n<p>I am also struggling to get a reliable CV testing technique :(</p>\n<p>Yes,I see the similar effect as you are getting. To put time effect on CV, I sort the training data with offerdate and then apply K-Fold CV. The CV scores vary from 0.58 to 0.68 and on the leader board it scored 0.572 ( I have used some of my features, not the features mentioned in my previous post on skeleton code).</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48763",
      "postDate": "06/06/2014 08:59:34",
      "content": "<p>rzykov mentioned very good idea: to train on some offers and to test on others, for those who struggling&nbsp;to get a reliable CV technique it's worth trying. It should be better for sure then any standard CV.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48773",
      "postDate": "06/06/2014 12:45:17",
      "content": "<p>Christansen,</p>\n\n<p>only a very specific question that nobody answers me and it's very easy:</p>\n\n<p>there are 43.438 customers who repeated. Well, of these 43.438 customers, how you classify correctly?</p>\n\n<p>Kind regards</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48807",
      "postDate": "06/06/2014 21:00:40",
      "content": "<p>[quote=mike;48773]</p>\n<p>Christansen,</p>\n<p>only a very specific question that nobody answers me and it's very easy:</p>\n<p>there are 43.438 customers who repeated. Well, of these 43.438 customers, how you classify correctly?</p>\n<p>Kind regards</p>\n<p>[/quote]</p>\n<p>Mike - you are doing binary classification {0 or 1}. There are 43438&nbsp;outcomes { 1 } on training set. You are predicting the probability a shopper will be come a loyal customer { 1 } on test set. You submission file is a list of probability in a range [0,1]. I hope I answer your question. Best!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48853",
      "postDate": "06/08/2014 02:29:11",
      "content": "<p>[quote=nhc;48747]</p>\n<p>I face this errors...</p>\n<p>Can anyone help me &quot;how to solve this problem?&quot;</p>\n<p>ValueError: time data '1' does not match format '%Y-%m-%d'</p>\n<p>[/quote]</p>\n\n<p>Can you elaborate abit more about the error? I'm going to take a stab here and say that its because the test and train history data has different date format. You'll have to treat them both seperately</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48857",
      "postDate": "06/08/2014 10:49:40",
      "content": "<p>thank you Eu Jin Lok!!! I find the problem on my trainHistory Data!!! I make a mistake to check only transaction data...</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48864",
      "postDate": "06/08/2014 16:47:25",
      "content": "<p>thanks for you answer.</p>\n<p>I clearly explain bad, my question is: if we consider a probability above 0.5 as&nbsp;repeater,&nbsp;then, how well&nbsp;your model classifies&nbsp;?</p>\n\n<p>bye&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48872",
      "postDate": "06/08/2014 20:28:47",
      "content": "<p>Just a note on this program, as I tried it out the other day (and it's a great and I've learned a lot. Thank you to the submitter!) There are some customers in trainhistory and testhistory who have no data, and from what I can tell they don't end up in the training set or more importantly the prediction set (there are less total rows than in the original trainhistory+testhistory). I don't know how kaggle handles this.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48875",
      "postDate": "06/08/2014 21:20:38",
      "content": "<p>[quote=Thomas O'Malley;48872]</p>\n<p>Just a note on this program, as I tried it out the other day (and it's a great and I've learned a lot. Thank you to the submitter!) There are some customers in trainhistory and testhistory who have no data, and from what I can tell they don't end up in the training set or more importantly the prediction set (there are less total rows than in the original trainhistory+testhistory). I don't know how kaggle handles this.</p>\n<p>[/quote]</p>\n<p>If you use transactions.csv file, the number of shoppers is exactly equal to the number of shoppers in two files: trainHistory.csv and testHistory.csv.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48883",
      "postDate": "06/09/2014 06:20:46",
      "content": "<p>You can beat the &quot;prior category benchmark&quot; without even using the transaction file.</p>\n<p>Just a logistic fit on trainhistory &nbsp;based on &nbsp;variables suggested by varImpPlot() &nbsp;on randomForest &nbsp;model. &nbsp; :-)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48886",
      "postDate": "06/09/2014 07:19:05",
      "content": "<p>for offerdate &nbsp;, Changing factor to 'as.Date' worked for me &nbsp; .</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48895",
      "postDate": "06/09/2014 12:07:51",
      "content": "<p>[quote=Thomas O'Malley;48872]</p>\n<p>Just a note on this program, as I tried it out the other day (and it's a great and I've learned a lot. Thank you to the submitter!) There are some customers in trainhistory and testhistory who have no data, and from what I can tell they don't end up in the training set or more importantly the prediction set (there are less total rows than in the original trainhistory+testhistory). I don't know how kaggle handles this.</p>\n<p>[/quote]</p>\n<p>I handled this in the benchmark by predicting a 0 for these customers. Kaggle submissions need all the entries from the original test set, else it will throw a warning.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48896",
      "postDate": "06/09/2014 12:10:48",
      "content": "<p>I think&nbsp;Kien is right.</p>\n<p>There are exactly same users in raw transactions as in train + test. So, there are no users that have no data unless you didn't filter transactions first.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48996",
      "postDate": "06/11/2014 13:05:39",
      "content": "<p>[quote=Shize Su;48489]</p>\n<p>Hi Zach,</p>\n<p>You're right, I do run the code on Windows. Both VW 7.1 and VW 7.6 gave me same score 0.59104. So based on this, maybe the difference between 0.59410 and 0.59104 is simply caused by Mac and Windows? Seems pretty interesting!</p>\n<p>Best wishes,</p>\n<p>Shize</p>\n<p>[/quote]</p>\n\n<p>Hi Shize Su, I ran Triskelion's method&nbsp;a couple&nbsp;nights ago&nbsp;with&nbsp;VW 7.6 on&nbsp;Windows.&nbsp;I got the same score (0.59104 ) as you.</p>\n\n<p>Triskelion, thank you very much for sharing the&nbsp;details of your&nbsp;method.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49006",
      "postDate": "06/11/2014 16:09:37",
      "content": "<p>Hi guys</p>\n<p>Do you think its possible to run Trischlikons model on a GraphLab Create EC2 instance:<a href=\"http://graphlab.com/products/create/docs/generated/graphlab.vowpal_wabbit.create.html#graphlab.vowpal_wabbit.create\" target=\"_blank\">&nbsp;</a></p>\n<p><a href=\"http://graphlab.com/products/create/docs/generated/graphlab.vowpal_wabbit.create.html#graphlab.vowpal_wabbit.create\" target=\"_blank\">http://graphlab.com/products/create/docs/generated/graphlab.vowpal_wabbit.create.html#graphlab.vowpal_wabbit.create</a></p>\n<p>I am not quite sure how to transmit the the features from Python to this EC2 instance, but it could be an advantage for the full 20 GB file.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49053",
      "postDate": "06/12/2014 13:43:11",
      "content": "<p>Hi All -</p>\n\n<p>I've been using R to try and replicate the results that you all have received with Python and VW. Logistic regression using the Lasso method only got me up to .57 with the engineered features, so I wanted to try quantile regression, but&nbsp;am having a hard time figuring out how to run the same kind of quantile regression in R.</p>\n\n<p>The most promising package seemed to be 'quantreg', but I've gotten errors with it every time</p>\n\n<p>When running:&nbsp;rq(data=tempTR,as.formula(x),tau=.6) &nbsp; where tempTR is my data.frame with engineered values and 'x' is the text version of my formula, I get the following error</p>\n<p>*&nbsp;Error in rq.fit.br(x, y, tau = tau, ...) : Singular design matrix</p>\n\n<p>I've also attempted to try other&nbsp;models that looked promising in the 'quantreg' package, such as 'rqProcess': which in the R-help documentation, says: &quot;Computes a standardize quantile regression process for the model specified by the formula, on the partition of [0,1] specified by the taus argument, and standardized according to the argument nullH. Intended for use in&nbsp;KhmaladzeTest.</p>\n\n<p>rqProcess(as.formula(x),data=tempTR,taus=c(.5))</p>\n\n<p>The problem with this one is it requires I specify a range of 'equally spaced taus' , when I do this:</p>\n\n<p>rqProcess(as.formula(x),data=tempTR,taus=c(.2,.4,.6,.8))</p>\n\n<p>I get an error saying 'singular design matrix' again.</p>\n\n<p>Can anyone advise?</p>\n\n<p>My formula is below, and through troubleshooting, I've just narrowed it down to the metrics posted earlier on this thread:</p>\n\n<p>&quot;repeater ~ I(last_600_count_brand == 0) + I(last_600_count_brand &gt; 0 &amp; last_600_count_company &gt; 0 &amp; last_600_count_category &gt;0) + I(last_60_count_brand &gt; 0) + I(last_600_count_brand &gt; 0 &amp; last_600_count_company &gt; 0) + I(last_30_count_brand &gt; 0) + I(last_600_count_brand &gt; 0 &amp; last_600_count_category &gt; 0) + I(last_600_count_brand &gt; 0) + last_30_monVal_brand + I(last_90_count_brand &gt; 0) + last_60_monVal_brand + I(last_60_count_company &gt; 0) + last_90_monVal_brand + last_60_q_company + I(last_600_count_category == 0) + last_600_q_brand + last_180_monVal_brand + I(last_180_count_brand &gt; 0) + offervalue + last_30_q_category&quot;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49082",
      "postDate": "06/13/2014 03:44:08",
      "content": "<p>ddunder: Having never worked with the quantreg package I can only hazard some guesses.</p>\n\n<p>Based on the message returned by R, I'd guess that quantreg has a matrix inversion in it somewhere and the programmers have set the code to detect linear dependence in the design matrix (nice to see some defensive programming). I would reproduce the design matrix (in R: design.matrix) and then check for linear dependence. Given the formula indicated, I'd look for equal columns in the matrix.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49126",
      "postDate": "06/13/2014 20:34:05",
      "content": "<p>quantreg works for me... not great;I got only 0.58364:</p>\n\n<p><code>cols &lt;- c(&quot;V167&quot;, ...)<br>dt &lt;- data.frame(train[,cols])<br>dt$y &lt;- idy$repeattrips<br>model &lt;- rq(y~., data=dt, method='fn', tau=0.5)<br>submit$repeatProbability &lt;- predict(model, test[,cols])<br></code></p>\n\n<p>Yes, the feature selection (10 of 350) was done first; the CV (10 folds) was 6.02...</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49257",
      "postDate": "06/17/2014 16:49:30",
      "content": "<p>Thank you, but when I try to run the&nbsp;gen_vw_features.py file I get:</p>\n<p><code><em>Alexanders-iMac:~ arigge$ python gen_vw_features.py</em><br><em> File &quot;gen_vw_features.py&quot;, line 6</em><br><em> &lt;!DOCTYPE html&gt;</em><br><em> ^</em><br><em>SyntaxError: invalid syntax</em><br><br></code></p>\n<p>I placed all my csv files in a folder called data in my home directory arigge. Can somebody tell me what I am missing ?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49259",
      "postDate": "06/17/2014 18:20:43",
      "content": "<p>Hi Alexander,</p>\n\n<p>Are you using Python 2.7 or Python 3.*?</p>\n<p>~</p>\n<p>To run the posted code by&nbsp;Triskelion, you need to use Python 2.7 version rather than 3.* version. They have quite different syntax.</p>\n<p>~</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49260",
      "postDate": "06/17/2014 19:18:51",
      "content": "<p>Thank you Shize.</p>\n\n<p>I use Python 2.7 which runs on Mac by default.</p>\n\n<p>Best,</p>\n<p>Alex&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49261",
      "postDate": "06/17/2014 19:50:08",
      "content": "<p>Hi&nbsp;Alexander,</p>\n\n<p>Uh, interesting.</p>\n<p>~</p>\n<p>For me, I just download the code, change the location for data files, and run it with Python 2.7 on windows, and then everything works.</p>\n<p>~</p>\n<p>Besides, are you sure that the only change&nbsp;you made to the Python code is just the data file locations? If yes, then I don't know why it doesn't work on your computer. Maybe you could &nbsp;try to run the same code on another computer and see what happens. It seems to me that there is no reason why it will not work.</p>\n<p>~</p>\n<p>Have a great day!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49268",
      "postDate": "06/18/2014 03:55:51",
      "content": "<p>Hi Alex,</p>\n<p>I am also using Mac and Python 2.7 without any problem.</p>\n\n<p>Best,</p>\n<p>Tam</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49269",
      "postDate": "06/18/2014 04:33:46",
      "content": "<p>Is it important to normalize/standardize the data, since vw seems to be some sort of gradient-based algorithm (plz correct me if I'm wrong)??</p>\n\n<p>Triskelion, thanks a million for sharing your solution and introducing us to the powers of vw.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49286",
      "postDate": "06/19/2014 03:12:17",
      "content": "<p>Check for whitespace. Make sure you don't have any stray spaces on empty lines. Especially line 6.</p>\n\n<p>[quote=Alexander Riggers;49257]</p>\n<p>Thank you, but when I try to run the&nbsp;gen_vw_features.py file I get:</p>\n<p><code><em>Alexanders-iMac:~ arigge$ python gen_vw_features.py</em><br><em> File &quot;gen_vw_features.py&quot;, line 6</em><br><em> &lt;!DOCTYPE html&gt;</em><br><em> ^</em><br><em>SyntaxError: invalid syntax</em><br><br></code></p>\n<p>I placed all my csv files in a folder called data in my home directory arigge. Can somebody tell me what I am missing ?</p>\n<p>[/quote]</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49292",
      "postDate": "06/19/2014 07:57:07",
      "content": "<p>May I ask what the &quot;average loss&quot; and &quot;since last&quot; columns converged to towards the end? I've had cases where the predictions are quite different but those 2 columns gave similar results during training. Then how does one tell which one is better?</p>\n\n<p>Many thanks in advance!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49293",
      "postDate": "06/19/2014 08:02:58",
      "content": "<p>Sorry another question: are the Y's used here repeater (i.e. 0s and 1s) or number of repeats?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49304",
      "postDate": "06/19/2014 15:06:04",
      "content": "<p>Wanted to note two things quickly:</p>\n<p>1) Namespaces! &nbsp;They're a great feature of Vowpal Wabbit. &nbsp;I use them to quickly test features - just put each new feature / feature class into its own namespace, then turn them on and off at the vw command line (using --keep or --ignore) rather than rebuilding the train/test files for each possible combination of features. &nbsp;Other folks are probably already doing this, but I wanted to throw it out there.</p>\n\n\n<p>2) If using namespaces, be aware that unless specified, testing (with -t) will use ALL namespaces, and could change your results slightly.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "49999",
      "postDate": "07/03/2014 16:01:40",
      "content": "<p>By the way - Triskelion, I tried to get in touch with you via your website a few weeks ago about VW. &nbsp;I'm guessing it didn't go through, and I'm still too much of a Kaggle newbie to be able to email other users, so if you'd like to, please feel free to email me. &nbsp;:-)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50002",
      "postDate": "07/03/2014 17:51:21",
      "content": "<p>[quote=Phil Culliton;49999]</p>\n<p>By the way - Triskelion, I tried to get in touch with you via your website a few weeks ago about VW. &nbsp;I'm guessing it didn't go through, and I'm still too much of a Kaggle newbie to be able to email other users, so if you'd like to, please feel free to email me. &nbsp;:-)</p>\n<p>[/quote]</p>\n<p>Whoops, yeah that manual checking of spam vs. ham comments took more time then I expected. Sorry for that, I'll go through the existing queue and install Akismet or something so this won't happen again.</p>\n\n<p>I think you can email other users by clicking their profile and then &quot;contact&quot;, but maybe you have to be Kaggler for that first. I send you an email over the Kaggle comment system.</p>\n\n<p>Thank you for all your comments, here and elsewhere, and helping everyone out!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50004",
      "postDate": "07/03/2014 18:27:16",
      "content": "<p>[quote=Triskelion;50002]</p>\n<p>Whoops, yeah that manual checking of spam vs. ham comments took more time then I expected. Sorry for that, I'll go through the existing queue and install Akismet or something so this won't happen again.</p>\n<p>[/quote]</p>\n\n<p>No worries at all, that sort of stuff can creep up on you.</p>\n\n<p>[quote=Triskelion;50002]</p>\n<p>I think you can email other users by clicking their profile and then &quot;contact&quot;, but maybe you have to be Kaggler for that first. I send you an email over the Kaggle comment system.</p>\n<p>[/quote]</p>\n\n<p>I'm a Kaggler, but I apparently need more points to be able to contact others. &nbsp;Thanks for the email!</p>\n\n<p>[quote=Triskelion;50002]</p>\n<p>Thank you for all your comments, here and elsewhere, and helping everyone out!</p>\n<p>[/quote]</p>\n\n<p>Just taking an example from you, really! &nbsp;And from many&nbsp;of the other generous folks here. &nbsp;I've been really impressed&nbsp;by all of the people stepping forward to&nbsp;help folks figure out the basics. &nbsp;I'd love to help even more myself, if possible.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50011",
      "postDate": "07/03/2014 23:00:58",
      "content": "<p>[quote=Peemblis;48996]</p>\n<p>[quote=Shize Su;48489]</p>\n<p>Hi Zach,</p>\n<p>You're right, I do run the code on Windows. Both VW 7.1 and VW 7.6 gave me same score 0.59104. So based on this, maybe the difference between 0.59410 and 0.59104 is simply caused by Mac and Windows? Seems pretty interesting!</p>\n<p>Best wishes,</p>\n<p>Shize</p>\n<p>[/quote]</p>\n<p>Hi Shize Su, I ran Triskelion's method&nbsp;a couple&nbsp;nights ago&nbsp;with&nbsp;VW 7.6 on&nbsp;Windows.&nbsp;I got the same score (0.59104 ) as you.</p>\n<p>Triskelion, thank you very much for sharing the&nbsp;details of your&nbsp;method.</p>\n<p>[/quote]</p>\n<p>Out of curiosity, do you find you have probability scores that have a truncated decimal string (such as random forest in R)? I have not looked at VW so I am not familiar with the output but when using randomforest in R, I believe it truncates to 3 or 4 decimal places giving many records the same score (especially when using many binary features). A simple change in order upon submission can throw off the final score, even when running the identical model but with a different ordering of input records on each iteration.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50056",
      "postDate": "07/04/2014 23:10:20",
      "content": "<p>[quote=Ben Post;50011]</p>\n<p>Out of curiosity, do you find you have probability scores that have a truncated decimal string (such as random forest in R)?</p>\n<p>[/quote]</p>\n<p>It's likely that they use the same script to convert a VW predictions file to a Kaggle submission.</p>\n<p>.</p>\n<p>It seems that VW can produce different results depending on&nbsp;your&nbsp;CPU type. VW is&nbsp;compiled with <a href=\"https://gcc.gnu.org/wiki/FloatingPointMath\">ffast-math</a>&nbsp;flag, which is&nbsp;the least conforming but fastest math mode.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50058",
      "postDate": "07/05/2014 02:37:42",
      "content": "<p>[quote=Triskelion;50056]</p>\n<p>It seems that VW can produce different results depending on&nbsp;your&nbsp;CPU type. VW is&nbsp;compiled with <a href=\"https://gcc.gnu.org/wiki/FloatingPointMath\">ffast-math</a>&nbsp;flag, which is&nbsp;the least conforming but fastest math mode.</p>\n<p>[/quote]</p>\n<p>And compiler type! &nbsp;Every compiler plays with math-heavy code differently, and interprets things like fast-math differently. &nbsp;I&nbsp;wouldn't be&nbsp;at all surprised to find that VW compiled with GCC would behave slightly differently than with, say, Intel or MSVCPP.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50090",
      "postDate": "07/07/2014 04:05:53",
      "content": "<p>i got 0.59474 by Triskelion's feature and vw command line. when i tried to add some features , i got worse scores and curiously found many predict results were zero. after tuned vw parameter lambda&#65292;nothing changed. &nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50210",
      "postDate": "07/09/2014 15:55:19",
      "content": "<p>What features did you try to add? &nbsp;And what changes did you make to VW parameters? &nbsp;I've found that Triskelion's initial settings are actually a pretty darned good fit.</p>\n\n<p>Also - when did you grab your Vowpal Wabbit build? &nbsp;Did you pull straight from github? &nbsp;There are some recent bugs, I think - some nasty issues with not properly updating average loss, etc.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50218",
      "postDate": "07/09/2014 17:21:53",
      "content": "<p>I have a question regarding the gen_feature_vw.py output. Why do all entries in the test.vw file have a label of one?&nbsp;</p>\n\n<p>VW input format is:</p>\n<p>label [weight] |Namespace Feature ... Feature |Namespace ...</p>\n\n<p>In our case 1`lastid ....</p>\n<p>While int the train file we also have some 0 labels.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "50219",
      "postDate": "07/09/2014 17:36:30",
      "content": "<p>VW ignores labels when in test mode - so it doesn't matter what's there. &nbsp;However, something does need&nbsp;to be there, so we put in some dummy information. &nbsp;When using the train file we're (most likely) actually training the VW model, so you&nbsp;put real information in the labels.</p>\n\n<p>One nice side effect of using all 1s as the dummy labels is that you can use average loss on the test run to gauge how &quot;high&quot; or &quot;low&quot; your current set of features might be pushing the overall results, simply by comparing it to the average testing loss from previous runs. &nbsp;Since VW doesn't have good support for CV, any kind of meta-data about your current results&nbsp;can be helpful. &nbsp;:-)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "116220",
      "postDate": "04/22/2016 15:25:03",
      "content": "<p>Thanks for sharing!</p>",
      "rawMarkdown": "Thanks for sharing!",
      "votes": null
    },
    {
      "id": "3229372",
      "postDate": "06/21/2025 11:53:12",
      "content": "<p>nicely explained </p>",
      "rawMarkdown": "nicely explained",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3229372,
      "author_name": "vickey13",
      "author_url": "",
      "post_date": "06/21/2025 11:53:12",
      "content": "<p>nicely explained </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 41962,
      "author_name": "mathieucliche",
      "author_url": "",
      "post_date": "04/15/2014 19:54:40",
      "content": "<p>So I noticed that the offer_quantity is equal to 1 for all offers of trainHistory, while it is sometimes equal to 2 for some of the offers in testHistory. &nbsp;This explain why it is not a good feature as it is. &nbsp;</p>\n<p>However, I can imagine someone getting a &quot;good&quot; feature out of this by probing the test data a few times with the kaggle score, though I doubt this is a good use of one's time. &nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 41978,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "04/15/2014 22:58:15",
      "content": "<p>[quote=Mathieu Cliche;41962]</p>\n<p>So I noticed that the offer_quantity is equal to 1 for all offers of trainHistory, while it is sometimes equal to 2 for some of the offers in testHistory.</p>\n<p>[/quote]</p>\n<p>Astute observation! I probably should have checked that myself. Seemed such a nice feature. I think it is useless now.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42021,
      "author_name": "zhaogang",
      "author_url": "",
      "post_date": "04/16/2014 10:41:50",
      "content": "<p>Great job!</p>\n<p>good start!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42047,
      "author_name": "artghazaryan",
      "author_url": "",
      "post_date": "04/16/2014 14:49:38",
      "content": "<p>Triskelion</p>\n<p>Your thoughts of creating new features from the transaction data are absolutely right. One note though. Brand is associated with category and company, So, if a shopper buys a brand, he/she buys the category, and the company as well. So, you can combine these three into one feature. To be more accurate, I think category and company could be left out, because the offers are made on brands, not categories or companies. I think a new binary feature, that indicates if a shopper has purchased the brand prior to the offer, would be sufficient. In other words, a shopper who has prior exposure to the brand, is more likely to respond to the offer, than the shopper who has not had the exposure.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42056,
      "author_name": "abhishek",
      "author_url": "",
      "post_date": "04/16/2014 15:47:52",
      "content": "<p>[quote=Art_Ghazaryan;42047]</p>\n<p>Triskelion</p>\n<p>Your thoughts of creating new features from the transaction data are absolutely right. One note though. Brand is associated with category and company, So, if a shopper buys a brand, he/she buys the category, and the company as well. So, you can combine these three into one feature. To be more accurate, I think category and company could be left out, because the offers are made on brands, not categories or companies. I think a new binary feature, that indicates if a shopper has purchased the brand prior to the offer, would be sufficient. In other words, a shopper who has prior exposure to the brand, is more likely to respond to the offer, than the shopper who has not had the exposure.&nbsp;</p>\n<p>[/quote]</p>\n<p>No.</p>\n<p>Brand is not associated with category (with company?). A sparkling water bottle is a category. A company can make many brands but all brands do not belong to one company. Brand is a trademark of a given company. If you buy kinley still mineral water, you are buying from department = water, category = still water, brand = kinley, company = coca cola</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42058,
      "author_name": "martin22",
      "author_url": "",
      "post_date": "04/16/2014 15:54:47",
      "content": "<p>[quote=Triskelion;41913]</p>\n<p>Here is some code and ideas to get a score of around 0.59347. It uses Python and Vowpal Wabbit, but the idea should work with other languages and other algorithms.</p>\n<p>[/quote]</p>\n\n<p>Do you get this same (or similar) score when doing crossvalidation on your end, or do you get a&nbsp;much higher one?</p>\n<p>It seems to me that an important factor in this competition is generating a validation set that actually works. I had tried using similar features to the ones you described and got a score of ~0.67&nbsp;in CV, but only 0.55 in the public leaderboard. For my best submission (currently 0.588), I get ~0.60 in CV, which makes this really confusing.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42059,
      "author_name": "artghazaryan",
      "author_url": "",
      "post_date": "04/16/2014 16:12:32",
      "content": "<p>Abhishek,</p>\n\n<p>When you get a coupon, it is for a specific brand. You cannot redeem that coupon to get another brand of the same company, or category, or department.</p>\n<p>There is also another issue here. What type of association we have between each shopper and coupons? Is it one to one? Were the coupons provided as a collection(coupon book, newspaper insert, etc), or they were provided in some other way?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42069,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "04/16/2014 17:20:10",
      "content": "<p>[quote=Martin Martin;42058]</p>\n<p>[quote=Triskelion;41913]</p>\n<p>Here is some code and ideas to get a score of around 0.59347. It uses Python and Vowpal Wabbit, but the idea should work with other languages and other algorithms.</p>\n<p>[/quote]</p>\n<p>Do you get this same (or similar) score when doing crossvalidation on your end, or do you get a&nbsp;much higher one?</p>\n<p>[/quote]</p>\n<p>I get a higher one. (~3-5 AUC higher) I think this may be due to outliers in the train set (and test set). I suspect that if you denoise the train and test set, your model will be more robust, and your validation scores are then closer to the leaderboard.</p>\n<p>I am familiar with removing noisy features (PCA, topkfeatures etc.), not too familiar with removing noisy feature values (more like fraud detection). EDIT:&nbsp;<a href=\"http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7671/evaluation/\">This thread</a>&nbsp;seems to suggest it is not due to noise/outliers, but due to temporal issues. I think that means in 5-year-old speak that the train set and test set are fairly different from each other. CV on only the train set will be higher than public leader board score, as the train set itself is more internally consistent. This may be a hard problem to solve, though an increase in local CV may very well mean an increase in public leaderboard score.</p>\n<p>I'll take a better look soon, for now I have a few other competitions that demand my attention.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42072,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "04/16/2014 17:25:33",
      "content": "<p>[quote=Art_Ghazaryan;42059]</p>\n<p>Abhishek,</p>\n<p>When you get a coupon, it is for a specific brand. You cannot redeem that coupon to get another brand of the same company, or category, or department.</p>\n<p>There is also another issue here. What type of association we have between each shopper and coupons? Is it one to one? Were the coupons provided as a collection(coupon book, newspaper insert, etc), or they were provided in some other way?</p>\n<p>[/quote]</p>\n<p>Hey Art Ghazaryan. I think you may be right. Some features are superfluous. Has_never_bought_brand_company would probably be the same as has_never_bought_brand. As it is unlikely that another company creates the same brand.</p>\n<p>I was not too sure of this beforehand. I just extracted some features and ran it through Vowpal Wabbit. I don't like relying on domain expertise too much (as I have very little in all domains). Basically I hope I use tools that are good enough to discard useless features and focus only on the indicative features. Vowpal Wabbit is pretty good at that, sklearn has some algorithms that are better. Most of them need feature values to be scaled between 0-1 and demand all data to be loaded into memory. While a bit more work, this may reduce the hard-to-normalize noise in the data sets.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42125,
      "author_name": "yzhao0527",
      "author_url": "",
      "post_date": "04/17/2014 02:09:35",
      "content": "<p>6,089 out of 35689&nbsp;brands belong to more than one company ... I am very confused ...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42142,
      "author_name": "mikedemurtas",
      "author_url": "",
      "post_date": "04/17/2014 05:51:48",
      "content": "<p>[quote=Y Zhao;42125]</p>\n<p>6,089 out of 35689 brands belong to more than one company ... I am very confused ...</p>\n<p>[/quote]</p>\n<p>My guessing is because in the data description they say:</p>\n<p>'The transactions file can be joined to the offers file by (category, brand, company).'</p>\n<p>We should consider&nbsp;category, brand, company as a key, so different brands for different companies can have the same code but they are actually different brands.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42326,
      "author_name": "zachmayer",
      "author_url": "",
      "post_date": "04/18/2014 15:46:32",
      "content": "<p>[quote=Mike Demurtas;42142]</p>\n<p>My guessing is because in the data description they say:</p>\n<p>'The transactions file can be joined to the offers file by (category, brand, company).'</p>\n<p>We should consider&nbsp;category, brand, company as a key, so different brands for different companies can have the same code but they are actually different brands.</p>\n<p>[/quote]</p>\n<p>I'd really love to get an answer from the competition admin on this-- do we need to combine company and category to get a unique brand id?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42328,
      "author_name": "yzhao0527",
      "author_url": "",
      "post_date": "04/18/2014 16:38:07",
      "content": "<p>My guess is this is due to corporate actions. I know there are quite a few food companies got acquired and spin-off-ed during the past two years, (Kraft, white plain??, etc). I probably will take a look at the time series of brand/company instances to verify my guess.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42346,
      "author_name": "rjrest",
      "author_url": "",
      "post_date": "04/18/2014 19:46:58",
      "content": "<p>This is the&nbsp;answer I received from the sponsor admin (who is not at their computer today):</p>\n\n<p style=\"padding-left: 30px\"><em>The combination of &#8220;category, brand, company&#8221; could be consider a unique key.</em></p>\n<p style=\"padding-left: 30px\"><em>Brands are unique to companies, but brands-company combinations can cross categories.</em></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42356,
      "author_name": "martin22",
      "author_url": "",
      "post_date": "04/18/2014 21:43:30",
      "content": "<p>[quote=Ramzi R;42346]</p>\n<p style=\"padding-left: 30px\"><em>Brands are unique to companies,&nbsp;...</em></p>\n<p>[/quote]</p>\n<p>I think we know this statement is&nbsp;false, right? Is there a problem with the data?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42557,
      "author_name": "jansan",
      "author_url": "",
      "post_date": "04/21/2014 00:07:06",
      "content": "<p>The sponsor admin's remark is in line with what Mike wrote before:</p>\n<p>[quote=Mike Demurtas;42142]</p>\n<p>We should consider category, brand, company as a key, so different brands for different companies can have the same code but they are actually different brands.</p>\n<p>[/quote]</p>\n\n<p>This is also supported by the observation that the brand occuring for the largest number of companies is brand '0', which occurs for 9150 companies (making other explanations like corporate actions very unlikely).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42563,
      "author_name": "zachmayer",
      "author_url": "",
      "post_date": "04/21/2014 01:48:15",
      "content": "<p>Are there similar duplicates of companies between categories? &nbsp;Or since companies can have brands in different categories, are all company IDs unique?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42622,
      "author_name": "dmdave",
      "author_url": "",
      "post_date": "04/21/2014 17:32:45",
      "content": "<p>Point of clarification:&nbsp; it is possible for brands to have more than 1 (one) company.&nbsp;</p>\n<p>The combination of &quot;category, brand, company&quot; can be considered a unique key.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 42626,
      "author_name": "zachmayer",
      "author_url": "",
      "post_date": "04/21/2014 18:18:27",
      "content": "<p>First of all, thank you for submitting your code. &nbsp;This submissions is better than anything I've been able to put together on my own, after many hours of work.</p>\n\n<p>Some questions:</p>\n<p>1. Why did you choose to use quantile regression? &nbsp;Isn't this problem a perfect fit for the logistic regression function in vowpal wabbit?</p>\n<p>2. Why 0.6 for the quantile tau? &nbsp;Did you try any other values, and if so, how did you decide if they were good or bad?</p>\n<p>3. Why 40 passes? &nbsp;Did you try any other values, and if so, how did you decide 40 was optimal?</p>\n<p>4. Why 0.85 for the learning rate?</p>\n<p>5. Are you worried at all about over-fitting? &nbsp;I noticed that the self-reported loss for VW was 0 for a very long time before the model stopped. &nbsp;Should you have stopped the model after some number of passes where the self-reported loss was still about zero?</p>\n<p>Questions 2-4 are basically the same question: how did you tune the model prior to submission, and how confident are you in your tuning?</p>\n\n<p>Thanks again for the code, you've helped me out immensely.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 43523,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "05/02/2014 18:32:43",
      "content": "<p>[quote=Zach;42626]</p>\n<p>Some questions:</p>\n<p>1. Why did you choose to use quantile regression? &nbsp;Isn't this problem a perfect fit for the logistic regression function in vowpal wabbit?</p>\n<p>[/quote]</p>\n<p>It probably is a good fit (if it is better, it very well could be: try it!). Langford says that for binary classification problems Vowpal Wabbit usually performs well using the --binary --loss_function logistic operator. This demands labels to be [-1,1] instead of [0,1]</p>\n<ul>\n<li><span style=\"line-height: 1.4\">If the problem is a binary classification problem your choices should be Logistic or hinge loss. Example: spam vs non-spam, odds of click vs no-click. (Q: when should hinge-loss be used vs logistic?)</span></li>\n</ul>\n<p><span style=\"line-height: 1.4\">But I am not actually doing classification. I am doing a regression between 0 and 1. This will skip the need to post-process the predictions (running through a sigmoid etc.). They already score good for AUC/ROC.</span></p>\n<ul>\n<li><span style=\"line-height: 1.4\">If the problem is a regression problem, meaning the target label you're trying to predict is a real value -- you should be using Squared or Quantile loss. I</span><span style=\"line-height: 1.4\">f OTOH you're trying to predict rank/order and you don't mind the mean error to increase as long as you get the relative order correct, you need to minimize the error vs the median (or any other quantile), in this case, you should use quantile-loss. See: http://en.wikipedia.org/wiki/Quantile_regression</span></li>\n</ul>\n<p><span style=\"line-height: 1.4\">[quote=Zach;42626]</span></p>\n<p>2. Why 0.6 for the quantile tau? &nbsp;Did you try any other values, and if so, how did you decide if they were good or bad?</p>\n<p>[/quote]</p>\n<p>I always try the standard 0.5 first. There are ways to find out which parameter is the best (its an obvious tweak when using quantile regression), but the easiest for me was just generating a submission with quantile tau 0.4 and 0.6 and see if it improves or decreases the score. You obviously would use local validation and performance evaluation for this if you were to do this properly.</p>\n<p>[quote=Zach;42626]</p>\n<p>3. Why 40 passes? &nbsp;Did you try any other values, and if so, how did you decide 40 was optimal?</p>\n<p>[/quote]</p>\n<p>This used to be based on a hunch more than anything (or I just did not know how to find out, I just tried 20 passes as the standard that just seems to work alright, <a href=\"http://fastml.com/go-non-linear-with-vowpal-wabbit/\">fastml confirms</a>). The newer version of Vowpal Wabbit has holdout features build-in. This means one in n samples is used to calculate the loss now (standard 1 in 10). Quantile regression seems to need fewer passes to converge to a good solution in general. With new holdout functionality Vowpal Wabbit will stop doing passes if it does not increase performance over the last n passes. So that is why Vowpal Wabbit 7.6 will increase the score on leaderboard. Maybe it only does 9 passes and finds that is optimal over 40 passes. This, you could say, is Vowpal Wabbit's build-in overfitting mechanism.</p>\n<p>[quote]</p>\n<p>4. Why 0.85 for the learning rate?</p>\n<p>[/quote]</p>\n<p>This caused a lower average loss. You can manually check parameters like these (--decay_learning_rate, --power_t, l). Usually you don't even need to fiddle with it (it can also mess up your results), but it can improve the score a bit. BTW: From&nbsp;https://raw.githubusercontent.com/wiki/gdfm/vowpal_wabbit/v5.1_tutorial.pdf &quot;for multiple passes --decay_learning_rate between [0.5-1] is sensible. Values&nbsp;smaller than&nbsp;1 protect against overfitting.&quot;</p>\n<p>[quote]</p>\n<p>5. Are you worried at all about over-fitting? &nbsp;I noticed that the self-reported loss for VW was 0 for a very long time before the model stopped. &nbsp;Should you have stopped the model after some number of passes where the self-reported loss was still about zero?</p>\n<p>[/quote]</p>\n<p>Not with Vowpal Wabbit and with this dataset. Especially not with the <a href=\"https://github.com/JohnLangford/vowpal_wabbit/wiki/Zhen.pdf\">new holdout functionality</a>. If you are really worried about over-fitting you could add l1 and l2 regularization with --l1 and --l2. And try&nbsp;ensemble learning to reduce fitting.</p>\n<p>[quote]</p>\n<p>Questions 2-4 are basically the same question: how did you tune the model prior to submission, and how confident are you in your tuning?</p>\n<p>[/quote]</p>\n<p>I check average loss and if the learning process looks ok: (average loss and since last decreasing). This is the quick way, because you don't need to set up a holdout set or do k-fold validation, average loss is a pretty decent indicator of leaderboard performance.&nbsp;</p>\n<p>Debug process from the 5.1 tutorial:</p>\n<ul>\n<li><span style=\"line-height: 1.4\">Is your progressive validation loss going down as you train? No =&gt; malordered examples or bad choice of parameter.</span></li>\n<li><span style=\"line-height: 1.4\">If you test on the train set, does it work? No =&gt; something crazy</span></li>\n<li><span style=\"line-height: 1.4\">Are the predictions sensible?&nbsp;</span></li>\n<li><span style=\"line-height: 1.4\">Do you see the right number of features coming up?</span></li>\n</ul>\n<p><span style=\"line-height: 1.4\">If you want more precise way: Create a holdout set or two from your train set. Evaluate AUC on the holdout set(s). Parameter tweak (i try bruteforce gridsearch or random search) according to this fitness factor.</span></p>\n<p>You can also employ PERF software to find good cutt-off and min_prediction and max_prediction I think, but I have not figured that out yet.&nbsp;</p>\n<p>I may even output in libsvm format so you can do most of this with sklearn or try other solvers like Sofia-ML.&nbsp;</p>\n<p>[quote]</p>\n<p>Thanks again for the code, you've helped me out immensely.</p>\n<p>[/quote]</p>\n<p>No problem! Happy competition!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 43657,
      "author_name": "breuker",
      "author_url": "",
      "post_date": "05/04/2014 09:03:23",
      "content": "<p>As for the choice of the loss function, I tried Triskelions features with all 4 loss functions implemented in Vowpal Wabbit. At first, I also thought logistic regression might be a better fit. Quantile regression scored highest on&nbsp;the leaderboard though.<br>What kind of problem we are solving is actually not that important afaik, at least in terms of the numbers you want to submit. You can create&nbsp;scores in any range, not just [0,1]. AUC can handle that.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44253,
      "author_name": "decipher",
      "author_url": "",
      "post_date": "05/08/2014 10:59:41",
      "content": "<p>Hi&nbsp;Triskelion,</p>\n<p>Many thanks for the detailed explanation. Really impressed with your knowledge.</p>\n<p>Being novice, i am participating in this contest and I am trying to create new features in SAS/R so just wanted to check if what I understood from these posts is correct or not. I think one should try to create new features like How many times person bought from a company/category on offer, what is the total amount amount transacted on company/category etc. Now my question is, are you guys suggesting that we should have this count of transactions/amount of transaction variables for each company present in the offers.csv i.e we should have <strong>no_of_trxn_comp1</strong>,&nbsp;<strong>no_of_trxn_comp2,&nbsp;no_of_trxn_comp3,&nbsp;no_of_trxn_comp4,&nbsp;no_of_trxn_comp5&nbsp;</strong>and so on for each company until <strong>comp18&nbsp;</strong>that we have in offers.csv (18 companies) and similarly for <strong>20 categories&nbsp;</strong> in offers.csv file. This way we will so many variables for company and categories. In total my question is that we need to create the variables for <strong>each company</strong>&nbsp;for whatever parameter (i.e amount, count etc.) we are creating.&nbsp;</p>\n<p>Anyone's help on this would be really appreciated. &nbsp;Thanks in advance.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44259,
      "author_name": "artghazaryan",
      "author_url": "",
      "post_date": "05/08/2014 14:24:32",
      "content": "<p>Hi Decipher</p>\n\n<p>Your thinking process is absolutely correct. That is a correct approach to extract intelligence and create variables. I have created 114 variables so far.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44273,
      "author_name": "npetitclerc",
      "author_url": "",
      "post_date": "05/08/2014 18:22:38",
      "content": "<p>@Decipher</p>\n<p>Well you do need to calculate all those, but in terms of features to train on you only use the variables for the specific offer.</p>\n<p>So if an offer is on company XX you would use the no_of_trxn_compXX variable as a feature. Hope this helps.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44396,
      "author_name": "potato",
      "author_url": "",
      "post_date": "05/12/2014 04:24:38",
      "content": "<p>Thanks for your sharing, it's a good start</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44410,
      "author_name": "user191111",
      "author_url": "",
      "post_date": "05/12/2014 16:07:34",
      "content": "<p>Did anyone use exactly the same features with logistic regression?</p>\n<p>My auc using logistic regression is only 0.53, I'm checking whether there is something wrong with my feature extraction process, or it's due to logistic regression.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44411,
      "author_name": "zachmayer",
      "author_url": "",
      "post_date": "05/12/2014 16:10:52",
      "content": "<p>[quote=&#36523;&#32463;&#30334;&#25112;&#38271;&#32773;;44410]</p>\n<p>Did anyone use exact the same features with logistic regression?</p>\n<p>My auc using logistic regression is only 0.53, I'm checking whether there is something wrong with my feature extraction process, or is due to logistic regression.</p>\n<p>[/quote]</p>\n\n<p>Yes. &nbsp;Logistic regression using vowpal wabbit is a fair bit worse than quantile regression using vowpal wabbit, and logistic regression using another tool seems to be even worse.</p>\n<p>Try quantile regression with your features and see what happens.</p>\n<p>There's already <a href=\"https://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7917/performance-of-logistic-regression-on-features-described-by-triskelion\">a discussion on this topic here</a>.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44412,
      "author_name": "user191111",
      "author_url": "",
      "post_date": "05/12/2014 16:16:20",
      "content": "<p>Thanks for reply</p>\n<p>Are there any tools in python or R for quantile regression? It seems that sklearn does not implement quantile regression</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44413,
      "author_name": "abhishek",
      "author_url": "",
      "post_date": "05/12/2014 16:17:21",
      "content": "<p>statsmodels</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44414,
      "author_name": "mathieucliche",
      "author_url": "",
      "post_date": "05/12/2014 16:18:47",
      "content": "<p>I'm actually using logistic regression with scikit-learn and roughly the same features, and for me it's working well, but you need to use some sort of regularization to avoid over-fitting.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44429,
      "author_name": "user191111",
      "author_url": "",
      "post_date": "05/13/2014 03:23:56",
      "content": "<p>But I'm still a little confused about applying a regression algorithm(like quantile regression) to a classification problem...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44441,
      "author_name": "decipher",
      "author_url": "",
      "post_date": "05/13/2014 08:22:00",
      "content": "<p>Can you please explain your feature extraction process?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44451,
      "author_name": "user191111",
      "author_url": "",
      "post_date": "05/13/2014 12:55:08",
      "content": "<p>It generate the features provided by&nbsp;Triskelion</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44479,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "05/13/2014 18:50:06",
      "content": "<p>@&#36523;&#32463;&#30334;&#25112;&#38271;&#32773;</p>\n<p>&gt; It seems that sklearn does not implement quantile regression.</p>\n<p>&gt; ... Confused about using regression for a classification problem.</p>\n<p>See:&nbsp;<a href=\"http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingRegressor.html\">sklearn.ensemble.GradientBoostingRegressor</a>&nbsp;which has quantile loss.</p>\n<p>You can treat a classification problem as a regression problem, if you regress between 0 (the negative class) and 1 (the positive class). I don't know if this is unorthodox, probably it is&nbsp;--&nbsp;It looks like standard sklearn in-memory logistic regression with these features (and some regularization) already&nbsp;outperforms this benchmark.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44513,
      "author_name": "user191111",
      "author_url": "",
      "post_date": "05/14/2014 10:14:32",
      "content": "<p>Hmm, but in a machine learning&nbsp;<a href=\"https://class.coursera.org/ml-005/lecture\">MOOC course</a>&nbsp; &nbsp;. When introducing logistic regression (the first video lecture of logistic regression), the professor showed how bad it is to apply OLS linear regression to a classification problem.</p>\n<p>So, I'm amazed that quantile regression can produce good result.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44562,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "05/14/2014 22:58:37",
      "content": "<p>@&#36523;&#32463;&#30334;&#25112;&#38271;&#32773;</p>\n<p><em>&gt;So, I'm amazed that quantile regression can produce good result.</em></p>\n<p>Try all, keep the best. Sometimes theoretical knowledge on what is possible or accepted practice can be a burden. Most of the time it is beneficial though. Don't be afraid to experiment or break some rules and you got the best of both worlds!</p>\n<p>See: <a href=\"http://www.kaggle.com/c/job-salary-prediction/forums/t/4208/congratulations-to-the-preliminary-winners?page=2#post22305\">Forum thread</a>&nbsp;and <a href=\"http://fastml.com/regression-as-classification/ \">FastML experiment</a>&nbsp;for an&nbsp;opposite example: someone using classification for a regression problem, and ending up in 3rd position.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44796,
      "author_name": "kontoudi",
      "author_url": "",
      "post_date": "05/18/2014 23:30:35",
      "content": "<p>@&#36523;&#32463;&#30334;&#25112;&#38271;&#32773;</p>\n<p>I am following the MOOC you are referring to. Here is how I see the problem.</p>\n<p>If I remember correctly the professor explained that linear regression is not good for classification because it is very sensitive to outliers. What linear regression is doing is to estimate the conditional mean so if you add a data point far away from the others this will greatly affect the value of the mean.</p>\n<p>According to <a href=\"http://en.wikipedia.org/wiki/Quantile_regression\">Wikipedia</a> quantile regression aims at estimating either the conditional median or other quantiles of the response variable. </p>\n<p>Now if your features are quite dense around e.g. the median then adding features far away will not affect a lot the value of the median.</p>\n<p>If anyone has a better understanding of this please share!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 47421,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 01:05:24",
      "content": "<p>Dear Triskelion and all friends,</p>\n<p>First, thanks for the provided code. Great job!</p>\n<p>I am new to Python and I just start this competition. &nbsp;Previously, I mostly work with R, Matlab and C. Today, I run&nbsp;your posted python code on&nbsp;https://github.com/MLWave/kaggle_acquire-valued-shoppers-challenge, but run into some errors.</p>\n<p>My environment is Python 3.4.1 IDLE ( p.s., what's your python programming environment for this posted Python code?). When I run your posted code, I run into two following errors:</p>\n<p>1) invalid syntax at line &quot;print e, reduced, datetime.now() - start&quot;. I then changed this line to &quot;print (e, reduced, datetime.now() - star)&quot;, and then it doesn't report error, but I am not quite sure whether this indeed solve the problem.</p>\n<p>2) &nbsp;after fixing the invalid syntax error, I run the code again, and it showed following error:</p>\n<p>Traceback (most recent call last):<br> File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_vw_features.py&quot;, line 231, in</p>\n<p>&lt;module&gt;&nbsp;reduce_data(loc_offers, loc_transactions, loc_reduced)</p>\n<p>File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_vw_features.py&quot;, line 41, in</p>\n<p>reduce_data &nbsp;outfile.write( line ) #print header</p>\n<p><strong>TypeError: 'str' does not support the buffer interface</strong></p>\n<p>I have no idea about how to fix this problem. Would you be so kind to give me some hint to solve this problem? Thanks so much!</p>\n<p>Besides, I did following things to run the python code. Correct me if I make some stupid mistakes.</p>\n<p>1) I install Python 3.4.1 IDLE in C disk.</p>\n<p>2) the python code and data files are located in D disk.</p>\n<p>3) I start the Python 3.4.1 IDLE, and use open option to open your python code, and use Run Modules option in the IDLE to run the python code, and I run into these two errors.</p>\n<p>Any help are pretty appreciated. Thanks!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 47422,
      "author_name": "sthompson",
      "author_url": "",
      "post_date": "06/01/2014 01:21:38",
      "content": "<p>Shize, there are two major versions of python, 3.x and 2.x. Try python 2.7. The different versions have quite different syntax.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 47423,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 01:29:08",
      "content": "<p>Hi Scott,</p>\n<p>Thanks for your reply. Besides, does Python 2.7 also have GUI IDLE programming environment? You see, I prefer the user-friendly GUI IDLE environment rather than a DOS-like terminal environment. Thanks, and have a great night!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 47424,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 02:08:22",
      "content": "<p>Dear Scott,</p>\n<p>I download Python 2.7.6 and install it on my laptop. Now the Python code works. Thanks so much, and have &nbsp;a great night!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48413,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 03:19:55",
      "content": "<p>Dear friends,</p>\n<p>I run into another problem when run the posted Python code of&nbsp;Triskelion in Python 2.7.</p>\n<p>Actually, when I run the code, it generate the reduce.csv correctly, but when it run the generat_features function, it throw out an error about date format. The error is as follows:</p>\n<p>Traceback (most recent call last):<br> File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_features_updated.py&quot;, line 232, in &lt;module&gt;</p>\n<p><br> generate_features(loc_train, loc_test, loc_reduced, loc_out_train, loc_out_test)<br> File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_features_updated.py&quot;, line 162, in generate_features</p>\n<p><br> date_diff_days = diff_days(row[6],history[-1])<br> File &quot;D:\\ML_DM Competition\\acquire_shopper_challenge\\gen_features_updated.py&quot;, line 57, in diff_days</p>\n<p><br> a = datetime.strptime(s1, date_format)<br> File &quot;C:\\Python27\\lib\\_strptime.py&quot;, line 325, in _strptime<br> (data_string, format))</p>\n<p><br><strong>ValueError: time data ''6/27/2013'' does not match format '%Y-%m-%d'</strong></p>\n<p>Trying to fix this error, I changed the line of Python code &quot;date_format = &quot;%Y-%m-%d&quot; &nbsp;to &quot;date_format = &quot;%m/%d/%Y&quot;, and run the Python code again.</p>\n<p>But this time I run into another date format error as follows:</p>\n<p><strong>ValueError: time data '2012-03-17' does not match format '%m/%d/%Y'</strong></p>\n<p>So it seems that there are more than one kind of date format in the data. I don't have any ideas to solve this problem. Would anyone be so kind to provide some hints? Thanks so much!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48416,
      "author_name": "neilsummers",
      "author_url": "",
      "post_date": "06/01/2014 04:03:04",
      "content": "<p>try:</p>\n<p>&nbsp; &nbsp; first date format</p>\n<p>except ValueError:</p>\n<p>&nbsp; &nbsp; second date format</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48417,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 04:07:48",
      "content": "<p>Dear Neil,</p>\n<p>Thanks!</p>\n\n<p>I am new to Python, and I am not quite sure how to code in Python about your suggestion of&nbsp;</p>\n<p>try:</p>\n<p>first date format</p>\n<p>except ValueError:</p>\n<p>second date format</p>\n\n<p>To be specific,&nbsp;how should I change the Python code? Thanks so much, and good night!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48418,
      "author_name": "neilsummers",
      "author_url": "",
      "post_date": "06/01/2014 04:23:47",
      "content": "<p>I suggest you read the python documentation on python handling of errors.</p>\n<p>https://docs.python.org/2/tutorial/errors.html</p>\n<p>What you can do is catch the exception and execute a different piece of code instead of throwing the exception.</p>\n<p>I have not looked at the code you are having trouble with but it appears you are getting the exception at the line</p>\n<p>a = datetime.strptime(s1, date_format)</p>\n<p>so you want to put the try/except clause around this, but you want to change the date_format when you catch the exception. date_format appears to be set in another part of the script, so you need to reset this after you catch the exception. I would set date_format within the try/except clause for clarity, so the code would look something like this (put the most common date format first).</p>\n<p>try:</p>\n<p>&nbsp;&nbsp;&nbsp; date_format = &quot;%Y-%m-%d</p>\n<p>&nbsp;&nbsp;&nbsp; a = datetime.strptime(s1, date_format)</p>\n<p>except ValueError:</p>\n<p>&nbsp;&nbsp;&nbsp; date_format = &quot;%m/%d/%Y&quot;</p>\n<p>&nbsp;&nbsp;&nbsp; a = datetime.strptime(s1, date_format)</p>\n\n<p>Edit: I now see that &quot;a&quot; is set within the one of the python modules. I cannot see all of your code, but you need to traceback to where in your code the exception is thrown and the date_format is set, and wrap the try/except clause around it there.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48419,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 04:33:18",
      "content": "<p>Dear Neil,</p>\n\n<p>Thanks for your suggestion. It works now. Good night!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48420,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 04:55:11",
      "content": "<p>Dear Friends,</p>\n<p>I use Python 2.7.6 and VM 7.6 (Latest version) to run&nbsp;Triskelion's Python code, but I got a leader board score of 0.59104 rather than 0.59410. And I found that there are a couple of other competitors also have &nbsp;such same score 0.59104.&nbsp;</p>\n\n<p>Does anyone has ideas about what might cause such difference? Thanks in advance.</p>\n\n<p>Good night!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48437,
      "author_name": "odessa",
      "author_url": "",
      "post_date": "06/01/2014 16:36:16",
      "content": "<p>[quote=Shize Su;48420]</p>\n<p>VM 7.6 (Latest version)&nbsp;</p>\n<p>[/quote]</p>\n<p>Use VW version 7.1</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48439,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 16:56:22",
      "content": "<p>Really?</p>\n<p>But Zach said that he used VW version 7.6 and got score of 0.59410. See the post at&nbsp;</p>\n<p>http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7908/0-59410</p>\n<p>Thanks!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48448,
      "author_name": "odessa",
      "author_url": "",
      "post_date": "06/01/2014 21:17:08",
      "content": "<p>Valid point! &nbsp;I tested my code on version 7.6 and only got 0.59104.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48450,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 21:43:29",
      "content": "<p>Hi friends,</p>\n<p>I download VW 7.1 and test the code again, but still got the same score 0.59104.&nbsp;</p>\n<p>Dear&nbsp;Odessa, are you sure that you run the code with VW 7.1 and got a score of 0.59410, while you run the same code with VW 7.6 and got a score of 0.59104? I thought there should be some other contributing factors for such difference.</p>\n\n<p>Thanks, and have a great day!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48451,
      "author_name": "odessa",
      "author_url": "",
      "post_date": "06/01/2014 22:00:53",
      "content": "<p>No, with VW 7.1 I got only&nbsp;0.59347, not 0.59410. I use 64 bit version of Cygwin for both.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48453,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 22:06:46",
      "content": "<p>Hi Odessa,</p>\n<p>I also use 64 bit version Cygwin for both, and I got score 0.59104 for both VW 7.1 and VW 7.6. &nbsp; &nbsp;I have no idea what might cause such difference....</p>\n<p>Anyway, thanks!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48454,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "06/01/2014 22:28:14",
      "content": "<p>[quote=Shize Su;48420]</p>\n<p>Does anyone has ideas about what might cause such difference? Thanks in advance.</p>\n<p>[/quote]</p>\n<p>The difference between Python 2.7 and 3.x should be in changing a few print statements.&nbsp;0.59410 is caused by newer version of Vowpal Wabbit (equal to using no passes in 7.1 version I think). Since 7.4 VW has holdout functionality and stops after doing 4 passes or so.</p>\n<p>Try running any version without&nbsp;doing any&nbsp;passes at all.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48457,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/01/2014 23:34:27",
      "content": "<p>Hi Triskelion,</p>\n<p>I tried VW 7.1 with no pass just now but got a score of 0.58717.</p>\n<p>As I said in my previous post, I actually once tried the latest version of VW, namely, VW 7.6, but got a score of 0.59104 rather than 0.59410. This is what make me confused, since Zach said that he used VW 7.6 and got a score of 0.59410.</p>\n<p>Any other thoughts?</p>\n\n<p>Thanks, and have a great day!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48473,
      "author_name": "zachmayer",
      "author_url": "",
      "post_date": "06/02/2014 13:21:57",
      "content": "<p>[quote=Shize Su;48439]</p>\n<p>Really?</p>\n<p>But Zach said that he used VW version 7.6 and got score of 0.59410. See the post at&nbsp;</p>\n<p>http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7908/0-59410</p>\n<p>Thanks!</p>\n<p>Best wishes,</p>\n<p>Shize</p>\n<p>[/quote]</p>\n\n<p>I'm pretty certain I was using 7.6. &nbsp;Did you run the code exactly as written, or did you make any changes?</p>\n\n<p>Try with both 7.1 and 7.6 and see what happens.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48476,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/02/2014 13:49:05",
      "content": "<p>I'm finding I need to change the learning rate significantly with recent VW builds, in order to get similar results results to a VW version pulled a couple weeks ago. &nbsp;My guess is folks following the tutorial with very recent builds are going to get very different results from those originally posted.</p>\n\n<p>More specifically, with recent builds I seem to get similar results with 0.5 as a learning rate, vice the original recommendation of 0.85. &nbsp;Unfortunately the loss function seems to be less of a reliable indicator with VW now exiting / converging much earlier than in previous versions.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48482,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/02/2014 14:39:54",
      "content": "<p>Hi Zach,&nbsp;</p>\n<p>I run the code exactly as written, except that I change the paths for the data files (e.g., I change&nbsp;loc_offers = &quot;data/offers.csv&quot; to &nbsp;loc_offers = &quot;offers.csv&quot;.)</p>\n\n<p>I don't think such change about the data file paths would cause any difference about the accuracy, so I am a bit&nbsp;confused about what might cause the difference.</p>\n\n<p>I do have tried both VW 7.1 and VW 7.6, and they gave me exactly same score 0.59104.</p>\n\n<p>Thanks, and have a great day!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48485,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/02/2014 14:46:50",
      "content": "<p>Hi Phil,</p>\n\n<p>I tried learning rate 0.5 with VW 7.6 just now, but it gave me a score of &nbsp;0.58984. What's the version of your VW?</p>\n<p>Thanks!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48486,
      "author_name": "abhishek",
      "author_url": "",
      "post_date": "06/02/2014 14:49:05",
      "content": "<p>0.59104 is also good. You might wanna improve on that.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48487,
      "author_name": "zachmayer",
      "author_url": "",
      "post_date": "06/02/2014 14:53:09",
      "content": "<p>[quote=Shize Su;48482]</p>\n<p>Hi Zach,&nbsp;</p>\n<p>I run the code exactly as written, except that I change the paths for the data files (e.g., I change&nbsp;loc_offers = &quot;data/offers.csv&quot; to &nbsp;loc_offers = &quot;offers.csv&quot;.)</p>\n<p>I don't think such change about the data file paths would cause any difference about the accuracy, so I am a bit&nbsp;confused about what might cause the difference.</p>\n<p>I do have tried both VW 7.1 and VW 7.6, and they gave me exactly same score 0.59104.</p>\n<p>Thanks, and have a great day!</p>\n<p>Best wishes,</p>\n<p>Shize</p>\n<p>[/quote]</p>\n\n<p>Interesting. &nbsp;For what it's worth, I'm on a mac. &nbsp;0.59104 is the score a lot of other people got with the earlier version of VW, and they may have been on windows.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48488,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/02/2014 14:55:30",
      "content": "<p>Hi Abhishek,</p>\n<p>I do agree that 0.59104 is good. And currently I don't care about the performance at all since I just start this competition. In fact,&nbsp; I am just curious about what might cause such difference, since everything seems to be pretty clear. &nbsp;It seems interesting for me!</p>\n<p>Thanks,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48489,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/02/2014 14:57:52",
      "content": "<p>Hi Zach,</p>\n<p>You're right, I do run the code on Windows. Both VW 7.1 and VW 7.6 gave me same score 0.59104. So based on this, maybe the difference between 0.59410 and 0.59104 is simply caused by Mac and Windows? Seems pretty interesting!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48490,
      "author_name": "abhishek",
      "author_url": "",
      "post_date": "06/02/2014 15:05:54",
      "content": "<p>I'm on a mac too and my score with VW in the begining was also 0.59410</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48494,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/02/2014 15:26:24",
      "content": "<p>[quote=Shize Su;48485]</p>\n<p>Hi Phil,</p>\n<p>I tried learning rate 0.5 with VW 7.6 just now, but it gave me a score of 0.58984. What's the version of your VW?</p>\n<p>Thanks!</p>\n<p>[/quote]</p>\n\n<p>I'm using 7.6.1. &nbsp;I'm also (mostly) on a Mac, although I'm using Windows and Linux builds as well.</p>\n<p>WRT to the score you got - yeah, I haven't quite matched my 7.6 results with 7.6.1. &nbsp;For now I'm using a 7.6 build for most of my VW work. &nbsp;0.85 doesn't give me good results in 7.6.1, so anyone using 7.6.1 may want to play with the learning rate a bit.</p>\n<p>I suppose my main point is that&nbsp;VW changes often. &nbsp;People following the (excellent) MLWave install tutorial for Windows are going to end up with brand new code which may or may not behave very differently.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48495,
      "author_name": "abhishek",
      "author_url": "",
      "post_date": "06/02/2014 15:27:55",
      "content": "<p>AFAIK, Triskelion is using Windows.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48499,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/02/2014 16:19:24",
      "content": "<p>Hi Abhishek,</p>\n\n<p>Thanks for your provided information. But maybe&nbsp;Triskelion run the code to get score of 0.59347 a couple of weeks ago, and the reason posted by Phil in this posting might cause the difference between my result of&nbsp;0.59104 and his result of 0.59347.</p>\n\n<p>And Phil, could you let me know your operation system (windows or mac?) and the version of VW you use? Thanks!</p>\n\n<p>Anyway, can anyone who uses Windows and VW 7.6 (or VW 7.1) verify that they run the same python code recently and get a score of 0.59410 (or 0.59347)?</p>\n\n<p>Thanks in advance.</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48514,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "06/02/2014 19:49:17",
      "content": "<p>It is possible that different builds of Vowpal Wabbit give slightly different results. As far as I see this is mostly irrelevant: focus on getting the best score for your build and features. The difference is small enough to be variance in public leaderboard. You can't say for sure which is better.</p>\n<p>The settings I gave were for a quick start, they are not the best settings possible.</p>\n<p>Vowpal Wabbit's hashing algorithm then also gives different results for little endian and big endian systems:&nbsp;https://github.com/JohnLangford/vowpal_wabbit/blob/master/vowpalwabbit/hash.cc</p>\n<p>For the record:</p>\n<p>7.1 64-bit Windows = ~0.59347</p>\n<p>7.6.1 64-bit Cygwin on Windows = ~0.59410</p>\n<p>@Shize Su, I don't know why you are getting&nbsp;0.59347 with 7.6.1, most are getting 0.59410&nbsp;with 7.6.1.</p>\n<p>I got my current score with 7.1 BTW using just small adjustments (mostly removing things I thought were fancy). I may share these when I optimize my current score some more (if I ever get time for this).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48515,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/02/2014 20:37:54",
      "content": "<p>Hi Triskelion,</p>\n<p>Thanks for your reply. Actually, I do agree with you that there is no significant difference between 0.59410 and 0.59104 at all. I was not caring about the score since I just start this competition; instead, I am just quite curious about what subtle reasons might cause such difference since everything seems to be that straight forward and clear for me.&nbsp;</p>\n<p>Anyway, if no one can give an precise answer for&nbsp;this issue, I will just forget about it and start to work on my progress.</p>\n<p>P.S.: Triskelion, to clarify, I got score of 0.59104 on both VW 7.6 and VW 7.1, not 0.59347. I use windows operation system.</p>\n<p>Thanks, and have a great day!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48516,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/02/2014 20:45:05",
      "content": "<p>Hmm, thanks. &nbsp;I got wildly different leaderboard scores between 7.6 and 7.6.1 (0.59990 vs 0.59033) on the same data / VW settings / machine, and had assumed it was due to changes made to the learning algorithm, hence my warning. &nbsp;However, if everybody else is getting very similar scores between versions I may need to dig deeper at some point and find out what's really going on. &nbsp;:-)</p>\n\n<p>Edit: I was able to reproduce it just now - my current high score 0.60393 (IIRC) set, when run against the latest VW, gets ~0.594 or so. &nbsp;Must be something I'm doing... but this one took place under sterile conditions, everything matched up correctly, so definitely not a one-off mistake. &nbsp;Odd.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48527,
      "author_name": "alexanderriggers",
      "author_url": "",
      "post_date": "06/02/2014 22:43:21",
      "content": "<p>Can somebody give me access to the reduced 1.6 GB file? I tried the Python script, but I always get a syntax error</p>\n\n<p>Kind regards,</p>\n<p>Alex</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48535,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/03/2014 00:07:20",
      "content": "<p>I may be able to provide a link to a reduced file if necessary, but it'd probably be best to get you up and running - the script is *really* useful! &nbsp;:-) &nbsp;What kind of syntax error are you getting?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48541,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/03/2014 01:18:42",
      "content": "<p>Hi&nbsp;Alexander,</p>\n<p>Are you using Python version 3.* to run the code?</p>\n<p>Try to use Python version 2.*, for example, python 2.7 to run the code as written (except changing the paths for the data files), and there should not be any syntax errors.</p>\n<p>I once use python 3.4 to run the code and came across the same syntax error problems, and then as suggested by Scott, I turned to python 2.7, and then there were no syntax errors.</p>\n<p>Hope this would be helpful.</p>\n<p>Have a great night!</p>\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48547,
      "author_name": "chitrasen",
      "author_url": "",
      "post_date": "06/03/2014 05:25:42",
      "content": "<p>While VW is used widely&nbsp;for this completion , I &nbsp;tried with&nbsp;my&nbsp;favorite scikit-learn. With few more features along with what is mentioned by&nbsp;Triskelion's benchmark code, I could fetch 0.59449 (little better than VW benchmark&nbsp;0.59410). I used RF without any tuning.&nbsp;I am hoping for better scores with tuning the params.</p>\n\n<p>My point is, one shouldn't stuck with VW version issues while there are alternate options to try out.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48549,
      "author_name": "dremovd",
      "author_url": "",
      "post_date": "06/03/2014 07:03:23",
      "content": "<p>I also tried these both, so I can say that it has close results, so we&nbsp;hope to use them both</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48555,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/03/2014 12:37:53",
      "content": "<p>[quote=Chitrasen;48547]</p>\n<p>While VW is used widely&nbsp;for this completion , I &nbsp;tried with&nbsp;my&nbsp;favorite scikit-learn. With few more features along with what is mentioned by&nbsp;Triskelion's benchmark code, I could fetch 0.59449 (little better than VW benchmark&nbsp;0.59410). I used RF without any tuning.&nbsp;I am hoping for better scores with tuning the params.</p>\n<p>My point is, one shouldn't stuck with VW version issues while there are alternate options to try out.</p>\n<p>[/quote]</p>\n<p>Agreed. &nbsp;Would you mind posting your early-benchmark sklearn code somewhere to help&nbsp;folks get started down that path? &nbsp;If it's really simple all the better.</p>\n<p>Edit: without the extra features, etc., of course. &nbsp;Not asking you to give anything away, just the sklearn boilerplate. &nbsp;:-)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48558,
      "author_name": "alexanderriggers",
      "author_url": "",
      "post_date": "06/03/2014 13:20:46",
      "content": "<p>Hi Phil, Hi Shize</p>\n\n<p>I use Python 2.7 but I am a beginner. I changed the code to my home directory, where I saved my&nbsp; csv.files:</p>\n<p><code>loc_offers = &quot;offers.csv&quot;<br>loc_transactions = &quot;transactions.csv&quot;<br>loc_reduced = &quot;reduced2.csv&quot; # will be created</code></p>\n<p>But after copy and paste the first line of code I get a syntax error:</p>\n<p><code>def&nbsp;reduce_data(loc_offers, loc_transactions, loc_reduced):</code><code>&nbsp; start = datetime.now()<br>&nbsp; #get all categories on offer in a dict<br>&nbsp; offers = {}<br>&nbsp; for e, line in enumerate( open(loc_offers) ):<br>&nbsp; &nbsp; offers[ line.split(&quot;,&quot;)[1] ] = 1</code></p>\n<p>Actually I need the 1.6GB csv for a test if I can read 1.6 GB file from S3 to Graphlabb Create:</p>\n<p>http://forum.graphlab.com/discussion/251/s3-sframe-read-problems</p>\n<p>Kind regards,</p>\n<p>Alex</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48561,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/03/2014 14:07:14",
      "content": "<p>If you're doing this in&nbsp;the python console you might be better served by running the whole file all at once:</p>\n<p>run &quot;gen_vw_features.py&quot;</p>\n<p>Also, if you're not going to provide specific paths, make sure you're running python / ipython from the directory where the data files reside, or set the working directory in some other way.</p>\n\n<p>Lastly, here's a link to the reduced csv:</p>\n<p>https://dl.dropboxusercontent.com/u/12189505/reduced.csv.zip</p>\n\n<p>If anyone decides to put it somewhere more performant, let me know and I'll take the link down. &nbsp;:-)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48595,
      "author_name": "chitrasen",
      "author_url": "",
      "post_date": "06/04/2014 05:22:07",
      "content": "<p>[quote=Phil Culliton;48555]</p>\n\n<p>Agreed. &nbsp;Would you mind posting your early-benchmark sklearn code somewhere to help&nbsp;folks get started down that path? &nbsp;If it's really simple all the better.</p>\n<p>Edit: without the extra features, etc., of course. &nbsp;Not asking you to give anything away, just the sklearn boilerplate. &nbsp;:-)</p>\n<p>[/quote]</p>\n\n<p>Here is my skeleton code using Pandas and scikit-learn.</p>\n<p>Note: My original features have been removed from the code. Code is extracted from my ipython notebook, hence may not be in proper python coding standard. I am sorry for that.</p>\n\n\n\n<p>I also added the code to <a href=\"http://chitcode.wordpress.com/2014/06/04/python-skeleton-code-for-kaggle-acquire-valued-shoppers-challenge/\" target=\"_blank\">my blog</a>.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48615,
      "author_name": "rzykov",
      "author_url": "",
      "post_date": "06/04/2014 11:39:05",
      "content": "<p>Chitrasen, thank you for code sharing. Did you do&nbsp;a cross validation via sklearn?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48616,
      "author_name": "chitrasen",
      "author_url": "",
      "post_date": "06/04/2014 11:51:40",
      "content": "<p>[quote=rzykov;48615]</p>\n<p>Chitrasen, thank you for code sharing. Did you do&nbsp;a cross validation via sklearn?</p>\n<p>[/quote]</p>\n\n<p>Yes, I did some CV testing, but seems test and train data distributions are either different, or there seems some pattern I am missing to account into. I am getting similar results as mentioned in <a href=\"https://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/7845/cross-validation-fails-to-evaluate-the-model\" target=\"_blank\">this thread</a>.</p>\n\n<p>I was getting 4 fold CV score of 0.68XXX with the sample code, I provided. (my current CV score improved to 0.715).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48617,
      "author_name": "rzykov",
      "author_url": "",
      "post_date": "06/04/2014 12:05:09",
      "content": "<p>I do a cross validation over all offers. It is like K-fold CV where each fold is a an offer.</p>\n<p>Then calculate mean of CV's errors. It's very close to my test results.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48623,
      "author_name": "paulomagalhaes",
      "author_url": "",
      "post_date": "06/04/2014 12:49:27",
      "content": "<p>I just wanted to leave my contribution to this great, collaborative, thread.</p>\n<p>I used the whole 22Gb transaction data and ran svm + logistic regression with the features as suggested by&nbsp;Triskelion. The result was a 0.59735 score. Running the same set up with the reduced data set produced a 0.58627 score. Therefore, in this case,&nbsp;using more data improved the score by 0.01 .&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48630,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "06/04/2014 14:11:30",
      "content": "<p>[quote=Chitrasen;48595]</p>\n<p>Here is my skeleton code using Pandas and scikit-learn.</p>\n<p>[/quote]</p>\n<p>What score does this give on public leaderboard?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48632,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "06/04/2014 15:02:25",
      "content": "<p>[quote=Paulo;48623]</p>\n<p>I just wanted to leave my contribution to this great, collaborative, thread.</p>\n<p>I used the whole 22Gb transaction data and ran svm + logistic regression with the features as suggested by&nbsp;Triskelion. The result was a 0.59735 score. Running the same set up with the reduced data set produced a 0.58627 score. Therefore, in this case,&nbsp;using more data improved the score by 0.01 .&nbsp;</p>\n<p>[/quote]</p>\n<p>Cool, this is a useful tip. I wonder why this gives so much of a difference though. Maybe the features that hold &quot;total amount spend&quot; become more indicative?</p>\n\n<p>I'll try these with my new settings and report back if it improves. I finally got a little time to optimize my current near-leaderboard score and try out some new features.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48669,
      "author_name": "chitrasen",
      "author_url": "",
      "post_date": "06/04/2014 22:41:06",
      "content": "<p>[quote=Triskelion;48630]</p>\n<p>[quote=Chitrasen;48595]</p>\n<p>Here is my skeleton code using Pandas and scikit-learn.</p>\n<p>[/quote]</p>\n<p>What score does this give on public leaderboard?</p>\n<p>[/quote]</p>\n\n<p>The additional features&nbsp;like 'median price' and 'median amount' and some others worked better.&nbsp;My initial score with those features and the skeleton code, was&nbsp;0.59449 on&nbsp;leaderboard.</p>\n<p>My current&nbsp;leaderboard score(0.60343) uses some more features and tuning of RF params.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48696,
      "author_name": "mike64",
      "author_url": "",
      "post_date": "06/05/2014 09:20:46",
      "content": "<p>Only one question,</p>\n\n<p>how well the model classifies among repeaters (t) ?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48710,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/05/2014 12:21:09",
      "content": "<p>Hmm. &nbsp;I tried your code (exactly as-is, with no changes), Chitrasen, and got a submission error regarding the ids - they were float64 and the submission code wanted them not to be. &nbsp;I switched them to int64, and got a leaderboard score of 0.54190. &nbsp;Wonder what's going on there?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48716,
      "author_name": "selfishgene",
      "author_url": "",
      "post_date": "06/05/2014 13:24:45",
      "content": "<p>I think 0.54190 is OK for this code, it only has features that include only category and company information.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48721,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/05/2014 14:08:29",
      "content": "<p>[quote=Selfish Gene;48716]</p>\n<p>I think 0.54190 is OK for this code, it only has features that include only category and company information.</p>\n<p>[/quote]</p>\n<p>True, but I figured I'd ask to make sure! &nbsp;Since newcomers might be using this code, I thought it would be useful to know what the approximate leaderboard score might be, and wanted to double-check my result. &nbsp;Also, to report the id bug. &nbsp;:-)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48747,
      "author_name": "nhc191735",
      "author_url": "",
      "post_date": "06/06/2014 02:34:43",
      "content": "<p>I face this errors...</p>\n<p>Can anyone help me &quot;how to solve this problem?&quot;</p>\n<p>ValueError: time data '1' does not match format '%Y-%m-%d'</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48755,
      "author_name": "neikusc",
      "author_url": "",
      "post_date": "06/06/2014 06:26:36",
      "content": "<p>[quote=Chitrasen;48669]<br>The additional features like 'median price' and 'median amount' and some others worked better. My initial score with those features and the skeleton code, was 0.59449 on leaderboard.<br>My current leaderboard score(0.60343) uses some more features and tuning of RF params.<br>[/quote]</p>\n<p>Hi Chitrasen, I used RF model with 5-fold CV on my training set and got score 0.675xx. But when I applied the same model on my test set, my prediction was just like random, score 0.49476. Did you see any similar thing? Do you have any suggestions? Thanks!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48758,
      "author_name": "chitrasen",
      "author_url": "",
      "post_date": "06/06/2014 07:01:27",
      "content": "<p>[quote=Kien Trinh;48755]</p>\n<p>Hi CHi Chitrasen, I used RF model with 5-fold CV on my training set and got score 0.675xx. But when I applied the same model on my test set, my prediction was just like random, score 0.49476. Did you see any similar thing? Do you have any suggestions? Thanks!</p>\n<p>[/quote]</p>\n<p>I am also struggling to get a reliable CV testing technique :(</p>\n<p>Yes,I see the similar effect as you are getting. To put time effect on CV, I sort the training data with offerdate and then apply K-Fold CV. The CV scores vary from 0.58 to 0.68 and on the leader board it scored 0.572 ( I have used some of my features, not the features mentioned in my previous post on skeleton code).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48763,
      "author_name": "dremovd",
      "author_url": "",
      "post_date": "06/06/2014 08:59:34",
      "content": "<p>rzykov mentioned very good idea: to train on some offers and to test on others, for those who struggling&nbsp;to get a reliable CV technique it's worth trying. It should be better for sure then any standard CV.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48773,
      "author_name": "mike64",
      "author_url": "",
      "post_date": "06/06/2014 12:45:17",
      "content": "<p>Christansen,</p>\n\n<p>only a very specific question that nobody answers me and it's very easy:</p>\n\n<p>there are 43.438 customers who repeated. Well, of these 43.438 customers, how you classify correctly?</p>\n\n<p>Kind regards</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48807,
      "author_name": "neikusc",
      "author_url": "",
      "post_date": "06/06/2014 21:00:40",
      "content": "<p>[quote=mike;48773]</p>\n<p>Christansen,</p>\n<p>only a very specific question that nobody answers me and it's very easy:</p>\n<p>there are 43.438 customers who repeated. Well, of these 43.438 customers, how you classify correctly?</p>\n<p>Kind regards</p>\n<p>[/quote]</p>\n<p>Mike - you are doing binary classification {0 or 1}. There are 43438&nbsp;outcomes { 1 } on training set. You are predicting the probability a shopper will be come a loyal customer { 1 } on test set. You submission file is a list of probability in a range [0,1]. I hope I answer your question. Best!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48853,
      "author_name": "ejlok1",
      "author_url": "",
      "post_date": "06/08/2014 02:29:11",
      "content": "<p>[quote=nhc;48747]</p>\n<p>I face this errors...</p>\n<p>Can anyone help me &quot;how to solve this problem?&quot;</p>\n<p>ValueError: time data '1' does not match format '%Y-%m-%d'</p>\n<p>[/quote]</p>\n\n<p>Can you elaborate abit more about the error? I'm going to take a stab here and say that its because the test and train history data has different date format. You'll have to treat them both seperately</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48857,
      "author_name": "nhc191735",
      "author_url": "",
      "post_date": "06/08/2014 10:49:40",
      "content": "<p>thank you Eu Jin Lok!!! I find the problem on my trainHistory Data!!! I make a mistake to check only transaction data...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48864,
      "author_name": "mike64",
      "author_url": "",
      "post_date": "06/08/2014 16:47:25",
      "content": "<p>thanks for you answer.</p>\n<p>I clearly explain bad, my question is: if we consider a probability above 0.5 as&nbsp;repeater,&nbsp;then, how well&nbsp;your model classifies&nbsp;?</p>\n\n<p>bye&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48872,
      "author_name": "omalleyt",
      "author_url": "",
      "post_date": "06/08/2014 20:28:47",
      "content": "<p>Just a note on this program, as I tried it out the other day (and it's a great and I've learned a lot. Thank you to the submitter!) There are some customers in trainhistory and testhistory who have no data, and from what I can tell they don't end up in the training set or more importantly the prediction set (there are less total rows than in the original trainhistory+testhistory). I don't know how kaggle handles this.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48875,
      "author_name": "neikusc",
      "author_url": "",
      "post_date": "06/08/2014 21:20:38",
      "content": "<p>[quote=Thomas O'Malley;48872]</p>\n<p>Just a note on this program, as I tried it out the other day (and it's a great and I've learned a lot. Thank you to the submitter!) There are some customers in trainhistory and testhistory who have no data, and from what I can tell they don't end up in the training set or more importantly the prediction set (there are less total rows than in the original trainhistory+testhistory). I don't know how kaggle handles this.</p>\n<p>[/quote]</p>\n<p>If you use transactions.csv file, the number of shoppers is exactly equal to the number of shoppers in two files: trainHistory.csv and testHistory.csv.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48883,
      "author_name": "namesj",
      "author_url": "",
      "post_date": "06/09/2014 06:20:46",
      "content": "<p>You can beat the &quot;prior category benchmark&quot; without even using the transaction file.</p>\n<p>Just a logistic fit on trainhistory &nbsp;based on &nbsp;variables suggested by varImpPlot() &nbsp;on randomForest &nbsp;model. &nbsp; :-)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48886,
      "author_name": "namesj",
      "author_url": "",
      "post_date": "06/09/2014 07:19:05",
      "content": "<p>for offerdate &nbsp;, Changing factor to 'as.Date' worked for me &nbsp; .</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48895,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "06/09/2014 12:07:51",
      "content": "<p>[quote=Thomas O'Malley;48872]</p>\n<p>Just a note on this program, as I tried it out the other day (and it's a great and I've learned a lot. Thank you to the submitter!) There are some customers in trainhistory and testhistory who have no data, and from what I can tell they don't end up in the training set or more importantly the prediction set (there are less total rows than in the original trainhistory+testhistory). I don't know how kaggle handles this.</p>\n<p>[/quote]</p>\n<p>I handled this in the benchmark by predicting a 0 for these customers. Kaggle submissions need all the entries from the original test set, else it will throw a warning.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48896,
      "author_name": "dremovd",
      "author_url": "",
      "post_date": "06/09/2014 12:10:48",
      "content": "<p>I think&nbsp;Kien is right.</p>\n<p>There are exactly same users in raw transactions as in train + test. So, there are no users that have no data unless you didn't filter transactions first.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 48996,
      "author_name": "peemblis",
      "author_url": "",
      "post_date": "06/11/2014 13:05:39",
      "content": "<p>[quote=Shize Su;48489]</p>\n<p>Hi Zach,</p>\n<p>You're right, I do run the code on Windows. Both VW 7.1 and VW 7.6 gave me same score 0.59104. So based on this, maybe the difference between 0.59410 and 0.59104 is simply caused by Mac and Windows? Seems pretty interesting!</p>\n<p>Best wishes,</p>\n<p>Shize</p>\n<p>[/quote]</p>\n\n<p>Hi Shize Su, I ran Triskelion's method&nbsp;a couple&nbsp;nights ago&nbsp;with&nbsp;VW 7.6 on&nbsp;Windows.&nbsp;I got the same score (0.59104 ) as you.</p>\n\n<p>Triskelion, thank you very much for sharing the&nbsp;details of your&nbsp;method.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49006,
      "author_name": "alexanderriggers",
      "author_url": "",
      "post_date": "06/11/2014 16:09:37",
      "content": "<p>Hi guys</p>\n<p>Do you think its possible to run Trischlikons model on a GraphLab Create EC2 instance:<a href=\"http://graphlab.com/products/create/docs/generated/graphlab.vowpal_wabbit.create.html#graphlab.vowpal_wabbit.create\" target=\"_blank\">&nbsp;</a></p>\n<p><a href=\"http://graphlab.com/products/create/docs/generated/graphlab.vowpal_wabbit.create.html#graphlab.vowpal_wabbit.create\" target=\"_blank\">http://graphlab.com/products/create/docs/generated/graphlab.vowpal_wabbit.create.html#graphlab.vowpal_wabbit.create</a></p>\n<p>I am not quite sure how to transmit the the features from Python to this EC2 instance, but it could be an advantage for the full 20 GB file.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49053,
      "author_name": "dansterba",
      "author_url": "",
      "post_date": "06/12/2014 13:43:11",
      "content": "<p>Hi All -</p>\n\n<p>I've been using R to try and replicate the results that you all have received with Python and VW. Logistic regression using the Lasso method only got me up to .57 with the engineered features, so I wanted to try quantile regression, but&nbsp;am having a hard time figuring out how to run the same kind of quantile regression in R.</p>\n\n<p>The most promising package seemed to be 'quantreg', but I've gotten errors with it every time</p>\n\n<p>When running:&nbsp;rq(data=tempTR,as.formula(x),tau=.6) &nbsp; where tempTR is my data.frame with engineered values and 'x' is the text version of my formula, I get the following error</p>\n<p>*&nbsp;Error in rq.fit.br(x, y, tau = tau, ...) : Singular design matrix</p>\n\n<p>I've also attempted to try other&nbsp;models that looked promising in the 'quantreg' package, such as 'rqProcess': which in the R-help documentation, says: &quot;Computes a standardize quantile regression process for the model specified by the formula, on the partition of [0,1] specified by the taus argument, and standardized according to the argument nullH. Intended for use in&nbsp;KhmaladzeTest.</p>\n\n<p>rqProcess(as.formula(x),data=tempTR,taus=c(.5))</p>\n\n<p>The problem with this one is it requires I specify a range of 'equally spaced taus' , when I do this:</p>\n\n<p>rqProcess(as.formula(x),data=tempTR,taus=c(.2,.4,.6,.8))</p>\n\n<p>I get an error saying 'singular design matrix' again.</p>\n\n<p>Can anyone advise?</p>\n\n<p>My formula is below, and through troubleshooting, I've just narrowed it down to the metrics posted earlier on this thread:</p>\n\n<p>&quot;repeater ~ I(last_600_count_brand == 0) + I(last_600_count_brand &gt; 0 &amp; last_600_count_company &gt; 0 &amp; last_600_count_category &gt;0) + I(last_60_count_brand &gt; 0) + I(last_600_count_brand &gt; 0 &amp; last_600_count_company &gt; 0) + I(last_30_count_brand &gt; 0) + I(last_600_count_brand &gt; 0 &amp; last_600_count_category &gt; 0) + I(last_600_count_brand &gt; 0) + last_30_monVal_brand + I(last_90_count_brand &gt; 0) + last_60_monVal_brand + I(last_60_count_company &gt; 0) + last_90_monVal_brand + last_60_q_company + I(last_600_count_category == 0) + last_600_q_brand + last_180_monVal_brand + I(last_180_count_brand &gt; 0) + offervalue + last_30_q_category&quot;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49082,
      "author_name": "sthompson",
      "author_url": "",
      "post_date": "06/13/2014 03:44:08",
      "content": "<p>ddunder: Having never worked with the quantreg package I can only hazard some guesses.</p>\n\n<p>Based on the message returned by R, I'd guess that quantreg has a matrix inversion in it somewhere and the programmers have set the code to detect linear dependence in the design matrix (nice to see some defensive programming). I would reproduce the design matrix (in R: design.matrix) and then check for linear dependence. Given the formula indicated, I'd look for equal columns in the matrix.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49126,
      "author_name": "spimenov",
      "author_url": "",
      "post_date": "06/13/2014 20:34:05",
      "content": "<p>quantreg works for me... not great;I got only 0.58364:</p>\n\n<p><code>cols &lt;- c(&quot;V167&quot;, ...)<br>dt &lt;- data.frame(train[,cols])<br>dt$y &lt;- idy$repeattrips<br>model &lt;- rq(y~., data=dt, method='fn', tau=0.5)<br>submit$repeatProbability &lt;- predict(model, test[,cols])<br></code></p>\n\n<p>Yes, the feature selection (10 of 350) was done first; the CV (10 folds) was 6.02...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49257,
      "author_name": "alexanderriggers",
      "author_url": "",
      "post_date": "06/17/2014 16:49:30",
      "content": "<p>Thank you, but when I try to run the&nbsp;gen_vw_features.py file I get:</p>\n<p><code><em>Alexanders-iMac:~ arigge$ python gen_vw_features.py</em><br><em> File &quot;gen_vw_features.py&quot;, line 6</em><br><em> &lt;!DOCTYPE html&gt;</em><br><em> ^</em><br><em>SyntaxError: invalid syntax</em><br><br></code></p>\n<p>I placed all my csv files in a folder called data in my home directory arigge. Can somebody tell me what I am missing ?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49259,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/17/2014 18:20:43",
      "content": "<p>Hi Alexander,</p>\n\n<p>Are you using Python 2.7 or Python 3.*?</p>\n<p>~</p>\n<p>To run the posted code by&nbsp;Triskelion, you need to use Python 2.7 version rather than 3.* version. They have quite different syntax.</p>\n<p>~</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49260,
      "author_name": "alexanderriggers",
      "author_url": "",
      "post_date": "06/17/2014 19:18:51",
      "content": "<p>Thank you Shize.</p>\n\n<p>I use Python 2.7 which runs on Mac by default.</p>\n\n<p>Best,</p>\n<p>Alex&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49261,
      "author_name": "sushize",
      "author_url": "",
      "post_date": "06/17/2014 19:50:08",
      "content": "<p>Hi&nbsp;Alexander,</p>\n\n<p>Uh, interesting.</p>\n<p>~</p>\n<p>For me, I just download the code, change the location for data files, and run it with Python 2.7 on windows, and then everything works.</p>\n<p>~</p>\n<p>Besides, are you sure that the only change&nbsp;you made to the Python code is just the data file locations? If yes, then I don't know why it doesn't work on your computer. Maybe you could &nbsp;try to run the same code on another computer and see what happens. It seems to me that there is no reason why it will not work.</p>\n<p>~</p>\n<p>Have a great day!</p>\n\n<p>Best wishes,</p>\n<p>Shize</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49268,
      "author_name": "nthanhtam",
      "author_url": "",
      "post_date": "06/18/2014 03:55:51",
      "content": "<p>Hi Alex,</p>\n<p>I am also using Mac and Python 2.7 without any problem.</p>\n\n<p>Best,</p>\n<p>Tam</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49269,
      "author_name": "",
      "author_url": "",
      "post_date": "06/18/2014 04:33:46",
      "content": "<p>Is it important to normalize/standardize the data, since vw seems to be some sort of gradient-based algorithm (plz correct me if I'm wrong)??</p>\n\n<p>Triskelion, thanks a million for sharing your solution and introducing us to the powers of vw.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49286,
      "author_name": "rohits",
      "author_url": "",
      "post_date": "06/19/2014 03:12:17",
      "content": "<p>Check for whitespace. Make sure you don't have any stray spaces on empty lines. Especially line 6.</p>\n\n<p>[quote=Alexander Riggers;49257]</p>\n<p>Thank you, but when I try to run the&nbsp;gen_vw_features.py file I get:</p>\n<p><code><em>Alexanders-iMac:~ arigge$ python gen_vw_features.py</em><br><em> File &quot;gen_vw_features.py&quot;, line 6</em><br><em> &lt;!DOCTYPE html&gt;</em><br><em> ^</em><br><em>SyntaxError: invalid syntax</em><br><br></code></p>\n<p>I placed all my csv files in a folder called data in my home directory arigge. Can somebody tell me what I am missing ?</p>\n<p>[/quote]</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49292,
      "author_name": "",
      "author_url": "",
      "post_date": "06/19/2014 07:57:07",
      "content": "<p>May I ask what the &quot;average loss&quot; and &quot;since last&quot; columns converged to towards the end? I've had cases where the predictions are quite different but those 2 columns gave similar results during training. Then how does one tell which one is better?</p>\n\n<p>Many thanks in advance!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49293,
      "author_name": "",
      "author_url": "",
      "post_date": "06/19/2014 08:02:58",
      "content": "<p>Sorry another question: are the Y's used here repeater (i.e. 0s and 1s) or number of repeats?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49304,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "06/19/2014 15:06:04",
      "content": "<p>Wanted to note two things quickly:</p>\n<p>1) Namespaces! &nbsp;They're a great feature of Vowpal Wabbit. &nbsp;I use them to quickly test features - just put each new feature / feature class into its own namespace, then turn them on and off at the vw command line (using --keep or --ignore) rather than rebuilding the train/test files for each possible combination of features. &nbsp;Other folks are probably already doing this, but I wanted to throw it out there.</p>\n\n\n<p>2) If using namespaces, be aware that unless specified, testing (with -t) will use ALL namespaces, and could change your results slightly.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 49999,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "07/03/2014 16:01:40",
      "content": "<p>By the way - Triskelion, I tried to get in touch with you via your website a few weeks ago about VW. &nbsp;I'm guessing it didn't go through, and I'm still too much of a Kaggle newbie to be able to email other users, so if you'd like to, please feel free to email me. &nbsp;:-)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50002,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "07/03/2014 17:51:21",
      "content": "<p>[quote=Phil Culliton;49999]</p>\n<p>By the way - Triskelion, I tried to get in touch with you via your website a few weeks ago about VW. &nbsp;I'm guessing it didn't go through, and I'm still too much of a Kaggle newbie to be able to email other users, so if you'd like to, please feel free to email me. &nbsp;:-)</p>\n<p>[/quote]</p>\n<p>Whoops, yeah that manual checking of spam vs. ham comments took more time then I expected. Sorry for that, I'll go through the existing queue and install Akismet or something so this won't happen again.</p>\n\n<p>I think you can email other users by clicking their profile and then &quot;contact&quot;, but maybe you have to be Kaggler for that first. I send you an email over the Kaggle comment system.</p>\n\n<p>Thank you for all your comments, here and elsewhere, and helping everyone out!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50004,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "07/03/2014 18:27:16",
      "content": "<p>[quote=Triskelion;50002]</p>\n<p>Whoops, yeah that manual checking of spam vs. ham comments took more time then I expected. Sorry for that, I'll go through the existing queue and install Akismet or something so this won't happen again.</p>\n<p>[/quote]</p>\n\n<p>No worries at all, that sort of stuff can creep up on you.</p>\n\n<p>[quote=Triskelion;50002]</p>\n<p>I think you can email other users by clicking their profile and then &quot;contact&quot;, but maybe you have to be Kaggler for that first. I send you an email over the Kaggle comment system.</p>\n<p>[/quote]</p>\n\n<p>I'm a Kaggler, but I apparently need more points to be able to contact others. &nbsp;Thanks for the email!</p>\n\n<p>[quote=Triskelion;50002]</p>\n<p>Thank you for all your comments, here and elsewhere, and helping everyone out!</p>\n<p>[/quote]</p>\n\n<p>Just taking an example from you, really! &nbsp;And from many&nbsp;of the other generous folks here. &nbsp;I've been really impressed&nbsp;by all of the people stepping forward to&nbsp;help folks figure out the basics. &nbsp;I'd love to help even more myself, if possible.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50011,
      "author_name": "benjaminpost",
      "author_url": "",
      "post_date": "07/03/2014 23:00:58",
      "content": "<p>[quote=Peemblis;48996]</p>\n<p>[quote=Shize Su;48489]</p>\n<p>Hi Zach,</p>\n<p>You're right, I do run the code on Windows. Both VW 7.1 and VW 7.6 gave me same score 0.59104. So based on this, maybe the difference between 0.59410 and 0.59104 is simply caused by Mac and Windows? Seems pretty interesting!</p>\n<p>Best wishes,</p>\n<p>Shize</p>\n<p>[/quote]</p>\n<p>Hi Shize Su, I ran Triskelion's method&nbsp;a couple&nbsp;nights ago&nbsp;with&nbsp;VW 7.6 on&nbsp;Windows.&nbsp;I got the same score (0.59104 ) as you.</p>\n<p>Triskelion, thank you very much for sharing the&nbsp;details of your&nbsp;method.</p>\n<p>[/quote]</p>\n<p>Out of curiosity, do you find you have probability scores that have a truncated decimal string (such as random forest in R)? I have not looked at VW so I am not familiar with the output but when using randomforest in R, I believe it truncates to 3 or 4 decimal places giving many records the same score (especially when using many binary features). A simple change in order upon submission can throw off the final score, even when running the identical model but with a different ordering of input records on each iteration.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50056,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "07/04/2014 23:10:20",
      "content": "<p>[quote=Ben Post;50011]</p>\n<p>Out of curiosity, do you find you have probability scores that have a truncated decimal string (such as random forest in R)?</p>\n<p>[/quote]</p>\n<p>It's likely that they use the same script to convert a VW predictions file to a Kaggle submission.</p>\n<p>.</p>\n<p>It seems that VW can produce different results depending on&nbsp;your&nbsp;CPU type. VW is&nbsp;compiled with <a href=\"https://gcc.gnu.org/wiki/FloatingPointMath\">ffast-math</a>&nbsp;flag, which is&nbsp;the least conforming but fastest math mode.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50058,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "07/05/2014 02:37:42",
      "content": "<p>[quote=Triskelion;50056]</p>\n<p>It seems that VW can produce different results depending on&nbsp;your&nbsp;CPU type. VW is&nbsp;compiled with <a href=\"https://gcc.gnu.org/wiki/FloatingPointMath\">ffast-math</a>&nbsp;flag, which is&nbsp;the least conforming but fastest math mode.</p>\n<p>[/quote]</p>\n<p>And compiler type! &nbsp;Every compiler plays with math-heavy code differently, and interprets things like fast-math differently. &nbsp;I&nbsp;wouldn't be&nbsp;at all surprised to find that VW compiled with GCC would behave slightly differently than with, say, Intel or MSVCPP.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50090,
      "author_name": "pengyan",
      "author_url": "",
      "post_date": "07/07/2014 04:05:53",
      "content": "<p>i got 0.59474 by Triskelion's feature and vw command line. when i tried to add some features , i got worse scores and curiously found many predict results were zero. after tuned vw parameter lambda&#65292;nothing changed. &nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50210,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "07/09/2014 15:55:19",
      "content": "<p>What features did you try to add? &nbsp;And what changes did you make to VW parameters? &nbsp;I've found that Triskelion's initial settings are actually a pretty darned good fit.</p>\n\n<p>Also - when did you grab your Vowpal Wabbit build? &nbsp;Did you pull straight from github? &nbsp;There are some recent bugs, I think - some nasty issues with not properly updating average loss, etc.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50218,
      "author_name": "alexanderriggers",
      "author_url": "",
      "post_date": "07/09/2014 17:21:53",
      "content": "<p>I have a question regarding the gen_feature_vw.py output. Why do all entries in the test.vw file have a label of one?&nbsp;</p>\n\n<p>VW input format is:</p>\n<p>label [weight] |Namespace Feature ... Feature |Namespace ...</p>\n\n<p>In our case 1`lastid ....</p>\n<p>While int the train file we also have some 0 labels.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 50219,
      "author_name": "philculliton",
      "author_url": "",
      "post_date": "07/09/2014 17:36:30",
      "content": "<p>VW ignores labels when in test mode - so it doesn't matter what's there. &nbsp;However, something does need&nbsp;to be there, so we put in some dummy information. &nbsp;When using the train file we're (most likely) actually training the VW model, so you&nbsp;put real information in the labels.</p>\n\n<p>One nice side effect of using all 1s as the dummy labels is that you can use average loss on the test run to gauge how &quot;high&quot; or &quot;low&quot; your current set of features might be pushing the overall results, simply by comparing it to the average testing loss from previous runs. &nbsp;Since VW doesn't have good support for CV, any kind of meta-data about your current results&nbsp;can be helpful. &nbsp;:-)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 116220,
      "author_name": "leyue260351",
      "author_url": "",
      "post_date": "04/22/2016 15:25:03",
      "content": "<p>Thanks for sharing!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "41913": "",
    "41962": "",
    "41978": "",
    "42021": "",
    "42047": "",
    "42056": "",
    "42058": "",
    "42059": "",
    "42069": "",
    "42072": "",
    "42125": "",
    "42142": "",
    "42326": "",
    "42328": "",
    "42346": "",
    "42356": "",
    "42557": "",
    "42563": "",
    "42622": "",
    "42626": "",
    "43523": "",
    "43657": "",
    "44253": "",
    "44259": "",
    "44273": "",
    "44396": "",
    "44410": "",
    "44411": "",
    "44412": "",
    "44413": "",
    "44414": "",
    "44429": "",
    "44441": "",
    "44451": "",
    "44479": "",
    "44513": "",
    "44562": "",
    "44796": "",
    "47421": "",
    "47422": "",
    "47423": "",
    "47424": "",
    "48413": "",
    "48416": "",
    "48417": "",
    "48418": "",
    "48419": "",
    "48420": "",
    "48437": "",
    "48439": "",
    "48448": "",
    "48450": "",
    "48451": "",
    "48453": "",
    "48454": "",
    "48457": "",
    "48473": "",
    "48476": "",
    "48482": "",
    "48485": "",
    "48486": "",
    "48487": "",
    "48488": "",
    "48489": "",
    "48490": "",
    "48494": "",
    "48495": "",
    "48499": "",
    "48514": "",
    "48515": "",
    "48516": "",
    "48527": "",
    "48535": "",
    "48541": "",
    "48547": "",
    "48549": "",
    "48555": "",
    "48558": "",
    "48561": "",
    "48595": "",
    "48615": "",
    "48616": "",
    "48617": "",
    "48623": "",
    "48630": "",
    "48632": "",
    "48669": "",
    "48696": "",
    "48710": "",
    "48716": "",
    "48721": "",
    "48747": "",
    "48755": "",
    "48758": "",
    "48763": "",
    "48773": "",
    "48807": "",
    "48853": "",
    "48857": "",
    "48864": "",
    "48872": "",
    "48875": "",
    "48883": "",
    "48886": "",
    "48895": "",
    "48896": "",
    "48996": "",
    "49006": "",
    "49053": "",
    "49082": "",
    "49126": "",
    "49257": "",
    "49259": "",
    "49260": "",
    "49261": "",
    "49268": "",
    "49269": "",
    "49286": "",
    "49292": "",
    "49293": "",
    "49304": "",
    "49999": "",
    "50002": "",
    "50004": "",
    "50011": "",
    "50056": "",
    "50058": "",
    "50090": "",
    "50210": "",
    "50218": "",
    "50219": "",
    "116220": "Thanks for sharing!",
    "3229372": "nicely explained"
  },
  "source": "meta"
}