When should embeddings not be used for categorical data? What are their limitations?2019 Community Moderator ElectionBoruta Feature Selection packagePreprocessing and dropout in Autoencoders?Training of word weights in Word Embedding and Word2VecProperly using activation functions of neural networkAre there cases where tree based algorithms can do better than neural networks?Value error in Merging two different models in kerasHow to dual encode two sentences to show similarity scoreWhy does averaging a sentence's worth of word vectors work?LSTM - Forecasting usage (real world)

Why do we use polarized capacitors?

Was there ever an axiom rendered a theorem?

Is there a familial term for apples and pears?

A poker game description that does not feel gimmicky

What does 'script /dev/null' do?

Can Pesach Mitzvot be performed before Tzet Kochavim?

"My colleague's body is amazing"

Is "plugging out" electronic devices an American expression?

Can I buy Tokyo Keisei line tickets with international debit card?

Why is my log file so massive? 22gb. I am running log backups

Is domain driven design an anti-SQL pattern?

Shall I use personal or official e-mail account when registering to external websites for work purpose?

Should the British be getting ready for a no-deal Brexit?

How to deal with fear of taking dependencies

What is it called when one voice type sings a 'solo'?

How is it possible for user's password to be changed after storage was encrypted? (on OS X, Android)

What do the Banks children have against barley water?

Creating a loop after a break using Markov Chain in Tikz

Could a US political party gain complete control over the government by removing checks & balances?

Why is the design of haulage companies so “special”?

How can I fix this gap between bookcases I made?

How can I plot a Farey diagram?

Extreme, but not acceptable situation and I can't start the work tomorrow morning

How could a lack of term limits lead to a "dictatorship?"



When should embeddings not be used for categorical data? What are their limitations?



2019 Community Moderator ElectionBoruta Feature Selection packagePreprocessing and dropout in Autoencoders?Training of word weights in Word Embedding and Word2VecProperly using activation functions of neural networkAre there cases where tree based algorithms can do better than neural networks?Value error in Merging two different models in kerasHow to dual encode two sentences to show similarity scoreWhy does averaging a sentence's worth of word vectors work?LSTM - Forecasting usage (real world)










1












$begingroup$


I recently came across the concept of embeddings so the concept is still new to me, but it is my understanding that embeddings convert one-hot encoded input data into a dense vector.



Vectors corresponding to all one-hot encodings are first embedded into the dense space randomly. As the embedding gets trained, the vectors move in the dense space from their initial random positions to positions that add algebraic meaning to the dense space. The data basically organizes itself.



This process of data arranging itself seems too good to be true.



I am posting this question here because in all the articles I have read about embeddings, they are presented as a silver bullet, and I wasn't able to find any texts on the limitations of embeddings.



This would essentially enable all categorical data to be converted into dense, meaningful representations during preprocessing or as part of training of a bigger model).



This is an example of embeddings being used to convert all categorical features into dense representations:



# Input layer for religion
encoder_liv = Sequential()
encoder_liv.add(Embedding(liv_cats,4,input_length=1))
encoder_liv.add(Flatten())

# Input layer for religion
encoder_edu = Sequential()
encoder_edu.add(Embedding(edu_cats,4,input_length=1))
encoder_edu.add(Flatten())

# Input layer for triggers(x_b)
dense_x = Sequential()
dense_x.add(Dense(4, input_dim=x.shape[1]))

model = Sequential()
model.add(Merge([encoder_liv, encoder_edu, dense_x], mode='concat'))
# model.add(Activation('relu'))
model.add(Dense(output_dim=12))
model.add(Activation('relu'))
model.add(Dense(output_dim=3))
model.add(Activation('softmax'))

model.compile(optimizer='adagrad', loss='categorical_crossentropy', metrics=['accuracy'])


An embedding is used in this video to replace the entire encoder network of a convolutional autoencoder generating human faces. here is the accompanying code.



So, what's the catch? Why should I not use always use an embedding for all categorical data? What are the constraints limiting an embedding's use/success?










share|improve this question









$endgroup$
















    1












    $begingroup$


    I recently came across the concept of embeddings so the concept is still new to me, but it is my understanding that embeddings convert one-hot encoded input data into a dense vector.



    Vectors corresponding to all one-hot encodings are first embedded into the dense space randomly. As the embedding gets trained, the vectors move in the dense space from their initial random positions to positions that add algebraic meaning to the dense space. The data basically organizes itself.



    This process of data arranging itself seems too good to be true.



    I am posting this question here because in all the articles I have read about embeddings, they are presented as a silver bullet, and I wasn't able to find any texts on the limitations of embeddings.



    This would essentially enable all categorical data to be converted into dense, meaningful representations during preprocessing or as part of training of a bigger model).



    This is an example of embeddings being used to convert all categorical features into dense representations:



    # Input layer for religion
    encoder_liv = Sequential()
    encoder_liv.add(Embedding(liv_cats,4,input_length=1))
    encoder_liv.add(Flatten())

    # Input layer for religion
    encoder_edu = Sequential()
    encoder_edu.add(Embedding(edu_cats,4,input_length=1))
    encoder_edu.add(Flatten())

    # Input layer for triggers(x_b)
    dense_x = Sequential()
    dense_x.add(Dense(4, input_dim=x.shape[1]))

    model = Sequential()
    model.add(Merge([encoder_liv, encoder_edu, dense_x], mode='concat'))
    # model.add(Activation('relu'))
    model.add(Dense(output_dim=12))
    model.add(Activation('relu'))
    model.add(Dense(output_dim=3))
    model.add(Activation('softmax'))

    model.compile(optimizer='adagrad', loss='categorical_crossentropy', metrics=['accuracy'])


    An embedding is used in this video to replace the entire encoder network of a convolutional autoencoder generating human faces. here is the accompanying code.



    So, what's the catch? Why should I not use always use an embedding for all categorical data? What are the constraints limiting an embedding's use/success?










    share|improve this question









    $endgroup$














      1












      1








      1


      2



      $begingroup$


      I recently came across the concept of embeddings so the concept is still new to me, but it is my understanding that embeddings convert one-hot encoded input data into a dense vector.



      Vectors corresponding to all one-hot encodings are first embedded into the dense space randomly. As the embedding gets trained, the vectors move in the dense space from their initial random positions to positions that add algebraic meaning to the dense space. The data basically organizes itself.



      This process of data arranging itself seems too good to be true.



      I am posting this question here because in all the articles I have read about embeddings, they are presented as a silver bullet, and I wasn't able to find any texts on the limitations of embeddings.



      This would essentially enable all categorical data to be converted into dense, meaningful representations during preprocessing or as part of training of a bigger model).



      This is an example of embeddings being used to convert all categorical features into dense representations:



      # Input layer for religion
      encoder_liv = Sequential()
      encoder_liv.add(Embedding(liv_cats,4,input_length=1))
      encoder_liv.add(Flatten())

      # Input layer for religion
      encoder_edu = Sequential()
      encoder_edu.add(Embedding(edu_cats,4,input_length=1))
      encoder_edu.add(Flatten())

      # Input layer for triggers(x_b)
      dense_x = Sequential()
      dense_x.add(Dense(4, input_dim=x.shape[1]))

      model = Sequential()
      model.add(Merge([encoder_liv, encoder_edu, dense_x], mode='concat'))
      # model.add(Activation('relu'))
      model.add(Dense(output_dim=12))
      model.add(Activation('relu'))
      model.add(Dense(output_dim=3))
      model.add(Activation('softmax'))

      model.compile(optimizer='adagrad', loss='categorical_crossentropy', metrics=['accuracy'])


      An embedding is used in this video to replace the entire encoder network of a convolutional autoencoder generating human faces. here is the accompanying code.



      So, what's the catch? Why should I not use always use an embedding for all categorical data? What are the constraints limiting an embedding's use/success?










      share|improve this question









      $endgroup$




      I recently came across the concept of embeddings so the concept is still new to me, but it is my understanding that embeddings convert one-hot encoded input data into a dense vector.



      Vectors corresponding to all one-hot encodings are first embedded into the dense space randomly. As the embedding gets trained, the vectors move in the dense space from their initial random positions to positions that add algebraic meaning to the dense space. The data basically organizes itself.



      This process of data arranging itself seems too good to be true.



      I am posting this question here because in all the articles I have read about embeddings, they are presented as a silver bullet, and I wasn't able to find any texts on the limitations of embeddings.



      This would essentially enable all categorical data to be converted into dense, meaningful representations during preprocessing or as part of training of a bigger model).



      This is an example of embeddings being used to convert all categorical features into dense representations:



      # Input layer for religion
      encoder_liv = Sequential()
      encoder_liv.add(Embedding(liv_cats,4,input_length=1))
      encoder_liv.add(Flatten())

      # Input layer for religion
      encoder_edu = Sequential()
      encoder_edu.add(Embedding(edu_cats,4,input_length=1))
      encoder_edu.add(Flatten())

      # Input layer for triggers(x_b)
      dense_x = Sequential()
      dense_x.add(Dense(4, input_dim=x.shape[1]))

      model = Sequential()
      model.add(Merge([encoder_liv, encoder_edu, dense_x], mode='concat'))
      # model.add(Activation('relu'))
      model.add(Dense(output_dim=12))
      model.add(Activation('relu'))
      model.add(Dense(output_dim=3))
      model.add(Activation('softmax'))

      model.compile(optimizer='adagrad', loss='categorical_crossentropy', metrics=['accuracy'])


      An embedding is used in this video to replace the entire encoder network of a convolutional autoencoder generating human faces. here is the accompanying code.



      So, what's the catch? Why should I not use always use an embedding for all categorical data? What are the constraints limiting an embedding's use/success?







      machine-learning categorical-data word-embeddings embeddings






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 19:37









      Aayush MahajanAayush Mahajan

      1061




      1061




















          0






          active

          oldest

          votes












          Your Answer





          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "557"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48175%2fwhen-should-embeddings-not-be-used-for-categorical-data-what-are-their-limitati%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Data Science Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48175%2fwhen-should-embeddings-not-be-used-for-categorical-data-what-are-their-limitati%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

          Tähtien Talli Jäsenet | Lähteet | NavigointivalikkoSuomen Hippos – Tähtien Talli

          Do these cracks on my tires look bad? The Next CEO of Stack OverflowDry rot tire should I replace?Having to replace tiresFishtailed so easily? Bad tires? ABS?Filling the tires with something other than air, to avoid puncture hassles?Used Michelin tires safe to install?Do these tyre cracks necessitate replacement?Rumbling noise: tires or mechanicalIs it possible to fix noisy feathered tires?Are bad winter tires still better than summer tires in winter?Torque converter failure - Related to replacing only 2 tires?Why use snow tires on all 4 wheels on 2-wheel-drive cars?