{
  "id": 11462,
  "title": "transform dataset for association rule",
  "url": "/competitions/acquire-valued-shoppers-challenge/discussion/11462",
  "author_name": "",
  "post_date": "2015-01-09T09:43:16.577Z",
  "votes": null,
  "comment_count": 2,
  "views": 1567,
  "content": "<p>I know this competition is over but I curious to test/implement my method.</p>\n<p>can anybody here teach/tell me how to transform the dataset so it can be use for association rule algorithm like apriori for example.</p>\n\n<p>thanks</p>",
  "messages": [
    {
      "id": "62488",
      "postDate": "01/09/2015 09:43:16",
      "content": "<p>I know this competition is over but I curious to test/implement my method.</p>\n<p>can anybody here teach/tell me how to transform the dataset so it can be use for association rule algorithm like apriori for example.</p>\n\n<p>thanks</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "136399",
      "postDate": "09/21/2016 19:14:33",
      "content": "<p>Hi Clay,</p>\n\n<p>Did you get a response on this?</p>",
      "rawMarkdown": "Hi Clay,\r\n\r\nDid you get a response on this?",
      "votes": null
    },
    {
      "id": "166111",
      "postDate": "03/08/2017 12:39:21",
      "content": "<p>Have a look at this:\n<a href=\"https://www.kaggle.com/c/acquire-valued-shoppers-challenge/discussion/7666\">https://www.kaggle.com/c/acquire-valued-shoppers-challenge/discussion/7666</a></p>\n\n<blockquote>\n  <p>Unix script for getting transactions where category is in at least one offer. WARNING, this will pick up some junk rows and maybe even duplicate rows because of grep matching other parts of the row.</p>\n</blockquote>\n\n<p>grep \",706,\" transactions &gt; trans_cat.csv\ngrep \",799,\" transactions &gt;&gt; trans_cat.csv\ngrep \",1703,\" transactions &gt;&gt; trans_cat.csv\ngrep \",1726,\" transactions &gt;&gt; trans_cat.csv\ngrep \",2119,\" transactions &gt;&gt; trans_cat.csv\ngrep \",2202,\" transactions &gt;&gt; trans_cat.csv\ngrep \",3203,\" transactions &gt;&gt; trans_cat.csv\ngrep \",3504,\" transactions &gt;&gt; trans_cat.csv\ngrep \",3509,\" transactions &gt;&gt; trans_cat.csv\ngrep \",4401,\" transactions &gt;&gt; trans_cat.csv\ngrep \",4517,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5122,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5558,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5616,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5619,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5824,\" transactions &gt;&gt; trans_cat.csv\ngrep \",6202,\" transactions &gt;&gt; trans_cat.csv\ngrep \",7205,\" transactions &gt;&gt; trans_cat.csv\ngrep \",9115,\" transactions &gt;&gt; trans_cat.csv\ngrep \",9909,\" transactions &gt;&gt; trans_cat.csv</p>\n\n<h1>R code to weed out junk rows that were accidentally picked up by grep.</h1>\n\n<h1>If duplicates exist, getting rid of them is left as an exercise to the reader.</h1>\n\n<p>trans_cat &lt;- read.csv(\"trans_cat.csv\",header=TRUE)\nnrow(trans_cat)\ntable(trans_cat$category)</p>\n\n<p>trans_cat &lt;- trans_cat[which(trans_cat$category %in% c(706,799,1703,1726,2119,2202,3203,3504,3509,4401,4517,5122,5558,5616,5619,5824,6202,7205,9115,9909)),]\nnrow(trans_cat)\ntable(trans_cat$category)</p>",
      "rawMarkdown": "Have a look at this:\nhttps://www.kaggle.com/c/acquire-valued-shoppers-challenge/discussion/7666\n\n\n>Unix script for getting transactions where category is in at least one offer. WARNING, this will pick up some junk rows and maybe even duplicate rows because of grep matching other parts of the row.\n\ngrep \",706,\" transactions > trans_cat.csv\ngrep \",799,\" transactions >> trans_cat.csv\ngrep \",1703,\" transactions >> trans_cat.csv\ngrep \",1726,\" transactions >> trans_cat.csv\ngrep \",2119,\" transactions >> trans_cat.csv\ngrep \",2202,\" transactions >> trans_cat.csv\ngrep \",3203,\" transactions >> trans_cat.csv\ngrep \",3504,\" transactions >> trans_cat.csv\ngrep \",3509,\" transactions >> trans_cat.csv\ngrep \",4401,\" transactions >> trans_cat.csv\ngrep \",4517,\" transactions >> trans_cat.csv\ngrep \",5122,\" transactions >> trans_cat.csv\ngrep \",5558,\" transactions >> trans_cat.csv\ngrep \",5616,\" transactions >> trans_cat.csv\ngrep \",5619,\" transactions >> trans_cat.csv\ngrep \",5824,\" transactions >> trans_cat.csv\ngrep \",6202,\" transactions >> trans_cat.csv\ngrep \",7205,\" transactions >> trans_cat.csv\ngrep \",9115,\" transactions >> trans_cat.csv\ngrep \",9909,\" transactions >> trans_cat.csv\n\n\n# R code to weed out junk rows that were accidentally picked up by grep.\n\n# If duplicates exist, getting rid of them is left as an exercise to the reader.\n\ntrans_cat <- read.csv(\"trans_cat.csv\",header=TRUE)\nnrow(trans_cat)\ntable(trans_cat$category)\n\ntrans_cat <- trans_cat[which(trans_cat$category %in% c(706,799,1703,1726,2119,2202,3203,3504,3509,4401,4517,5122,5558,5616,5619,5824,6202,7205,9115,9909)),]\nnrow(trans_cat)\ntable(trans_cat$category)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 136399,
      "author_name": "srikirancrai",
      "author_url": "",
      "post_date": "09/21/2016 19:14:33",
      "content": "<p>Hi Clay,</p>\n\n<p>Did you get a response on this?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 166111,
      "author_name": "danofer",
      "author_url": "",
      "post_date": "03/08/2017 12:39:21",
      "content": "<p>Have a look at this:\n<a href=\"https://www.kaggle.com/c/acquire-valued-shoppers-challenge/discussion/7666\">https://www.kaggle.com/c/acquire-valued-shoppers-challenge/discussion/7666</a></p>\n\n<blockquote>\n  <p>Unix script for getting transactions where category is in at least one offer. WARNING, this will pick up some junk rows and maybe even duplicate rows because of grep matching other parts of the row.</p>\n</blockquote>\n\n<p>grep \",706,\" transactions &gt; trans_cat.csv\ngrep \",799,\" transactions &gt;&gt; trans_cat.csv\ngrep \",1703,\" transactions &gt;&gt; trans_cat.csv\ngrep \",1726,\" transactions &gt;&gt; trans_cat.csv\ngrep \",2119,\" transactions &gt;&gt; trans_cat.csv\ngrep \",2202,\" transactions &gt;&gt; trans_cat.csv\ngrep \",3203,\" transactions &gt;&gt; trans_cat.csv\ngrep \",3504,\" transactions &gt;&gt; trans_cat.csv\ngrep \",3509,\" transactions &gt;&gt; trans_cat.csv\ngrep \",4401,\" transactions &gt;&gt; trans_cat.csv\ngrep \",4517,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5122,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5558,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5616,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5619,\" transactions &gt;&gt; trans_cat.csv\ngrep \",5824,\" transactions &gt;&gt; trans_cat.csv\ngrep \",6202,\" transactions &gt;&gt; trans_cat.csv\ngrep \",7205,\" transactions &gt;&gt; trans_cat.csv\ngrep \",9115,\" transactions &gt;&gt; trans_cat.csv\ngrep \",9909,\" transactions &gt;&gt; trans_cat.csv</p>\n\n<h1>R code to weed out junk rows that were accidentally picked up by grep.</h1>\n\n<h1>If duplicates exist, getting rid of them is left as an exercise to the reader.</h1>\n\n<p>trans_cat &lt;- read.csv(\"trans_cat.csv\",header=TRUE)\nnrow(trans_cat)\ntable(trans_cat$category)</p>\n\n<p>trans_cat &lt;- trans_cat[which(trans_cat$category %in% c(706,799,1703,1726,2119,2202,3203,3504,3509,4401,4517,5122,5558,5616,5619,5824,6202,7205,9115,9909)),]\nnrow(trans_cat)\ntable(trans_cat$category)</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "62488": "",
    "136399": "Hi Clay,\r\n\r\nDid you get a response on this?",
    "166111": "Have a look at this:\nhttps://www.kaggle.com/c/acquire-valued-shoppers-challenge/discussion/7666\n\n\n>Unix script for getting transactions where category is in at least one offer. WARNING, this will pick up some junk rows and maybe even duplicate rows because of grep matching other parts of the row.\n\ngrep \",706,\" transactions > trans_cat.csv\ngrep \",799,\" transactions >> trans_cat.csv\ngrep \",1703,\" transactions >> trans_cat.csv\ngrep \",1726,\" transactions >> trans_cat.csv\ngrep \",2119,\" transactions >> trans_cat.csv\ngrep \",2202,\" transactions >> trans_cat.csv\ngrep \",3203,\" transactions >> trans_cat.csv\ngrep \",3504,\" transactions >> trans_cat.csv\ngrep \",3509,\" transactions >> trans_cat.csv\ngrep \",4401,\" transactions >> trans_cat.csv\ngrep \",4517,\" transactions >> trans_cat.csv\ngrep \",5122,\" transactions >> trans_cat.csv\ngrep \",5558,\" transactions >> trans_cat.csv\ngrep \",5616,\" transactions >> trans_cat.csv\ngrep \",5619,\" transactions >> trans_cat.csv\ngrep \",5824,\" transactions >> trans_cat.csv\ngrep \",6202,\" transactions >> trans_cat.csv\ngrep \",7205,\" transactions >> trans_cat.csv\ngrep \",9115,\" transactions >> trans_cat.csv\ngrep \",9909,\" transactions >> trans_cat.csv\n\n\n# R code to weed out junk rows that were accidentally picked up by grep.\n\n# If duplicates exist, getting rid of them is left as an exercise to the reader.\n\ntrans_cat <- read.csv(\"trans_cat.csv\",header=TRUE)\nnrow(trans_cat)\ntable(trans_cat$category)\n\ntrans_cat <- trans_cat[which(trans_cat$category %in% c(706,799,1703,1726,2119,2202,3203,3504,3509,4401,4517,5122,5558,5616,5619,5824,6202,7205,9115,9909)),]\nnrow(trans_cat)\ntable(trans_cat$category)"
  },
  "source": "meta"
}