{
  "id": 99392,
  "title": "Smart to combine features?",
  "url": "/competitions/champs-scalar-coupling/discussion/99392",
  "author_name": "roush",
  "post_date": "2019-07-11T00:36:25.544000",
  "votes": 2,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi everyone,</p>\n\n<p>I was wondering from those with more experience, the best way to go about combining one hot encoded + value features.</p>\n\n<p>For example, </p>\n\n<p>Let's say you're not splitting up the data here per type when generating a model. Then you would have a type column, 1 through 8, and you may also have a euclidean distance column. </p>\n\n<p>Rather than have 8 one hot encoded (hit or misses), and then a distance. \nWould it be just as good/feasible/make it easier for the model to understand they go together, if instead of putting 1, you put the distance (as it is always more than 0) in place of hit. As the others remain zero regardless.</p>\n\n<p>So instead of:</p>\n\n<p>1,2,3,4,5,6,7,8,type\n1,0,0,0,0,0,0,0,0.2385</p>\n\n<p>You will have\n1,2,3,4,5,6,7,8\n0.2385,0,0,0,0,0,0,0</p>\n\n<p>Thanks</p>",
  "messages": [
    {
      "id": 573365,
      "postDate": "2019-07-12T07:05:16.473Z",
      "content": "<p>When combining you prevent a tree based method from splitting based on the distance, you force a split by type first.  Whether this is good or bad requires experimentation.  For NNs you multiply 2 features  together, and you don't lose because the sum of the compacted features gives you back the missing one. This may be interesting.  </p>\n\n<p>In general, all questions that start with \"Is it a good idea to \" have only one sensible answer: try and see if it works or not ;)</p>",
      "rawMarkdown": "When combining you prevent a tree based method from splitting based on the distance, you force a split by type first.  Whether this is good or bad requires experimentation.  For NNs you multiply 2 features  together, and you don't lose because the sum of the compacted features gives you back the missing one. This may be interesting.  \n\nIn general, all questions that start with \"Is it a good idea to \" have only one sensible answer: try and see if it works or not ;)",
      "votes": 6,
      "replies": [
        {
          "id": 573797,
          "postDate": "2019-07-12T18:57:44.073Z",
          "content": "<p>Thanks <a href=\"/cpmpml\">@cpmpml</a> . I have been trying, I just wanted some support / rationality for it. The \"why it would or wouldn't work\", as I tend to spend hours or even days prepping data to try something that appears to me to make sense logically, ends up being very very wrong, or vice verca, I stumble upon something that shouldn't work but works. So I like to see if there's a 'rational' reason for it I'm missing.</p>\n\n<p>Your answer covered it.  Thanks again.</p>",
          "rawMarkdown": "Thanks @cpmpml . I have been trying, I just wanted some support / rationality for it. The \"why it would or wouldn't work\", as I tend to spend hours or even days prepping data to try something that appears to me to make sense logically, ends up being very very wrong, or vice verca, I stumble upon something that shouldn't work but works. So I like to see if there's a 'rational' reason for it I'm missing.\n\nYour answer covered it.  Thanks again.",
          "votes": 1
        }
      ]
    },
    {
      "id": 572447,
      "postDate": "2019-07-11T00:36:25.543Z",
      "content": "<p>Hi everyone,</p>\n\n<p>I was wondering from those with more experience, the best way to go about combining one hot encoded + value features.</p>\n\n<p>For example, </p>\n\n<p>Let's say you're not splitting up the data here per type when generating a model. Then you would have a type column, 1 through 8, and you may also have a euclidean distance column. </p>\n\n<p>Rather than have 8 one hot encoded (hit or misses), and then a distance. \nWould it be just as good/feasible/make it easier for the model to understand they go together, if instead of putting 1, you put the distance (as it is always more than 0) in place of hit. As the others remain zero regardless.</p>\n\n<p>So instead of:</p>\n\n<p>1,2,3,4,5,6,7,8,type\n1,0,0,0,0,0,0,0,0.2385</p>\n\n<p>You will have\n1,2,3,4,5,6,7,8\n0.2385,0,0,0,0,0,0,0</p>\n\n<p>Thanks</p>",
      "rawMarkdown": "Hi everyone,\n\nI was wondering from those with more experience, the best way to go about combining one hot encoded + value features.\n\nFor example, \n\nLet's say you're not splitting up the data here per type when generating a model. Then you would have a type column, 1 through 8, and you may also have a euclidean distance column. \n\nRather than have 8 one hot encoded (hit or misses), and then a distance. \nWould it be just as good/feasible/make it easier for the model to understand they go together, if instead of putting 1, you put the distance (as it is always more than 0) in place of hit. As the others remain zero regardless.\n\nSo instead of:\n\n1,2,3,4,5,6,7,8,type\n1,0,0,0,0,0,0,0,0.2385\n\nYou will have\n1,2,3,4,5,6,7,8\n0.2385,0,0,0,0,0,0,0\n\nThanks\n\n",
      "votes": 2
    },
    {
      "id": 572478,
      "postDate": "2019-07-11T01:37:45.477Z",
      "rawMarkdown": "",
      "votes": 2,
      "isDeleted": true,
      "replies": [
        {
          "id": 572506,
          "postDate": "2019-07-11T02:34:00.900Z",
          "content": "<p>That isn't my question. I'm already doing that for my own things. I presented it explicitly as so as to lay out my question. It doesn't have to be type, it could be 8 of something you've one hot encoded which you know will go well with distance.</p>",
          "rawMarkdown": "That isn't my question. I'm already doing that for my own things. I presented it explicitly as so as to lay out my question. It doesn't have to be type, it could be 8 of something you've one hot encoded which you know will go well with distance."
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 573365,
      "author_name": "CPMP",
      "author_url": "",
      "post_date": "2019-07-12T07:05:16.473000",
      "content": "<p>When combining you prevent a tree based method from splitting based on the distance, you force a split by type first.  Whether this is good or bad requires experimentation.  For NNs you multiply 2 features  together, and you don't lose because the sum of the compacted features gives you back the missing one. This may be interesting.  </p>\n\n<p>In general, all questions that start with \"Is it a good idea to \" have only one sensible answer: try and see if it works or not ;)</p>",
      "votes": 6,
      "replies": [
        {
          "id": 573797,
          "author_name": "roush",
          "author_url": "",
          "post_date": "2019-07-12T18:57:44.073000",
          "content": "<p>Thanks <a href=\"/cpmpml\">@cpmpml</a> . I have been trying, I just wanted some support / rationality for it. The \"why it would or wouldn't work\", as I tend to spend hours or even days prepping data to try something that appears to me to make sense logically, ends up being very very wrong, or vice verca, I stumble upon something that shouldn't work but works. So I like to see if there's a 'rational' reason for it I'm missing.</p>\n\n<p>Your answer covered it.  Thanks again.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 572478,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-07-11T01:37:45.477000",
      "content": "",
      "votes": 2,
      "replies": [
        {
          "id": 572506,
          "author_name": "roush",
          "author_url": "",
          "post_date": "2019-07-11T02:34:00.900000",
          "content": "<p>That isn't my question. I'm already doing that for my own things. I presented it explicitly as so as to lay out my question. It doesn't have to be type, it could be 8 of something you've one hot encoded which you know will go well with distance.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "573365": "When combining you prevent a tree based method from splitting based on the distance, you force a split by type first.  Whether this is good or bad requires experimentation.  For NNs you multiply 2 features  together, and you don't lose because the sum of the compacted features gives you back the missing one. This may be interesting.  \n\nIn general, all questions that start with \"Is it a good idea to \" have only one sensible answer: try and see if it works or not ;)",
    "572447": "Hi everyone,\n\nI was wondering from those with more experience, the best way to go about combining one hot encoded + value features.\n\nFor example, \n\nLet's say you're not splitting up the data here per type when generating a model. Then you would have a type column, 1 through 8, and you may also have a euclidean distance column. \n\nRather than have 8 one hot encoded (hit or misses), and then a distance. \nWould it be just as good/feasible/make it easier for the model to understand they go together, if instead of putting 1, you put the distance (as it is always more than 0) in place of hit. As the others remain zero regardless.\n\nSo instead of:\n\n1,2,3,4,5,6,7,8,type\n1,0,0,0,0,0,0,0,0.2385\n\nYou will have\n1,2,3,4,5,6,7,8\n0.2385,0,0,0,0,0,0,0\n\nThanks\n\n",
    "572478": ""
  }
}