{
  "id": 73217,
  "title": "What does \"-1\" City Id mean ?",
  "url": "/competitions/elo-merchant-category-recommendation/discussion/73217",
  "author_name": "HarshitMehta",
  "post_date": "2018-11-30T21:43:37.870000",
  "votes": 2,
  "comment_count": 10,
  "views": 0,
  "content": "<p>Is City Id \"-1\" is just a nomenclature or it represents missing city data ? </p>",
  "messages": [
    {
      "id": 431211,
      "postDate": "2018-12-01T21:04:13.080Z",
      "content": "<p>Actually, I think the answer to this question is \"it depends\".  </p>\n\n<p>In the <em>merchants.csv</em> file, 31.5% of all <em>merchant_ids</em> (or 105K) have a value of \"-1\".  If we look at these same <em>merchant_ids</em> in *historical_transactions.csv*, 97.5K have a value of <em>city_id</em> other than -1.  So, in this case, I would think that \"-1\" in <em>merchants.csv</em> would indicate that the merchant is present in more than one city.</p>\n\n<p>However, in *historical_transactions.csv* there are around 2.5 million transactions (8.5%) that have a <em>city_id</em> of -1 and these are associated with 13240 unique <em>merchant_ids</em>.    I am guessing that in this sense the \"-1\" might mean an unknown city because a transaction has to occur in one place, not multiple cities.</p>\n\n<p>I haven't checked *new_merchant_transactions.csv\" yet so I don't know how many \"-1\"s occur there.</p>",
      "rawMarkdown": "Actually, I think the answer to this question is \"it depends\".  \n\nIn the *merchants.csv* file, 31.5% of all *merchant\\_ids* (or 105K) have a value of \"-1\".  If we look at these same *merchant\\_ids* in *historical_transactions.csv*, 97.5K have a value of *city\\_id* other than -1.  So, in this case, I would think that \"-1\" in *merchants.csv* would indicate that the merchant is present in more than one city.\n\nHowever, in *historical_transactions.csv* there are around 2.5 million transactions (8.5%) that have a *city\\_id* of -1 and these are associated with 13240 unique *merchant\\_ids*.    I am guessing that in this sense the \"-1\" might mean an unknown city because a transaction has to occur in one place, not multiple cities.\n\nI haven't checked *new_merchant_transactions.csv\" yet so I don't know how many \"-1\"s occur there.",
      "votes": 3,
      "replies": [
        {
          "id": 431225,
          "postDate": "2018-12-01T21:57:36.303Z",
          "content": "<p>Thanks Norman. I am treating -1 as \"Missing data\" currently. Even in the installments feature of historical and new merchant data , there are \"-1\" as well. So, i am assuming they are using \"-1\" to indicate missing data.</p>",
          "rawMarkdown": "Thanks Norman. I am treating -1 as \"Missing data\" currently. Even in the installments feature of historical and new merchant data , there are \"-1\" as well. So, i am assuming they are using \"-1\" to indicate missing data."
        },
        {
          "id": 432121,
          "postDate": "2018-12-03T12:37:37.577Z",
          "content": "<p>Yes, as a general rule I would say \"-1\" is probably unknown.  What I was trying to point out though is that there are some differences between historical transactions and merchants and so you have to be careful when you merge those two.  You might want to keep both city ids as the mismatch between the two might provide some useful information.</p>",
          "rawMarkdown": "Yes, as a general rule I would say \"-1\" is probably unknown.  What I was trying to point out though is that there are some differences between historical transactions and merchants and so you have to be careful when you merge those two.  You might want to keep both city ids as the mismatch between the two might provide some useful information."
        },
        {
          "id": 433191,
          "postDate": "2018-12-04T20:21:56.847Z",
          "content": "<p>Also you'll see 188 values of 999 in the install variable - which likely is also some sort of missingness code. </p>",
          "rawMarkdown": "Also you'll see 188 values of 999 in the install variable - which likely is also some sort of missingness code. "
        },
        {
          "id": 433205,
          "postDate": "2018-12-04T20:48:24.993Z",
          "content": "<p>True Matthew, I replaced -installments and \"999\" with the mode of the installments, which came out to be 0 in my analysis.</p>",
          "rawMarkdown": "True Matthew, I replaced -installments and \"999\" with the mode of the installments, which came out to be 0 in my analysis."
        },
        {
          "id": 434976,
          "postDate": "2018-12-07T08:46:37.583Z",
          "content": "<p>Can we assume <code>city_id</code>'s with <strong>-1</strong> are online stores though?</p>",
          "rawMarkdown": "Can we assume `city_id`'s with **-1** are online stores though?"
        }
      ]
    },
    {
      "id": 430792,
      "postDate": "2018-12-01T00:31:57.067Z",
      "content": "<p>-1 in cityid and stateid stand for Nan value</p>",
      "rawMarkdown": "-1 in cityid and stateid stand for Nan value",
      "votes": 1,
      "replies": [
        {
          "id": 430802,
          "postDate": "2018-12-01T01:30:03.470Z",
          "content": "<p>Thanks Chau</p>",
          "rawMarkdown": "Thanks Chau"
        },
        {
          "id": 430829,
          "postDate": "2018-12-01T02:40:33.123Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 430853,
          "postDate": "2018-12-01T03:53:02.827Z",
          "content": "<p>You can treat them as a separate class of that feature, i.e \"Missing\" class </p>",
          "rawMarkdown": "You can treat them as a separate class of that feature, i.e \"Missing\" class ",
          "votes": 1
        }
      ]
    },
    {
      "id": 430711,
      "postDate": "2018-11-30T21:43:37.870Z",
      "content": "<p>Is City Id \"-1\" is just a nomenclature or it represents missing city data ? </p>",
      "rawMarkdown": "Is City Id \"-1\" is just a nomenclature or it represents missing city data ? ",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 431211,
      "author_name": "Norman Secord",
      "author_url": "",
      "post_date": "2018-12-01T21:04:13.080000",
      "content": "<p>Actually, I think the answer to this question is \"it depends\".  </p>\n\n<p>In the <em>merchants.csv</em> file, 31.5% of all <em>merchant_ids</em> (or 105K) have a value of \"-1\".  If we look at these same <em>merchant_ids</em> in *historical_transactions.csv*, 97.5K have a value of <em>city_id</em> other than -1.  So, in this case, I would think that \"-1\" in <em>merchants.csv</em> would indicate that the merchant is present in more than one city.</p>\n\n<p>However, in *historical_transactions.csv* there are around 2.5 million transactions (8.5%) that have a <em>city_id</em> of -1 and these are associated with 13240 unique <em>merchant_ids</em>.    I am guessing that in this sense the \"-1\" might mean an unknown city because a transaction has to occur in one place, not multiple cities.</p>\n\n<p>I haven't checked *new_merchant_transactions.csv\" yet so I don't know how many \"-1\"s occur there.</p>",
      "votes": 3,
      "replies": [
        {
          "id": 431225,
          "author_name": "HarshitMehta",
          "author_url": "",
          "post_date": "2018-12-01T21:57:36.303000",
          "content": "<p>Thanks Norman. I am treating -1 as \"Missing data\" currently. Even in the installments feature of historical and new merchant data , there are \"-1\" as well. So, i am assuming they are using \"-1\" to indicate missing data.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 432121,
          "author_name": "Norman Secord",
          "author_url": "",
          "post_date": "2018-12-03T12:37:37.577000",
          "content": "<p>Yes, as a general rule I would say \"-1\" is probably unknown.  What I was trying to point out though is that there are some differences between historical transactions and merchants and so you have to be careful when you merge those two.  You might want to keep both city ids as the mismatch between the two might provide some useful information.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 433191,
          "author_name": "Matthew Barstead",
          "author_url": "",
          "post_date": "2018-12-04T20:21:56.847000",
          "content": "<p>Also you'll see 188 values of 999 in the install variable - which likely is also some sort of missingness code. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 433205,
          "author_name": "HarshitMehta",
          "author_url": "",
          "post_date": "2018-12-04T20:48:24.993000",
          "content": "<p>True Matthew, I replaced -installments and \"999\" with the mode of the installments, which came out to be 0 in my analysis.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 434976,
          "author_name": "Joshi",
          "author_url": "",
          "post_date": "2018-12-07T08:46:37.583000",
          "content": "<p>Can we assume <code>city_id</code>'s with <strong>-1</strong> are online stores though?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 430792,
      "author_name": "Chau Huynh",
      "author_url": "",
      "post_date": "2018-12-01T00:31:57.067000",
      "content": "<p>-1 in cityid and stateid stand for Nan value</p>",
      "votes": 1,
      "replies": [
        {
          "id": 430802,
          "author_name": "HarshitMehta",
          "author_url": "",
          "post_date": "2018-12-01T01:30:03.470000",
          "content": "<p>Thanks Chau</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 430829,
          "author_name": "",
          "author_url": "",
          "post_date": "2018-12-01T02:40:33.123000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 430853,
          "author_name": "HarshitMehta",
          "author_url": "",
          "post_date": "2018-12-01T03:53:02.827000",
          "content": "<p>You can treat them as a separate class of that feature, i.e \"Missing\" class </p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "431211": "Actually, I think the answer to this question is \"it depends\".  \n\nIn the *merchants.csv* file, 31.5% of all *merchant\\_ids* (or 105K) have a value of \"-1\".  If we look at these same *merchant\\_ids* in *historical_transactions.csv*, 97.5K have a value of *city\\_id* other than -1.  So, in this case, I would think that \"-1\" in *merchants.csv* would indicate that the merchant is present in more than one city.\n\nHowever, in *historical_transactions.csv* there are around 2.5 million transactions (8.5%) that have a *city\\_id* of -1 and these are associated with 13240 unique *merchant\\_ids*.    I am guessing that in this sense the \"-1\" might mean an unknown city because a transaction has to occur in one place, not multiple cities.\n\nI haven't checked *new_merchant_transactions.csv\" yet so I don't know how many \"-1\"s occur there.",
    "430792": "-1 in cityid and stateid stand for Nan value",
    "430711": "Is City Id \"-1\" is just a nomenclature or it represents missing city data ? "
  }
}