Lecture 14 – HTTP Basics¶

DSC 80, Winter 2023¶

📣 Announcements¶

• Lab 5 is due on Monday, February 13th at 11:59PM.
• Lab 5 does not have any hidden tests – but the content is all on the Midterm Exam, so make sure you thoroughly understand it.
• The Midterm Exam is in-class, in-person on Wednesday, February 15th.
• Scope: Lectures 1-13 (including today's coverage of imputation), Labs 1-5, Projects 1-2.
• You can bring a single, two-sided note sheet.
• Review old exams at practice.dsc80.com.
• Look at this notebook for more examples of missingness.
• Lab 4's hidden test cases were updated 😊.

Agenda¶

• Recap: Imputation
• Introduction to HTTP.
• Making HTTP requests.
• Data formats.

Recap: Imputation¶

Mean imputation¶

Suppose the 'child' column has missing values.

• If 'child' is MCAR, then fill in each of the missing values using the mean of the observed values.
• If 'child' is MAR dependent on a categorical column, then fill in each of the missing values using the mean of the observed values in each category. For instance, if 'child' is MAR dependent on 'gender', we can fill in:
• missing female 'child' heights with the observed mean for female children, and
• missing male 'child' heights with the observed mean for male children.
• If 'child' is MAR dependent on a numerical column, then bin the numerical column to make it categorical, then follow the procedure above. See Lab 5, Question 5!
• Mean imputation, when done correctly, creates a distribution whose mean is an unbiased estimate of the true distribution's mean, but whose variance is an underestimate of the true variance.