{
  "id": 137578,
  "title": "Month-day target ratios. Is it relevant?",
  "url": "/competitions/cat-in-the-dat-ii/discussion/137578",
  "author_name": "",
  "post_date": "2020-03-21T11:33:12.874512600Z",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi Kagglers,\nplaying with the columns 'month' and 'day' in the dataset I come up with the following barplot. \nEach bar represents the ratios I obtained by grouping the data in ['month','day'], then on the numerator I counted the number of times the target was 0, and on the denominator the number of times the target was 1.</p>\n\n<p>For instance the bar (1.0,1.0) refers to month = 1 and day = 1.\nRatio = number of times the target was 0 in (1.0,1.0) / number of times the target was 1 in (1.0,1.0)\nAnd so on.</p>\n\n<p>I am making this post because I feel like there is a sort of pattern (or is it just a coincidence?), but I don't know how to decipher it...</p>\n\n<p>Maybe it's just useless but I'd like somebody more expert than me to tell me...</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4226849%2F78dd625fd19fed1439eec410105905c0%2FAnnotazione%202020-03-21%20122232.png?generation=1584789802582741&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "781517",
      "postDate": "03/21/2020 11:33:12",
      "content": "<p>Hi Kagglers,\nplaying with the columns 'month' and 'day' in the dataset I come up with the following barplot. \nEach bar represents the ratios I obtained by grouping the data in ['month','day'], then on the numerator I counted the number of times the target was 0, and on the denominator the number of times the target was 1.</p>\n\n<p>For instance the bar (1.0,1.0) refers to month = 1 and day = 1.\nRatio = number of times the target was 0 in (1.0,1.0) / number of times the target was 1 in (1.0,1.0)\nAnd so on.</p>\n\n<p>I am making this post because I feel like there is a sort of pattern (or is it just a coincidence?), but I don't know how to decipher it...</p>\n\n<p>Maybe it's just useless but I'd like somebody more expert than me to tell me...</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4226849%2F78dd625fd19fed1439eec410105905c0%2FAnnotazione%202020-03-21%20122232.png?generation=1584789802582741&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Hi Kagglers,\nplaying with the columns 'month' and 'day' in the dataset I come up with the following barplot. \nEach bar represents the ratios I obtained by grouping the data in ['month','day'], then on the numerator I counted the number of times the target was 0, and on the denominator the number of times the target was 1.\n\nFor instance the bar (1.0,1.0) refers to month = 1 and day = 1.\nRatio = number of times the target was 0 in (1.0,1.0) / number of times the target was 1 in (1.0,1.0)\nAnd so on.\n\nI am making this post because I feel like there is a sort of pattern (or is it just a coincidence?), but I don't know how to decipher it...\n\nMaybe it's just useless but I'd like somebody more expert than me to tell me...\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4226849%2F78dd625fd19fed1439eec410105905c0%2FAnnotazione%202020-03-21%20122232.png?generation=1584789802582741&amp;alt=media)",
      "votes": null
    },
    {
      "id": "781962",
      "postDate": "03/21/2020 19:43:30",
      "content": "<p>i can see that:\n- ratio descends while <code>month</code> grows\n- days 4,5,6 have higher ratio in average</p>\n\n<p>ideas how to handle:\n- add new feature <code>is_day_{4, 5 or 6}</code> (but one-hot encoding can handle this well)\n- add <code>cos(2 * pi * day / 7)</code> (and do not forget to try <code>sin</code>)\n- add new feature <code>is_start_of_year</code> (threshold should be found experimantally) (again, ohe can do good enough)</p>\n\n<p>i hope i helped you! if you find any interesting, let us know. and good luck!</p>",
      "rawMarkdown": "i can see that:\n- ratio descends while `month` grows\n- days 4,5,6 have higher ratio in average\n\nideas how to handle:\n- add new feature `is_day_{4, 5 or 6}` (but one-hot encoding can handle this well)\n- add `cos(2 * pi * day / 7)` (and do not forget to try `sin`)\n- add new feature `is_start_of_year` (threshold should be found experimantally) (again, ohe can do good enough)\n\ni hope i helped you! if you find any interesting, let us know. and good luck!",
      "votes": null
    },
    {
      "id": "782400",
      "postDate": "03/22/2020 08:36:27",
      "content": "<p>Well thank you for the insight! I had really neve thought about using mathematical functions such as sin and cos to help me in the calculations but it actually makes sense!</p>\n\n<p>If I can find something interesting I'll definitely post it 😄 </p>",
      "rawMarkdown": "Well thank you for the insight! I had really neve thought about using mathematical functions such as sin and cos to help me in the calculations but it actually makes sense!\n\nIf I can find something interesting I'll definitely post it 😄",
      "votes": null
    },
    {
      "id": "782428",
      "postDate": "03/22/2020 09:34:01",
      "content": "<p>i found out about <code>sin/cos encoding</code>  about a month ago in this competition. <code>sin/cos</code> is used with features of periodic (or seasonal) nature like hours, days, weeks, month, etc. it is necessary to find right period for it (but i also tried to explore different periods)</p>",
      "rawMarkdown": "i found out about `sin/cos encoding`  about a month ago in this competition. `sin/cos` is used with features of periodic (or seasonal) nature like hours, days, weeks, month, etc. it is necessary to find right period for it (but i also tried to explore different periods)",
      "votes": null
    },
    {
      "id": "782483",
      "postDate": "03/22/2020 10:50:12",
      "content": "<p>Really interesting! 👍 </p>",
      "rawMarkdown": "Really interesting! 👍",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 781962,
      "author_name": "fkdplc",
      "author_url": "",
      "post_date": "03/21/2020 19:43:30",
      "content": "<p>i can see that:\n- ratio descends while <code>month</code> grows\n- days 4,5,6 have higher ratio in average</p>\n\n<p>ideas how to handle:\n- add new feature <code>is_day_{4, 5 or 6}</code> (but one-hot encoding can handle this well)\n- add <code>cos(2 * pi * day / 7)</code> (and do not forget to try <code>sin</code>)\n- add new feature <code>is_start_of_year</code> (threshold should be found experimantally) (again, ohe can do good enough)</p>\n\n<p>i hope i helped you! if you find any interesting, let us know. and good luck!</p>",
      "votes": null,
      "replies": [
        {
          "id": 782400,
          "author_name": "simonebonato",
          "author_url": "",
          "post_date": "03/22/2020 08:36:27",
          "content": "<p>Well thank you for the insight! I had really neve thought about using mathematical functions such as sin and cos to help me in the calculations but it actually makes sense!</p>\n\n<p>If I can find something interesting I'll definitely post it 😄 </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 782428,
          "author_name": "fkdplc",
          "author_url": "",
          "post_date": "03/22/2020 09:34:01",
          "content": "<p>i found out about <code>sin/cos encoding</code>  about a month ago in this competition. <code>sin/cos</code> is used with features of periodic (or seasonal) nature like hours, days, weeks, month, etc. it is necessary to find right period for it (but i also tried to explore different periods)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 782483,
          "author_name": "simonebonato",
          "author_url": "",
          "post_date": "03/22/2020 10:50:12",
          "content": "<p>Really interesting! 👍 </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "781517": "Hi Kagglers,\nplaying with the columns 'month' and 'day' in the dataset I come up with the following barplot. \nEach bar represents the ratios I obtained by grouping the data in ['month','day'], then on the numerator I counted the number of times the target was 0, and on the denominator the number of times the target was 1.\n\nFor instance the bar (1.0,1.0) refers to month = 1 and day = 1.\nRatio = number of times the target was 0 in (1.0,1.0) / number of times the target was 1 in (1.0,1.0)\nAnd so on.\n\nI am making this post because I feel like there is a sort of pattern (or is it just a coincidence?), but I don't know how to decipher it...\n\nMaybe it's just useless but I'd like somebody more expert than me to tell me...\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4226849%2F78dd625fd19fed1439eec410105905c0%2FAnnotazione%202020-03-21%20122232.png?generation=1584789802582741&amp;alt=media)",
    "781962": "i can see that:\n- ratio descends while `month` grows\n- days 4,5,6 have higher ratio in average\n\nideas how to handle:\n- add new feature `is_day_{4, 5 or 6}` (but one-hot encoding can handle this well)\n- add `cos(2 * pi * day / 7)` (and do not forget to try `sin`)\n- add new feature `is_start_of_year` (threshold should be found experimantally) (again, ohe can do good enough)\n\ni hope i helped you! if you find any interesting, let us know. and good luck!",
    "782400": "Well thank you for the insight! I had really neve thought about using mathematical functions such as sin and cos to help me in the calculations but it actually makes sense!\n\nIf I can find something interesting I'll definitely post it 😄",
    "782428": "i found out about `sin/cos encoding`  about a month ago in this competition. `sin/cos` is used with features of periodic (or seasonal) nature like hours, days, weeks, month, etc. it is necessary to find right period for it (but i also tried to explore different periods)",
    "782483": "Really interesting! 👍"
  },
  "source": "meta"
}