Skip to content

Commit

Permalink
Change bullet points to numbers (DataTalksClub#243)
Browse files Browse the repository at this point in the history
Change bullet points to numbers in questions 6 and 7, where an order is implied.
  • Loading branch information
Ksyula authored Sep 8, 2022
1 parent 98c853d commit 5ed2211
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions course-zoomcamp/cohorts/2022/01-intro/homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ How many columns in the dataset have missing values?

### Question 6

* Find the median value of "Engine Cylinders" column in the dataset.
* Next, calculate the most frequent value of the same "Engine Cylinders".
* Use the `fillna` method to fill the missing values in "Engine Cylinders" with the most frequent value from the previous step.
* Now, calculate the median value of "Engine Cylinders" once again.
1. Find the median value of "Engine Cylinders" column in the dataset.
2. Next, calculate the most frequent value of the same "Engine Cylinders".
3. Use the `fillna` method to fill the missing values in "Engine Cylinders" with the most frequent value from the previous step.
4. Now, calculate the median value of "Engine Cylinders" once again.

Has it changed?

Expand All @@ -86,15 +86,15 @@ Has it changed?

### Question 7

* Select all the "Lotus" cars from the dataset.
* Select only columns "Engine HP", "Engine Cylinders".
* Now drop all duplicated rows using `drop_duplicates` method (you should get a dataframe with 9 rows).
* Get the underlying NumPy array. Let's call it `X`.
* Compute matrix-matrix multiplication between the transpose of `X` and `X`. To get the transpose, use `X.T`. Let's call the result `XTX`.
* Invert `XTX`.
* Create an array `y` with values `[1100, 800, 750, 850, 1300, 1000, 1000, 1300, 800]`.
* Multiply the inverse of `XTX` with the transpose of `X`, and then multiply the result by `y`. Call the result `w`.
* What's the value of the first element of `w`?
1. Select all the "Lotus" cars from the dataset.
2. Select only columns "Engine HP", "Engine Cylinders".
3. Now drop all duplicated rows using `drop_duplicates` method (you should get a dataframe with 9 rows).
4. Get the underlying NumPy array. Let's call it `X`.
5. Compute matrix-matrix multiplication between the transpose of `X` and `X`. To get the transpose, use `X.T`. Let's call the result `XTX`.
6. Invert `XTX`.
7. Create an array `y` with values `[1100, 800, 750, 850, 1300, 1000, 1000, 1300, 800]`.
8. Multiply the inverse of `XTX` with the transpose of `X`, and then multiply the result by `y`. Call the result `w`.
9. What's the value of the first element of `w`?

> **Note**: You just implemented linear regression. We'll talk about it in the next lesson.
Expand Down

0 comments on commit 5ed2211

Please sign in to comment.