Skip to content

Commit a4c782a

Browse files
Fix bug in MLZ Homework1 Q7 weight equation formatting (#7)
* Add EOL escape to fix eq formatting * More EOL escape to fix formatting * Remove spaces in equations * Place equation on separate lines to center, hopefully... * Add EOL escapes back in to see if it centers eqs * Put $ back on same line, add blank lines * Revert to previous state that worked ok * Add new lines back in, remove slashes, fingers crossed... * Equation formatting looks good, add missing comma
1 parent 7757d2a commit a4c782a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

_questions/machine-learning-zoomcamp/module-1-homework/008_y97mg42O7d_homework-q7-what-do-the-weights-represent.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ question: 'Homework Q7: What do the weights represent?'
44
sort_order: 8
55
---
66

7-
The weight vector, `w`, contains the coefficients for a linear model fit between the target variable, `y`, and the input features in `X`, with the model estimate of `y`, `y_est` defined as follows:
8-
$$ y_{est} = w[0]*X[0] + w[1]*X[1] $$
7+
The weight vector, `w`, contains the coefficients for a linear model fit between the target variable, `y`, and the input features in `X`, with the model estimate of `y`, `y_est`, defined as follows:
8+
9+
$$y_{est} = w[0]*X[0] + w[1]*X[1]$$
10+
911
where the values in brackets refer to each column of the feature matrix, `X`, and the corresponding row of the weight vector, `w`. Each value in `w` describes the slope of the trend line that fits `y` the best for each feature. As we'll learn in Module 2, least squares yields a "best" fit that minimizes the squared difference between `y` and `y_est`. The weights, `w`, can be checked to see if they're reasonable by multiplying `X` by the weight vector, `w`:
10-
$$ y_{est} = X.dot(w) $$
12+
13+
$$y_{est} = X.dot(w)$$
14+
1115
This should produce a vector, `y_est` that is similar, plus or minus some error, to the original target variable, `y`.

0 commit comments

Comments
 (0)