ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 79 - Professional Data Engineer discussion

Report
Export

Which of these are examples of a value in a sparse vector? (Select 2 answers.)

A.
[0, 5, 0, 0, 0, 0]
Answers
A.
[0, 5, 0, 0, 0, 0]
B.
[0, 0, 0, 1, 0, 0, 1]
Answers
B.
[0, 0, 0, 1, 0, 0, 1]
C.
[0, 1]
Answers
C.
[0, 1]
D.
[1, 0, 0, 0, 0, 0, 0]
Answers
D.
[1, 0, 0, 0, 0, 0, 0]
Suggested answer: C, D

Explanation:

Categorical features in linear models are typically translated into a sparse vector in which each possible value has a corresponding index or id. For example, if there are only three possible eye colors you can represent 'eye_color' as a length 3 vector: 'brown' would become [1, 0, 0], 'blue' would become [0, 1, 0] and 'green' would become [0, 0, 1]. These vectors are called "sparse" because they may be very long, with many zeros, when the set of possible values is very large (such as all English words).

[0, 0, 0, 1, 0, 0, 1] is not a sparse vector because it has two 1s in it. A sparse vector contains only a single 1.

[0, 5, 0, 0, 0, 0] is not a sparse vector because it has a 5 in it. Sparse vectors only contain 0s and 1s.

Reference: https://www.tensorflow.org/tutorials/linear#feature_columns_and_transformations

asked 18/09/2024
Daniela Const
38 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first