Multi-Output Linear Prediction
- 13Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
When extending linear prediction from one input to multiple inputs, how is the input data typically represented?
When extending linear prediction from one input to multiple inputs, how is the input data typically represented?
13 questions
- 1
When extending linear prediction from one input to multiple inputs, how is the input data typically represented?
- A
As a matrix with rows representing samples and columns representing features
- B
As a vector of length equal to the number of samples
- C
As a single scalar value repeated for each feature
- D
As a list of separate vectors, one per feature
Correct answer
AAs a matrix with rows representing samples and columns representing features
Explanation
Multiple inputs are organized into a matrix where each row is a sample and each column is a feature (dimension). This allows the model to handle multiple input variables simultaneously.
- A
- 2
If you have one input variable but want multiple output variables, what approach is recommended?
- A
Use a matrix multiplication with a single set of weights
- B
Use a single function that outputs a vector directly
- C
Concatenate all outputs into one variable and treat as a single output
- D
Use separate prediction formulas for each output
Correct answer
DUse separate prediction formulas for each output
Explanation
The content explains that for one input and multiple outputs, you can simply use multiple different formulas (functions) to generate each output from the same input.
- A
- 3
In the linear regression formulation with multiple inputs, why is a column of ones added to the input matrix X?
- A
To normalize the feature values
- B
To make the matrix invertible
- C
To account for the bias term (y-intercept)
- D
To increase the number of features for better accuracy
Correct answer
CTo account for the bias term (y-intercept)
Explanation
The column of ones allows the model to learn an intercept term (bias) when multiplied by the corresponding weight w0​. This is analogous to the y-intercept in simple linear regression.
- A
- 4
What does the weight w0​ represent in the linear regression model with a column of ones?
- A
The slope for the first feature
- B
The bias or y-intercept term
- C
The weight for the first output variable
- D
The coefficient for the first original feature
Correct answer
BThe bias or y-intercept term
Explanation
The first weight w0​ is multiplied by the constant 1 from the column of ones, so it acts as the bias or y-intercept. It sets the baseline prediction when all other features are zero.
- A
- 5
What is the typical loss function used to evaluate the error in linear regression?
- A
Root mean squared error
- B
Mean squared error
- C
Cross-entropy loss
- D
Mean absolute error
Correct answer
BMean squared error
Explanation
The content explicitly uses mean squared error (MSE) as the error measure, defined as the average of squared differences between predicted and actual values.
- A
- 6
How is the optimal weight matrix W found in linear regression?
- A
By solving W=(XTX)−1XTY
- B
By iteratively adjusting weights using gradient descent
- C
Both A and B are correct
- D
By taking the gradient of the error and setting it to zero
Correct answer
CBoth A and B are correct
Explanation
The normal equation W=(XTX)−1XTY is derived by setting the gradient of the mean squared error with respect to W to zero and solving. Both descriptions are valid; the gradient method leads to the closed-form solution.
- A
- 7
In the normal equation W=(XTX)−1XTY, what are the dimensions of XTX?
- A
d×d
- B
n×n
- C
n×d
- D
d×n
Correct answer
Ad×d
Explanation
X is n×d, so XT is d×n, and XTX is d×d. The content emphasizes that this is a small, compact matrix regardless of the number of samples n.
- A
- 8
If X has d=5 features and Y has m=3 outputs, what is the shape of the weight matrix W?
- A
5×3
- B
3×3
- C
5×5
- D
3×5
Correct answer
A5×3
Explanation
The normal equation yields W with dimensions d×m. With 5 features and 3 outputs, W is 5×3.
- A
- 9
In the code example, what was the bias term w0​ for the credit score prediction?
- A
3.7
- B
149
- C
426
- D
-60
Correct answer
C426
Explanation
From the computed W in the example, w0​=426 is the bias term (constant offset). The other values are coefficients for age, years with employer, and income respectively.
- A
- 10
In the machine learning framework described, what does the function g(x) represent?
- A
The error function between predicted and actual values
- B
The learned prediction function used to output y
- C
The ideal, perfect prediction function
- D
The actual function that generates the data
Correct answer
BThe learned prediction function used to output y
Explanation
The content defines g(x) as the function we learn from training data to predict y. It is an approximation of the ideal function f(x).
- A
- 11
According to the content, in the machine learning process, what is the role of training data?
- A
To define the perfect function f(x)
- B
To directly compute the outputs for new inputs
- C
To discard unusable features
- D
To learn the function g(x) that approximates the true relationship
Correct answer
DTo learn the function g(x) that approximates the true relationship
Explanation
Training data (known x and y) is used to learn the parameters of g(x), so that later it can make predictions on unseen data.
- A
- 12
In the linear regression example, what is the interpretation of the weight for 'years with current employer' being 149?
- A
For each additional year with the employer, credit score decreases by 149 points
- B
For each additional year with the employer, credit score increases by 149 points
- C
Years with employer are not important for credit score
- D
Employees with more years have a base credit score of 149
Correct answer
BFor each additional year with the employer, credit score increases by 149 points
Explanation
The content states that for every year worked with the current employer, you gain 149 credit points, indicating a positive coefficient.
- A
- 13
What does the content suggest about using library functions for linear regression with multiple inputs and outputs?
- A
They cannot handle multiple outputs simultaneously
- B
They can handle matrices, making the code identical to the single-variable case
- C
They only work with numpy
- D
They require separate code for each additional variable
Correct answer
BThey can handle matrices, making the code identical to the single-variable case
Explanation
The content shows that the same library function can accept matrices for X and Y, so the code for multiple inputs/outputs is essentially identical to the simple case.
- A

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