Final Exam Prep Flashcards
What is SLR?
simple linear regression
What is the equation for simple linear regression?
H(x) = w_0 + w_1x
What is the equation for the constant model?
H(x) = h
What is the ith observation?
(x_i, y_i)
What is H?
the hypothesis function, used to make predictions
What are summary statistics?
summarize a collection of numbers
What are examples of summary statistics?
mean, median
What is a loss function?
quantifies how bad a prediction is for a single data point
What is squared loss?
L_sq(y_i, H(x_i)) = (y_i - H(x_i))^2
What does y_i represent?
actual values
What does H(x_i) represent?
predicted values
What is R?
the average loss for all points
What is another name for R?
risk
What does MSE stand for?
mean squared error
What is the equation for MSE?
R_sq(h) = 1/n En i=1 (y_i - h)^2
What is our goal when calculating the MSE?
to find the h that minimizes R_sq(h)
What is the definition for MSE?
the average squares loss
What is the h in H(x) = h?
it is a parameter
If c(x) = a(x) + b(x), what is the derivative?
d/dx c(x) = d/dx a(x) + d/dx b(x)
What is the value that minimizes MSE?
the mean
What is the definition for convexitivity?
there is a minimum that is differentiable
What is steps does the modeling recipe consist of?
choose a model, choose a loss function, minimize average loss to find optimal model parameters.
What is does MAE stand for?
mean absolute error
What does the MAE calculate?
average absolute loss
What is the equation for MAE?
R_abs(h) = 1/n En i=1 |y_i - h|
What is the h that minimizes MAE?
the median
What can we say about our data R_abs(h*) is not unique?
n is even
How do we get a unique value for R_abs(h*)?
n has to be odd
_____ is sensitive to outliers!
mean
_____ is robust to outliers!
median
What is empirical risk minimization?
formal name for minimizing average loss
What minimizes Linfinity loss?
the midrange
What minimizes 0,1 loss?
the mode!
What is a feature?
an attribute of the data (columns)
What type of values can features be?
numerical, categorical, boolean
What happens when we make MSE zero?
we are overfitting to the data
Why is overfitting to our data bad?
because we want our model to generalize well to unseen data and make good predictions in the real world
What is an example of a quadratic regression equation?
H(x) = w_0 + w_1x^2
What is an example of an exponential regression equation?
H(x) = w_0e^w_1x
What is does w_0 represent?
intercept
What does w_1 represent?
slope
What is the equation for the loss surface?
R_sq(w_0, w_1) = 1/n En i=1 (y_i - (w_0 + w_1x_i))^2
What is the least squares solution for w_0?
(En i=1 (x_i - xbar)(y_i - ybar))/(En i=1 x_i - xbar)^2
What is the least squares solution for w_1?
ybar - w_1*xbar
What is the resulting line for the least squares solution?
the regression line
What does “fitting to the data mean”?
the process of finding optimal parameters
What equation would we use to make predictions?
H(x) = w_0 + w_1*x
What is r?
the correlation coefficient
What does the correlation coefficient measure?
the strength of the linear association of two variables
What is the range for r?
-1 < r < 1
What can we tell about our data is r is negative?
there is a negative association; left down to right
What can we tell about our data is r is positive?
there is a positive association, bottom left up to right
What happens the closer r is to + or -1?
the correlation is stronger in those areas
How do we calculate the standard deviation?
(x_i - mean) / (standard deviation of x)
How do we calculate r?
1/n En i=1 (x_i - mean of x / SD of X)(y_i - mean of y / SD of Y)
What happens as y spreads out?
SD of y increases and the slope gets steeper
What happens as x gets more spread out?
SD of x increases and slope gets more shallow
What is the equivalent of finding models that minimize MSE in terms of r?
finding models that maximize r^2
What is the equation for R_sq(w_0, w_1)?
(SD of y)^2 * (1-r^2)
What is a more flexible version of the constant model?
the simple linear regression model
What can be said if A and B are two matrices?
AB != BA
What is a vector?
an ordered collection of n number in R^n
What is another name for length of a vector?
the l_2 norm
What is the equation for the length of a vector?
||v|| = sqrt(v_1^2 + v_2^2 + … + v_n^2)
What do vectors have?
a magnitude and a direction
What is the dot product of two vectors?
uv = u_1v_1 + u_2 * v_2 ….
What is the result of the dot product?
a scalar
What is a scalar?
a single numebr
What is another way we can calculate the dot product?
||u||||v|| cos theta