Answers.Body: <p>So basically you have three values per security gap:</p>
  <ol>
  <li>The type of gap (i.e. its label)</li>
  <li>The risk of that gap for that specific website. As I understand it this value is different for each website, even if the type of the security gap is the same.</li>
  <li>The number of occurrences of the gap</li>
  </ol>
  <p>One reasonable way to combine the features is to make a feature vector where the indices are the type of the gap, and the values are the risk of the gap multiplied with the occurences. However, this would mean information loss, due to a gap with risk 1 occuring 3 times being identical to a gap with risk 3 occuring once.</p>
  <p>A different way to combine the features is just to make a feature vector that consists of the gap risk values and the gap occurences appended (for a feature vector with length of <code>2 * num(type_of_gaps)</code>. Assuming a model with a fully connected structure, the pattern between the connected values may be determined by the model itself during learning.</p>
  <p>A third way would be to make a feature vector filled with tuples, which is not really feature engineering as much as it is restructuring the data into a manageable data type. However, you can combine this, when flattened, with an algorithm using a 1D convolution layer with stride kernel 2 and stride 2 in order to process the tuples together, instead of all the values separately.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-21T14:46:24.723Z
Answers.Text: If this answered your question please be so kind as to accept and/or upvote it.
Answers.UserDisplayName: Kroshtan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-08T02:50:14.923Z
Answers.Text: I am so sorry, your solution is helped me a lot
Answers.UserDisplayName: Issa Mansour
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-15T07:42:07.123Z
Answers.LastActivityDate: 2022-08-15T07:42:07.123Z
Answers.UserDisplayName: Kroshtan
Body: <p>I have  a data set containing the number of security gaps and the level of that gap for a specific website.</p>
  <p>Now suppose I have 2 features in this data set, the first feature is the number of a specific security gap and the second feature is the risk of this gap for a specific website.</p>
  <p>How can I combine these two features into one?</p>
  <p>What is the best way to apply feature engineering to these features?</p>
  <p>Thanks</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-08T14:50:15.243Z
Comments.Text: Can you elaborate on the purpose of the features, the task, and what you've already thought of or tried? Without knowing the goal, the features themselves don't say much.
Comments.UserDisplayName: Kroshtan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-12T04:47:17.043Z
Comments.Text: the features are the number of gaps and the risk level of each gap, the output is the security level of website
Comments.UserDisplayName: Issa Mansour
Tags: <machine-learning><datasets><data-preprocessing><feature-maps>
Title: combine two features in dataset?
UserDisplayName: Issa Mansour
ThreadText: # combine two features in dataset?
  
  (Asked by: username_0 on 2022-08-07)
  
  I have a data set containing the number of security gaps and the level of that gap for a specific website.
  
  Now suppose I have 2 features in this data set, the first feature is the number of a specific security gap and the second feature is the risk of this gap for a specific website.
  
  How can I combine these two features into one?
  
  What is the best way to apply feature engineering to these features?
  
  Thanks
  
  **Tags:** machine-learning, datasets, data-preprocessing, feature-maps
  
  > **Comments:**
  > **username_1**: Can you elaborate on the purpose of the features, the task, and what you've already thought of or tried? Without knowing the goal, the features themselves don't say much.  
  > **username_0**: the features are the number of gaps and the risk level of each gap, the output is the security level of website  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-08-15. Score: 0 | Accepted answer
  
  So basically you have three values per security gap:
  
  1. The type of gap (i.e. its label)
  2. The risk of that gap for that specific website. As I understand it this value is different for each website, even if the type of the security gap is the same.
  3. The number of occurrences of the gap
  
  One reasonable way to combine the features is to make a feature vector where the indices are the type of the gap, and the values are the risk of the gap multiplied with the occurences. However, this would mean information loss, due to a gap with risk 1 occuring 3 times being identical to a gap with risk 3 occuring once.
  
  A different way to combine the features is just to make a feature vector that consists of the gap risk values and the gap occurences appended (for a feature vector with length of `2 * num(type_of_gaps)`. Assuming a model with a fully connected structure, the pattern between the connected values may be determined by the model itself during learning.
  
  A third way would be to make a feature vector filled with tuples, which is not really feature engineering as much as it is restructuring the data into a manageable data type. However, you can combine this, when flattened, with an algorithm using a 1D convolution layer with stride kernel 2 and stride 2 in order to process the tuples together, instead of all the values separately.
  
  > **Comments:**
  > **username_1**: If this answered your question please be so kind as to accept and/or upvote it.  
  > **username_0**: I am so sorry, your solution is helped me a lot  
  
  ---
  
  