Linear Algebra for Machine Learning
- 50Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Which description best matches the basic meaning of a vector in this context?
Which description best matches the basic meaning of a vector in this context?
50 questions
- 1
Which description best matches the basic meaning of a vector in this context?
- A
A one-dimensional array of numbers, sometimes visualized as an arrow
- B
A two-dimensional array that always stores image pixels
- C
A collection of numbers that must contain exactly one nonzero entry
- D
A rule that transforms one vector space into another
Correct answer
AA one-dimensional array of numbers, sometimes visualized as an arrow
Explanation
A vector can be represented as a one-dimensional array of numbers; it can also be visualized as an arrow with magnitude and direction.
- A
- 2
What does it mean to refer to all vectors with three entries as a three-dimensional vector space?
- A
The space of vectors that each have three entries
- B
The space of vectors whose entries sum to three
- C
The space of vectors that can represent three objects
- D
The space containing exactly three different vectors
Correct answer
AThe space of vectors that each have three entries
Explanation
A vector space consisting of vectors with three entries is called three-dimensional; the dimension corresponds to the number of entries in each vector.
- A
- 3
Which statement correctly defines a feature vector?
- A
A vector whose entries must all be binary values
- B
A vector whose entries represent features of an object or entity
- C
A vector that contains only features learned by a neural network
- D
A vector that represents the complete feature space
Correct answer
BA vector whose entries represent features of an object or entity
Explanation
A feature vector is an ordinary vector whose entries are interpreted as features of an object, such as a patient's height, weight, and age.
- A
- 4
In this discussion, what does the term feature space refer to?
- A
A vector that records the features of one object
- B
The set of labels assigned to individual features
- C
The process of choosing which features to measure
- D
The collection of possible feature vectors
Correct answer
DThe collection of possible feature vectors
Explanation
Feature space is used as a name for the totality of feature vectors, much like vector space refers to the totality of vectors.
- A
- 5
How can pixel values be used to represent a black-and-white or grayscale image numerically?
- A
Assign one unique word to each pixel and store the words as labels
- B
Assign a number to each pixel, using binary values or grayscale intensities
- C
Represent the entire image with a single number indicating its size
- D
Use a different vector space for every row of pixels
Correct answer
BAssign a number to each pixel, using binary values or grayscale intensities
Explanation
A black-and-white image can assign a binary value to each pixel, while a grayscale image can assign each pixel a value such as one from 0 to 255.
- A
- 6
What is one method for converting a matrix of image pixels into a vector?
- A
Sort all pixel values and discard their original positions
- B
Keep only the largest pixel value from each column
- C
Replace every row with the average value of the whole image
- D
Read the matrix rows in order and stack their entries into one sequence
Correct answer
DRead the matrix rows in order and stack their entries into one sequence
Explanation
One way to turn an image matrix into a vector is to list a row and then stack the subsequent rows in order, producing a one-dimensional sequence of pixel values.
- A
- 7
How can a word such as “dog” be represented using a collection of documents?
- A
Record only whether the word appears in the first document
- B
Count the word's occurrences separately in each document and list the counts
- C
Assign each document a count of how many words it contains
- D
Replace every word with a one-hot vector before examining documents
Correct answer
BCount the word's occurrences separately in each document and list the counts
Explanation
A word can be represented by counting how many times it appears in each document and placing those counts into a vector.
- A
- 8
How can a user's movie interactions be organized as a vector?
- A
Store one vector per movie containing the movie's title and release date
- B
List each item's features but omit the user's interaction with it
- C
Represent each user only by the total number of items available
- D
List the user's ratings or interaction indicators across the items
Correct answer
DList the user's ratings or interaction indicators across the items
Explanation
A user's interactions with items can be represented by listing a rating or an indication of whether the user interacted with each item.
- A
- 9
What is the central idea of representing data for machine learning in this discussion?
- A
By encoding relevant information as numerical entries in vectors
- B
By replacing all non-numerical information with a single category
- C
By converting all information into a set of mathematical proofs
- D
By storing every data type as an unchanged matrix
Correct answer
ABy encoding relevant information as numerical entries in vectors
Explanation
Data representations make information usable by computers by organizing it into numerical vectors, including when the original information is text, images, or preferences.
- A
- 10
What characterizes a one-hot encoding of a word?
- A
A vector whose entries represent the word's semantic similarities
- B
A vector with one entry equal to one and all others equal to zero
- C
A vector that records a word's count in each document
- D
A vector in which every entry has the same value
Correct answer
BA vector with one entry equal to one and all others equal to zero
Explanation
A one-hot encoding has zeros in every position except one, where it has a one; a distinct position is assigned to each vocabulary word.
- A
- 11
What is another mathematical name for one-hot encoding vectors?
- A
They are matrix transposes
- B
They are principal eigenvectors
- C
They are latent feature vectors
- D
They are standard basis vectors
Correct answer
DThey are standard basis vectors
Explanation
One-hot encodings are also called standard basis vectors in mathematics.
- A
- 12
Why are one-hot representations an example of sparse data representations?
- A
They contain many repeated nonzero values
- B
They contain many zeros and only one nonzero entry
- C
They contain no zeros when the vocabulary is large
- D
They have fewer entries than the vocabulary has words
Correct answer
BThey contain many zeros and only one nonzero entry
Explanation
One-hot vectors are sparse because they contain many zeros and only one nonzero entry.
- A
- 13
Why can a user–movie representation contain many missing entries?
- A
Most users give every movie the same rating
- B
The number of movies is always smaller than the number of users
- C
Most user–movie interactions are absent or unknown
- D
Each movie is associated with only one user
Correct answer
CMost user–movie interactions are absent or unknown
Explanation
With many users and movies, most users will not have interacted with every movie, so many entries may be unknown or missing.
- A
- 14
What effect can replacing unknown user–movie entries with zeros have?
- A
It makes every missing rating equivalent to a positive rating
- B
It creates many zeros in a representation that already has many unknown entries
- C
It converts the user–movie data into a one-hot vocabulary
- D
It ensures that all users have identical feature vectors
Correct answer
BIt creates many zeros in a representation that already has many unknown entries
Explanation
Replacing unknown ratings or interactions with zeros can create many zero entries, making the representation sparse.
- A
- 15
How is the dot product of two vectors computed?
- A
Add all entries of the first vector and subtract the second vector
- B
Multiply corresponding entries and add the resulting products
- C
Multiply the vectors entry by entry and keep the result as a vector
- D
Compare only the first entries and return their difference
Correct answer
BMultiply corresponding entries and add the resulting products
Explanation
The dot product multiplies corresponding entries of two equal-length vectors and adds the products to produce a number.
- A
- 16
What does the dot product produce, and how is it used in this discussion?
- A
It produces a number that can indicate similarity between the inputs
- B
It produces a vector that records the difference between the inputs
- C
It produces a matrix that contains all pairwise entry products
- D
It produces a direction that is unchanged by every transformation
Correct answer
AIt produces a number that can indicate similarity between the inputs
Explanation
The dot product produces a scalar rather than a vector and can serve as an indicator of how similar two vectors are.
- A
- 17
Which geometric intuition describes the dot product?
- A
It measures the distance between the tips of the two vectors
- B
It measures the number of entries that differ between the vectors
- C
It gives the angle between the vectors without using their lengths
- D
It relates to the length of one vector's projection onto the other
Correct answer
DIt relates to the length of one vector's projection onto the other
Explanation
Geometrically, the dot product is related to the length of one vector's shadow in the direction of the other; when the latter vector has length one, the shadow length is the dot product.
- A
- 18
What is the dot product of the one-hot encodings for two different words?
- A
Their dot product depends on the alphabetical order of the words
- B
Their dot product is one because each contains a one
- C
Their dot product is the number of zeros they share
- D
Their dot product is zero because their nonzero entries occupy different positions
Correct answer
DTheir dot product is zero because their nonzero entries occupy different positions
Explanation
Distinct one-hot vectors have their one in different positions, so every pair of corresponding entries includes at least one zero and the dot product is zero.
- A
- 19
Why might one-hot word vectors be inadequate for representing semantic similarity?
- A
They assign a larger dot product to “cat” and “apple” than to “cat” and “tiger”
- B
They capture semantic similarity only when words occur in the same article
- C
They encode “cat” and “tiger” identically because both are animals
- D
They assign zero dot product to both pairs, failing to reflect the closer relation between cats and tigers
Correct answer
DThey assign zero dot product to both pairs, failing to reflect the closer relation between cats and tigers
Explanation
One-hot encodings for “cat” and “tiger” have a dot product of zero just like “cat” and “apple,” so they fail to express the intuitive semantic relationship between cats and tigers.
- A
- 20
What is a vector embedding?
- A
A matrix that stores all vectors in the original space
- B
A duplicate of the original vector with a different label
- C
A replacement vector that lies in a smaller-dimensional space
- D
A vector with the same number of entries but different units
Correct answer
CA replacement vector that lies in a smaller-dimensional space
Explanation
An embedding replaces an original vector with another vector in a smaller-dimensional space, ideally giving a more useful representation.
- A
- 21
What is the main goal of replacing a data vector with an embedding?
- A
To replace all numerical data with categorical labels
- B
To create smaller vectors that preserve useful structure and meaning
- C
To ensure that every pair of data points has a zero dot product
- D
To expand every vector until it can encode every possible detail
Correct answer
BTo create smaller vectors that preserve useful structure and meaning
Explanation
Embeddings aim to compress high-dimensional representations into a smaller, more meaningful space that can address shortcomings of the original representation.
- A
- 22
Why should dimensional compression be performed carefully?
- A
Compression loses information, so it should be done without losing too much
- B
A valid embedding must preserve every detail of the original data
- C
A smaller vector is always more informative than a larger vector
- D
Compression can increase information if enough dimensions are removed
Correct answer
ACompression loses information, so it should be done without losing too much
Explanation
Compression inevitably loses some information, so an embedding should reduce dimensionality without discarding too much useful information.
- A
- 23
Which description of a matrix is supported by the discussion?
- A
A scalar that measures the similarity of two vectors
- B
A two-dimensional array that can represent a transformation of vectors
- C
A one-dimensional array whose entries must be all distinct
- D
A list of vectors that cannot change their directions
Correct answer
BA two-dimensional array that can represent a transformation of vectors
Explanation
A matrix is a two-dimensional array of numbers and can represent a process that takes an input vector to an output vector.
- A
- 24
What does it mean to view a matrix as a transformation of an entire vector space?
- A
A matrix acts only on a single selected vector and leaves all others undefined
- B
A matrix can change vector lengths but never their directions
- C
A matrix changes only the labels attached to vectors
- D
A matrix applies a transformation rule to vectors throughout a space
Correct answer
DA matrix applies a transformation rule to vectors throughout a space
Explanation
A matrix transformation can stretch, rotate, or scale a vector, and its rule applies to the surrounding vectors in the space as well.
- A
- 25
What dimension condition is needed to multiply two matrices in order?
- A
The first matrix's number of rows must equal the second matrix's number of columns
- B
The first matrix's number of columns must equal the second matrix's number of rows
- C
The two matrices must have the same number of rows
- D
The two matrices must have the same number of columns
Correct answer
BThe first matrix's number of columns must equal the second matrix's number of rows
Explanation
For a product of two matrices to be defined, the number of columns in the first matrix must equal the number of rows in the second.
- A
- 26
What is the central idea behind matrix factorization?
- A
It seeks matrices whose product reconstructs the given matrix
- B
It finds a vector whose dot product with the matrix is zero
- C
It identifies the entries of a matrix that are missing
- D
It changes a matrix into a vector by stacking its rows
Correct answer
AIt seeks matrices whose product reconstructs the given matrix
Explanation
Factorization reverses the usual direction of multiplication: given a matrix, one seeks matrices whose product gives the original matrix.
- A
- 27
What does the singular value decomposition provide for a matrix?
- A
Singular value decomposition converts every matrix into a single vector
- B
Singular value decomposition factors a matrix into three structured matrices
- C
Singular value decomposition represents every matrix as a sum of two scalars
- D
Singular value decomposition factors a matrix only when it is square
Correct answer
BSingular value decomposition factors a matrix into three structured matrices
Explanation
The singular value decomposition expresses a matrix as a product of three structured matrices.
- A
- 28
Which properties describe the matrices in the singular value decomposition as presented?
- A
The middle matrix is diagonal, and the outer matrices have orthonormal rows or columns
- B
The middle matrix is orthogonal and the outer matrices are arbitrary
- C
All three matrices are diagonal and contain only nonzero entries
- D
The outer matrices contain identical rows and columns
Correct answer
AThe middle matrix is diagonal, and the outer matrices have orthonormal rows or columns
Explanation
In the SVD description, the middle matrix is diagonal, while the other matrices have rows or columns that are unit vectors and mutually orthogonal.
- A
- 29
What does orthonormality mean for a collection of vectors?
- A
They have arbitrary lengths and identical directions
- B
They have equal lengths and positive dot products with one another
- C
They have length one and distinct vectors have dot product zero
- D
They have length zero and are parallel to one another
Correct answer
CThey have length one and distinct vectors have dot product zero
Explanation
Orthonormal vectors have length one and are mutually orthogonal, meaning the dot product between distinct vectors in the set is zero.
- A
- 30
How can matrix factorization provide candidate vector embeddings?
- A
Rows or columns of the factor matrices can provide candidate embeddings
- B
Only the diagonal entries of the original matrix are embeddings
- C
The product of the factors is always a one-hot encoding
- D
The original matrix's column count is the embedding itself
Correct answer
ARows or columns of the factor matrices can provide candidate embeddings
Explanation
Rows or columns of matrices in a factorization can serve as candidate embeddings, with fewer entries than the original representations.
- A
- 31
How is a user-by-movie interaction matrix organized?
- A
Rows represent ratings, columns represent movies, and entries list recommendations
- B
Rows represent users, columns represent movies, and entries record interactions
- C
Rows represent movies, columns represent ratings, and entries list users
- D
Rows represent features, columns represent users, and entries list genres
Correct answer
BRows represent users, columns represent movies, and entries record interactions
Explanation
In a user-by-movie matrix, rows correspond to users and columns correspond to movies; an entry can indicate whether a user watched a movie.
- A
- 32
In the user–movie matrix, how can an individual user or movie be represented before factorization?
- A
A user's representation is the average of all movie columns
- B
A user's row and a movie's column can each be read as a vector
- C
A user's representation contains only movies they have not watched
- D
A movie's representation is the list of its titles
Correct answer
BA user's row and a movie's column can each be read as a vector
Explanation
A user's row and a movie's column in the interaction matrix provide naive vector representations based on observed interactions.
- A
- 33
What are latent features in this context?
- A
Features explicitly entered as labels before any data is collected
- B
Features that are removed because they cannot be measured
- C
Hidden characteristics in the data that a representation can bring to light
- D
The numerical entries that are known to be missing
Correct answer
CHidden characteristics in the data that a representation can bring to light
Explanation
Latent features are hidden characteristics in the data that a learned lower-dimensional representation can help reveal, such as audience age or movie style.
- A
- 34
How can user and movie embeddings reflect a pattern such as a child being interested in “Shrek”?
- A
The embeddings preserve the original interaction vectors exactly and cannot show similarity
- B
The embeddings use only movie titles and ignore observed interactions
- C
The embeddings can place a user and a relevant movie close together in a latent space
- D
The embeddings assign identical vectors to every user and every movie
Correct answer
CThe embeddings can place a user and a relevant movie close together in a latent space
Explanation
In collaborative filtering, factor matrices can produce lower-dimensional vectors for users and movies; their placement can reflect patterns such as a child's affinity for a movie appealing to younger audiences.
- A
- 35
What is the purpose of factor matrices in the user–movie embedding example?
- A
The factor matrices' product approximately reconstructs the interaction matrix
- B
The factor matrices are used only to sort the movies alphabetically
- C
The factor matrices' product gives an exact label for each user's age
- D
The factor matrices' product removes all relationships between users and movies
Correct answer
AThe factor matrices' product approximately reconstructs the interaction matrix
Explanation
In the example, the matrix product of the factor matrices is intended to approximate the original user–movie matrix, and their rows or columns provide candidate embeddings.
- A
- 36
How can a neural network be used to obtain a vector embedding?
- A
It outputs only a matrix and never a vector
- B
It returns the same input vector without processing it
- C
It converts every input vector directly into a dot product
- D
It can transform an original data vector into a candidate embedding
Correct answer
DIt can transform an original data vector into a candidate embedding
Explanation
A neural network can take an original representation as input and output another vector that serves as a candidate embedding.
- A
- 37
What is the relationship between neural networks and linear algebra described here?
- A
They contain no matrices and are unrelated to linear algebra
- B
They are a type of one-hot encoding for numerical data
- C
They may contain many matrices as well as components beyond linear algebra
- D
They consist only of matrix factorizations and no other operations
Correct answer
CThey may contain many matrices as well as components beyond linear algebra
Explanation
Neural networks contain matrices but can also contain other components, so their full operation goes beyond linear algebra alone and connects to deep learning.
- A
- 38
What defines an eigenvector of a matrix transformation?
- A
A vector whose length and direction must both remain unchanged
- B
A vector that becomes perpendicular to itself after transformation
- C
A vector that changes direction but keeps the same length
- D
A vector that is scaled without changing direction under a transformation
Correct answer
DA vector that is scaled without changing direction under a transformation
Explanation
An eigenvector is a vector whose direction remains unchanged under a matrix transformation, although its length may be scaled.
- A
- 39
What is the eigenvalue associated with an eigenvector?
- A
The direction of the eigenvector after transformation
- B
The number of rows in the matrix
- C
The dot product between every pair of matrix columns
- D
The scalar by which the eigenvector is scaled
Correct answer
DThe scalar by which the eigenvector is scaled
Explanation
The eigenvalue is the scalar amount by which the corresponding eigenvector is scaled by the transformation.
- A
- 40
Why are eigenvectors useful in data science, in addition to their geometric meaning?
- A
They can reveal useful information about the structure of data
- B
They identify all missing entries in a data matrix
- C
They ensure every data point has the same value
- D
They encode only the labels used to classify data
Correct answer
AThey can reveal useful information about the structure of data
Explanation
Eigenvectors can encode valuable information about data, beyond their geometric interpretation as vectors whose direction is preserved under a transformation.
- A
- 41
How can a collection of data points be organized for a dimensionality-reduction analysis?
- A
Each data point is a scalar, and all scalars are placed on a diagonal
- B
Each data point is a matrix, and the matrices are combined by addition
- C
Each data point is a vector, and the vectors can be stacked into a matrix
- D
Each data point is an eigenvalue, and the values form a vector
Correct answer
CEach data point is a vector, and the vectors can be stacked into a matrix
Explanation
A data point in an m-dimensional space can be represented as a vector with m entries, and multiple data-point vectors can be stacked into a matrix.
- A
- 42
What does it mean for data to cluster along a lower-dimensional structure?
- A
Clustering can occur only when the ambient space has two dimensions
- B
Data may cluster along a lower-dimensional structure inside a larger space
- C
A line of clustered points must be represented in a one-dimensional ambient space
- D
Data points always fill the entire ambient space uniformly
Correct answer
BData may cluster along a lower-dimensional structure inside a larger space
Explanation
Data may occupy a lower-dimensional structure, such as a line within a two-dimensional space, even though it is represented in a larger ambient space.
- A
- 43
Why might one seek the line or subspace along which data points are clustered?
- A
It lets analysis focus on the smaller space where the data is concentrated
- B
It guarantees that every data point can be discarded
- C
It increases the number of dimensions needed to represent the data
- D
It prevents the data from having any identifiable structure
Correct answer
AIt lets analysis focus on the smaller space where the data is concentrated
Explanation
Finding the subspace containing the data can help focus analysis and resources on the smaller space in which relevant patterns occur.
- A
- 44
Which matrix is examined for eigenvectors in the described dimensionality-reduction approach?
- A
It finds eigenvectors by adding each row to the next
- B
It examines eigenvectors of a square matrix formed using the data matrix and its transpose
- C
It examines the eigenvectors of the original data matrix only
- D
It examines the dot products of all data points without forming a matrix
Correct answer
BIt examines eigenvectors of a square matrix formed using the data matrix and its transpose
Explanation
The procedure examines eigenvectors of a matrix such as the data matrix multiplied by its transpose, rather than simply taking eigenvectors of the original rectangular data matrix.
- A
- 45
Why is the data matrix combined with its transpose in this approach?
- A
The product ensures the data matrix has no repeated entries
- B
The data matrix must be diagonal before its eigenvectors are found
- C
The transpose removes all of the data points' dimensions
- D
The product with the transpose is square, which allows eigenvector analysis
Correct answer
DThe product with the transpose is square, which allows eigenvector analysis
Explanation
Eigenvectors are defined for square matrices, so multiplying the data matrix by its transpose provides a square matrix suitable for this analysis.
- A
- 46
What preprocessing steps are mentioned as statistical aspects of the analysis?
- A
Subtract the largest value from every column and square the matrix
- B
Replace each data point with its nearest neighboring point
- C
Sort each row and replace its entries with their ranks
- D
Subtract each row's mean and scale the matrix by a constant
Correct answer
DSubtract each row's mean and scale the matrix by a constant
Explanation
The statistical preparation may include centering the data by subtracting the mean of each row and scaling the matrix by a constant.
- A
- 47
In the described example, what does the eigenvector with the largest eigenvalue indicate?
- A
The eigenvector with the smallest eigenvalue always indicates the data's mean
- B
The eigenvector with the largest eigenvalue indicates the principal direction
- C
The eigenvector with the largest eigenvalue identifies the number of data points
- D
The eigenvector with the largest eigenvalue is perpendicular to the data's structure
Correct answer
BThe eigenvector with the largest eigenvalue indicates the principal direction
Explanation
The eigenvector with the largest eigenvalue points in the direction along which the data is most strongly clustered in the described setting.
- A
- 48
What is the principal direction of a dataset in this example?
- A
The average value of all entries in the data matrix
- B
The direction in which every vector has zero length
- C
The smallest space that can contain all possible vectors
- D
The direction along which the data is clustered
Correct answer
DThe direction along which the data is clustered
Explanation
The principal direction, also called the principal eigenvector in this discussion, identifies the direction along which the data is clustered.
- A
- 49
What is the name of the method associated with finding the principal direction of data?
- A
Singular value encoding
- B
Principal component analysis
- C
One-hot factorization
- D
Feature-space projection
Correct answer
BPrincipal component analysis
Explanation
The described eigenvector-based method for finding principal directions is called principal component analysis.
- A
- 50
What are potential benefits of reducing dimensionality when relevant data occupies only part of a larger space?
- A
It can improve efficiency, save resources, and reveal relevant data structure
- B
It removes meaningful structure to make datasets easier to store
- C
It preserves every possible feature and necessarily increases computational cost
- D
It ensures that all observations become identical after compression
Correct answer
AIt can improve efficiency, save resources, and reveal relevant data structure
Explanation
Working in a smaller space can increase efficiency, save resources, and reveal relevant structure in data that occupies only part of a larger ambient space.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.