Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Professional Data Engineer Exam - Topic 2 Question 117 Discussion

Actual exam question for Google's Professional Data Engineer exam
Question #: 117
Topic #: 2
[All Professional Data Engineer Questions]

How can you get a neural network to learn about relationships between categories in a categorical feature?

Show Suggested Answer Hide Answer
Suggested Answer: D

There are two problems with one-hot encoding. First, it has high dimensionality, meaning that instead of having just one value, like a continuous feature, it has many values, or dimensions. This makes computation more time-consuming, especially if a feature has a very large number of categories. The second problem is that it doesn't encode any relationships between the categories. They are completely independent from each other, so the network has no way of knowing which ones are similar to each other.

Both of these problems can be solved by representing a categorical feature with an embedding

column. The idea is that each category has a smaller vector with, let's say, 5 values in it. But unlike a one-hot vector, the values are not usually 0. The values are weights, similar to the weights that are used for basic features in a neural network. The difference is that each category has a set of weights (5 of them in this case).

You can think of each value in the embedding vector as a feature of the category. So, if two categories are very similar to each other, then their embedding vectors should be very similar too.


Contribute your Thoughts:

0/2000 characters
Pearlie
1 day ago
Embedding layer is the obvious choice. Unless you're still using a flip phone, that is.
upvoted 0 times
...
Angelica
7 days ago
Embedding layer is the way to go. One-hot encoding is so 2010.
upvoted 0 times
...
Jaime
12 days ago
Embedding layer for sure! That way the network can learn the relationships between the categories.
upvoted 0 times
...
Isreal
17 days ago
Hmm, I'm not sure about that. Wouldn't that just treat the categories as independent? I'd try something like an embedding layer instead.
upvoted 0 times
...
Corinne
22 days ago
I think using one-hot encoding and feeding that into the neural network would work well.
upvoted 0 times
...
Alease
27 days ago
I feel like we discussed using decision trees to understand categorical features, but I'm not clear on how that translates to neural networks.
upvoted 0 times
...
Kandis
2 months ago
There was a practice question about using embeddings versus one-hot encoding, and I think embeddings might be better for capturing similarities between categories.
upvoted 0 times
...
Tasia
2 months ago
I remember something about embedding layers being useful for capturing relationships in categorical data. It seems like a good approach, but I need to double-check the details.
upvoted 0 times
...
Clay
2 months ago
I think we can use techniques like one-hot encoding to represent categorical features, but I'm not entirely sure how that helps the network learn relationships.
upvoted 0 times
...
Brinda
2 months ago
Oof, this is a tricky one. I'm not super familiar with the best way to handle categorical features in neural nets. I'll have to review my notes and see if I can come up with a solid strategy.
upvoted 0 times
...
Roy
2 months ago
Okay, for this I'd probably start by one-hot encoding the categorical feature. Then I could try feeding that into an embedding layer to see if that helps the model pick up on the relationships. Seems worth a shot!
upvoted 0 times
...
Shenika
3 months ago
Hmm, I'm not totally sure about this one. I'd need to think through the different approaches and how they might work. Maybe I could look at some examples online to get some ideas.
upvoted 0 times
...
Karma
3 months ago
I think I could use some kind of embedding layer to capture the relationships between the categories. That might help the model learn the patterns.
upvoted 0 times
...

Save Cancel