{
  "id": 8208,
  "title": "Is each customer ID associated with only one chain?",
  "url": "/competitions/acquire-valued-shoppers-challenge/discussion/8208",
  "author_name": "",
  "post_date": "2014-05-19T09:47:54.570Z",
  "votes": null,
  "comment_count": 6,
  "views": 2789,
  "content": "<p>As far as I can tell, each customer ID is associated with only a single chain. &nbsp;That's unexpected--can anyone else confirm this?</p>\n<p>If this is true, it means that the transactions file can be linked to the history file by simply using the customer ID. &nbsp;The data description says that we need to use the (customer ID, chain) key to link these two files, so, again, that's surprising.</p>",
  "messages": [
    {
      "id": "44819",
      "postDate": "05/19/2014 09:47:54",
      "content": "<p>As far as I can tell, each customer ID is associated with only a single chain. &nbsp;That's unexpected--can anyone else confirm this?</p>\n<p>If this is true, it means that the transactions file can be linked to the history file by simply using the customer ID. &nbsp;The data description says that we need to use the (customer ID, chain) key to link these two files, so, again, that's surprising.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44820",
      "postDate": "05/19/2014 09:55:53",
      "content": "<p>yes, that's odd. Also consider that in the submission file we have only ID, so ID must be unique.</p>\n<p>Mike</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44821",
      "postDate": "05/19/2014 10:24:11",
      "content": "<p>I think that&nbsp;this topic&nbsp;can be&nbsp;investigated&nbsp;by running the following two commands. &nbsp;The first command counts the number of unique customer IDs. &nbsp;The second command counts the number of unique (customer ID, chain) pairs.</p>\n<p><code>zcat transactions.csv.gz | tail -n +2 | cut -f1 -d&quot;,&quot; | sort -n -S2G -u | wc -l</code></p>\n<p>(output: 311541)</p>\n<p><code>zcat transactions.csv.gz | tail -n +2 | cut -f1,2 -d&quot;,&quot; | sort -S2G -u | wc -l</code></p>\n<p>(output: 311548)</p>\n<p>Note that the output is similar but not equal. &nbsp;So it looks like there might be a very small number of exceptions to the general rule that each customer is associated with exactly one chain.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "44833",
      "postDate": "05/19/2014 15:22:46",
      "content": "<p>Some customer IDs have more than one chain as you have already found. &nbsp;What is not clear is if the ID belongs to the same customer as I pointed out <a href=\"http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/8113/clarification-on-variables-id-chain\">here</a>.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "46068",
      "postDate": "05/22/2014 16:17:57",
      "content": "<p>I have found the following ID's to be associated with 2 chain's. Furthermore, I do not find any ID associated with more than 2 chain's. The pairs occur both in the test and train sets.&nbsp;</p>\n<p>It is still not clear to me if it is the case that two chains coincidentally have the same id or that the customer shopped at two chains. Since this only occurs with 7 ID's amongst 311541 unique ID's, I don't think it makes much difference.&nbsp;</p>\n<p>http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/8113/clarification-on-variables-id-chain</p>\n\n<p>ID, CHAIN, SET</p>\n<p>122112062 15 test<br>122112062 88 test<br>141489865 18 train<br>141489865 88 train<br>442225874 71 test<br>442225874 70 test<br>446862868 70 train<br>446862868 64 train<br>473505968 68 test<br>473505968 70 test<br>4427711419 152 train<br>4427711419 153 train<br>4632223858 152 train<br>4632223858 153 train</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "47140",
      "postDate": "05/27/2014 18:39:42",
      "content": "<p>You mean we have 2 chainz's shopping history in transactions.csv?</p>\n<p><img src=\"http://www.billboard.com/files/media/2-chainz-3-hard-summer-2013-day1-650-430.jpg\" alt=\"2 chains\" width=\"382\" height=\"253\"></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "47186",
      "postDate": "05/28/2014 15:02:34",
      "content": "<p>Appreciate the thread -&nbsp;</p>\n\n<p>I unwittingly discarded any transactions for a given customer from a chain <strong>other than the one they received the offer from.</strong></p>\n<p>Gonna keep it that way I think though, only losing 113,364 lines of transactions from ~350 mil</p>\n<p>I suspect the intent was to only give us the data for the customer from the chain they received offer from...&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 44820,
      "author_name": "mikedemurtas",
      "author_url": "",
      "post_date": "05/19/2014 09:55:53",
      "content": "<p>yes, that's odd. Also consider that in the submission file we have only ID, so ID must be unique.</p>\n<p>Mike</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44821,
      "author_name": "conradlee",
      "author_url": "",
      "post_date": "05/19/2014 10:24:11",
      "content": "<p>I think that&nbsp;this topic&nbsp;can be&nbsp;investigated&nbsp;by running the following two commands. &nbsp;The first command counts the number of unique customer IDs. &nbsp;The second command counts the number of unique (customer ID, chain) pairs.</p>\n<p><code>zcat transactions.csv.gz | tail -n +2 | cut -f1 -d&quot;,&quot; | sort -n -S2G -u | wc -l</code></p>\n<p>(output: 311541)</p>\n<p><code>zcat transactions.csv.gz | tail -n +2 | cut -f1,2 -d&quot;,&quot; | sort -S2G -u | wc -l</code></p>\n<p>(output: 311548)</p>\n<p>Note that the output is similar but not equal. &nbsp;So it looks like there might be a very small number of exceptions to the general rule that each customer is associated with exactly one chain.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 44833,
      "author_name": "chaseos",
      "author_url": "",
      "post_date": "05/19/2014 15:22:46",
      "content": "<p>Some customer IDs have more than one chain as you have already found. &nbsp;What is not clear is if the ID belongs to the same customer as I pointed out <a href=\"http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/8113/clarification-on-variables-id-chain\">here</a>.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 46068,
      "author_name": "baobao0",
      "author_url": "",
      "post_date": "05/22/2014 16:17:57",
      "content": "<p>I have found the following ID's to be associated with 2 chain's. Furthermore, I do not find any ID associated with more than 2 chain's. The pairs occur both in the test and train sets.&nbsp;</p>\n<p>It is still not clear to me if it is the case that two chains coincidentally have the same id or that the customer shopped at two chains. Since this only occurs with 7 ID's amongst 311541 unique ID's, I don't think it makes much difference.&nbsp;</p>\n<p>http://www.kaggle.com/c/acquire-valued-shoppers-challenge/forums/t/8113/clarification-on-variables-id-chain</p>\n\n<p>ID, CHAIN, SET</p>\n<p>122112062 15 test<br>122112062 88 test<br>141489865 18 train<br>141489865 88 train<br>442225874 71 test<br>442225874 70 test<br>446862868 70 train<br>446862868 64 train<br>473505968 68 test<br>473505968 70 test<br>4427711419 152 train<br>4427711419 153 train<br>4632223858 152 train<br>4632223858 153 train</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 47140,
      "author_name": "zachmayer",
      "author_url": "",
      "post_date": "05/27/2014 18:39:42",
      "content": "<p>You mean we have 2 chainz's shopping history in transactions.csv?</p>\n<p><img src=\"http://www.billboard.com/files/media/2-chainz-3-hard-summer-2013-day1-650-430.jpg\" alt=\"2 chains\" width=\"382\" height=\"253\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 47186,
      "author_name": "scharf",
      "author_url": "",
      "post_date": "05/28/2014 15:02:34",
      "content": "<p>Appreciate the thread -&nbsp;</p>\n\n<p>I unwittingly discarded any transactions for a given customer from a chain <strong>other than the one they received the offer from.</strong></p>\n<p>Gonna keep it that way I think though, only losing 113,364 lines of transactions from ~350 mil</p>\n<p>I suspect the intent was to only give us the data for the customer from the chain they received offer from...&nbsp;</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "44819": "",
    "44820": "",
    "44821": "",
    "44833": "",
    "46068": "",
    "47140": "",
    "47186": ""
  },
  "source": "meta"
}