{
  "id": 40065,
  "title": "How to Regenerate the \"train.csv\" file？",
  "url": "/competitions/kkbox-churn-prediction-challenge/discussion/40065",
  "author_name": "",
  "post_date": "2017-09-27T06:50:35.382952600Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I was trying to regenerate the \"train.csv\" file using the \"transactions.csv\" file. But the regenerated result shows that the the number of \"is_churn = 1\" is more than that in the original data. The basic steps are:</p>\n\n<ol>\n<li>Choose the records with \"membership_expire_date\"  in Feb, 2017 and get dataset A</li>\n<li>If the member with \"transaction_date\" (transactions.csv) - \"membership_expire_date\" (A) in [0, 30] and \"is_cancel\" = 0,   set him \"is_churn\" = 0; Else, set 1</li>\n</ol>\n\n<p>However, the regenerated result does not fully match the \"train.csv\" file. For example, the most recent transaction records of the member \"+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=\" in the training set are:</p>\n\n<p>+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20161130,20170119,0\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20170131,20170319,0\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20161231,20170219,0</p>\n\n<p>The membership_expire_date in Feb is 20170219. There is no valid transaction between 20170219 and 20170321 (30 days), but is_churn = 0. </p>\n\n<p>It would be appreciated that someone could give some explanation. Thanks! :)</p>",
  "messages": [
    {
      "id": "224659",
      "postDate": "09/27/2017 06:50:35",
      "content": "<p>I was trying to regenerate the \"train.csv\" file using the \"transactions.csv\" file. But the regenerated result shows that the the number of \"is_churn = 1\" is more than that in the original data. The basic steps are:</p>\n\n<ol>\n<li>Choose the records with \"membership_expire_date\"  in Feb, 2017 and get dataset A</li>\n<li>If the member with \"transaction_date\" (transactions.csv) - \"membership_expire_date\" (A) in [0, 30] and \"is_cancel\" = 0,   set him \"is_churn\" = 0; Else, set 1</li>\n</ol>\n\n<p>However, the regenerated result does not fully match the \"train.csv\" file. For example, the most recent transaction records of the member \"+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=\" in the training set are:</p>\n\n<p>+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20161130,20170119,0\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20170131,20170319,0\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20161231,20170219,0</p>\n\n<p>The membership_expire_date in Feb is 20170219. There is no valid transaction between 20170219 and 20170321 (30 days), but is_churn = 0. </p>\n\n<p>It would be appreciated that someone could give some explanation. Thanks! :)</p>",
      "rawMarkdown": "I was trying to regenerate the \"train.csv\" file using the \"transactions.csv\" file. But the regenerated result shows that the the number of \"is_churn = 1\" is more than that in the original data. The basic steps are:\n\n1. Choose the records with \"membership_expire_date\"  in Feb, 2017 and get dataset A\n2. If the member with \"transaction_date\" (transactions.csv) - \"membership_expire_date\" (A) in [0, 30] and \"is_cancel\" = 0,   set him \"is_churn\" = 0; Else, set 1\n\nHowever, the regenerated result does not fully match the \"train.csv\" file. For example, the most recent transaction records of the member \"+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=\" in the training set are:\n\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20161130,20170119,0\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20170131,20170319,0\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20161231,20170219,0\n\nThe membership_expire_date in Feb is 20170219. There is no valid transaction between 20170219 and 20170321 (30 days), but is_churn = 0. \n\nIt would be appreciated that someone could give some explanation. Thanks! :)",
      "votes": null
    },
    {
      "id": "224946",
      "postDate": "09/28/2017 00:28:38",
      "content": "<p>The second transaction (+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20170131,20170319,0) is the most recent with membership_expire_date 20170319. Since this is not in February, it is not included in the training set</p>",
      "rawMarkdown": "The second transaction (+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20170131,20170319,0) is the most recent with membership_expire_date 20170319. Since this is not in February, it is not included in the training set",
      "votes": null
    },
    {
      "id": "224962",
      "postDate": "09/28/2017 01:32:35",
      "content": "<p>I believe you cannot regenerate train.csv from the transaction data provided, because there's no transaction data in March 2017.</p>",
      "rawMarkdown": "I believe you cannot regenerate train.csv from the transaction data provided, because there's no transaction data in March 2017.",
      "votes": null
    },
    {
      "id": "225063",
      "postDate": "09/28/2017 06:17:21",
      "content": "<p>Yes you are completely right. I forgot the max transaction date limitation in \"transactions.csv\".</p>",
      "rawMarkdown": "Yes you are completely right. I forgot the max transaction date limitation in \"transactions.csv\".",
      "votes": null
    },
    {
      "id": "225150",
      "postDate": "09/28/2017 11:28:45",
      "content": "<p>The number of the records in the train.csv is 992931. However, the number of the members whose expire date falls in Feb, 2017 is 993527</p>",
      "rawMarkdown": "The number of the records in the train.csv is 992931. However, the number of the members whose expire date falls in Feb, 2017 is 993527",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 224946,
      "author_name": "connor24",
      "author_url": "",
      "post_date": "09/28/2017 00:28:38",
      "content": "<p>The second transaction (+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20170131,20170319,0) is the most recent with membership_expire_date 20170319. Since this is not in February, it is not included in the training set</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 224962,
      "author_name": "hongliangma",
      "author_url": "",
      "post_date": "09/28/2017 01:32:35",
      "content": "<p>I believe you cannot regenerate train.csv from the transaction data provided, because there's no transaction data in March 2017.</p>",
      "votes": null,
      "replies": [
        {
          "id": 225063,
          "author_name": "nirvanada",
          "author_url": "",
          "post_date": "09/28/2017 06:17:21",
          "content": "<p>Yes you are completely right. I forgot the max transaction date limitation in \"transactions.csv\".</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 225150,
      "author_name": "nirvanada",
      "author_url": "",
      "post_date": "09/28/2017 11:28:45",
      "content": "<p>The number of the records in the train.csv is 992931. However, the number of the members whose expire date falls in Feb, 2017 is 993527</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "224659": "I was trying to regenerate the \"train.csv\" file using the \"transactions.csv\" file. But the regenerated result shows that the the number of \"is_churn = 1\" is more than that in the original data. The basic steps are:\n\n1. Choose the records with \"membership_expire_date\"  in Feb, 2017 and get dataset A\n2. If the member with \"transaction_date\" (transactions.csv) - \"membership_expire_date\" (A) in [0, 30] and \"is_cancel\" = 0,   set him \"is_churn\" = 0; Else, set 1\n\nHowever, the regenerated result does not fully match the \"train.csv\" file. For example, the most recent transaction records of the member \"+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=\" in the training set are:\n\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20161130,20170119,0\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20170131,20170319,0\n+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20161231,20170219,0\n\nThe membership_expire_date in Feb is 20170219. There is no valid transaction between 20170219 and 20170321 (30 days), but is_churn = 0. \n\nIt would be appreciated that someone could give some explanation. Thanks! :)",
    "224946": "The second transaction (+++l/EXNMLTijfLBa8p2TUVVVp2aFGSuUI/h7mLmthw=,39,30,149,149,1,20170131,20170319,0) is the most recent with membership_expire_date 20170319. Since this is not in February, it is not included in the training set",
    "224962": "I believe you cannot regenerate train.csv from the transaction data provided, because there's no transaction data in March 2017.",
    "225063": "Yes you are completely right. I forgot the max transaction date limitation in \"transactions.csv\".",
    "225150": "The number of the records in the train.csv is 992931. However, the number of the members whose expire date falls in Feb, 2017 is 993527"
  },
  "source": "meta"
}