Skip to content

Commit 499d391

Browse files
Ed RubinEd Rubin
Ed Rubin
authored and
Ed Rubin
committed
fix old-exam link
1 parent f337852 commit 499d391

File tree

5 files changed

+112
-1
lines changed

5 files changed

+112
-1
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ lecture/01*
77
projects/project*
88

99
# Exams
10-
exam/*
10+
exam/exam*
1111

1212
# Project-specific files
1313

exam/past-class/inclass-23.pdf

28 KB
Binary file not shown.

exam/past-class/inclass-24.pdf

32.7 KB
Binary file not shown.

exam/past-home/home-23.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# 524/424 Final Exam: Take-Home Portion
2+
3+
## Big picture
4+
5+
You are going to build a few statistical models to predict individual babies' birthweights using a host of parental data.
6+
7+
## Data
8+
9+
The data (contained in [`data-final.csv`](https://github.com/edrubin/EC524W23/blob/master/exam/take-home/data-final.csv)) come from a random subset of 10,000 births in the United States during 2021.
10+
11+
*Note:* If you're having trouble downloading the file with the link above, try [this link](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/edrubin/EC524W23/blob/626cf8b30a770055c04ea48174f67f1441bf8ee5/exam/take-home/data-final.csv) or download it from Canvas.
12+
13+
I downloaded the data from the [National Bureau of Economic Research (NBER)'s server](https://www.nber.org/research/data/vital-statistics-natality-birth-data). They provide a nice [codebook](https://data.nber.org/nvss/natality/code/nat2021us.html).
14+
15+
The original data come from the [CDC's National Vital Statistics System (NVSS)](https://www.cdc.gov/nchs/nvss/birth_methods.htm#anchor_1551744577970), which also has a [nice codebook](https://www.cdc.gov/nchs/data_access/vitalstatsonline.htm) (see the *User's Guide* for 2021).
16+
17+
You are going to be predicting `dbwt` (dry birthweight) using the 224 other variables in the dataset. Make sure you at least skim the codebook: some of the variables are going to be more helpful than others. You will also find that some are missing many observations—and you probably do not want always want to impute the missing values.
18+
19+
**Warning:** Because there are 10,000 observations and many predictors, some of your models may take a little while to run. Be careful with how many hyperparameters you are trying... and which ones you try.
20+
21+
## Tasks
22+
23+
**[01]** (10 points) **Visualize** Read through the codebooks (linked above) to get a sense of the dataset's features. Once you understand the variables: Create three visualizations of the data that show some interesting insights.
24+
25+
- *Why?* You should always visualize your data—both before and after analyzing your data. Start the exam by making a few figures to understand the data. You can always make better figures after you finish the other steps.
26+
- *What* Your figures should be well labeled and aesthetically pleasing.
27+
28+
**[02]** (10 points) **Old-fashioned linear regression** Now run a regression with several variables that you anticipate will be important for predicting birthweight. Report your cross-validated estimate for test performance (let's stick with MSE).
29+
30+
*Questions:*
31+
32+
- Does this linear-regression model seem good?
33+
- Does it seem like you did a good job of choosing variables?
34+
35+
**[03]** (10 points) **New-fashioned linear regression** Now try a penalized version of linear regression. Again, report your CV-based MSE.
36+
37+
*Questions*
38+
39+
- Did the penalized model beat your OLS model?
40+
- Did the penalized model choose similar variables to your OLS model?
41+
42+
**[04]** (10 points) **Going nonlinear** Try an ensemble of trees—either random forest or boosted trees. Report your CV-based MSE.
43+
44+
*Bonus:* Does the ensemble "value" the same variables as the penalized model (in terms of variable importance)?
45+
46+
**[05]** (10 points) **Summary**
47+
48+
- Which model performed best? Would you say it is *significantly* better than the other models? Explain your answer.
49+
- Does the best model's type (OLS, penalized regression, tree ensemble) suggest anything about this setting? Explain.
50+

exam/past-home/home-24.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# 524/424 Final Exam: Take-Home Portion
2+
3+
## Admin
4+
5+
### Optional
6+
7+
As discussed in class, this portion of the exam is **optional**. If you choose not to submit this portion, your grade for the final-exam will be based solely on the in-class portion. If you submit this exam, it will count for 25% of your final-exam grade.
8+
9+
### Academic honesty
10+
11+
You **are not** allowed to work with anyone else. Working with *anyone* else will be considered cheating. You will receive a zero for **both** parts of the final exam and will fail the class.
12+
13+
You *can* use online materials (including ChatGPT and Copilot), books, notes, solutions, *etc*. However, you still must put all of your answers **in your own words**. Copying other people's (and chatbots') words is also considered cheating.
14+
15+
Ngan and Ed **will not** help you debug your code. Please do not ask.
16+
17+
### Instructions
18+
19+
**Due** Upload your answers to [Canvas](https://canvas.uoregon.edu/) *before* 10:15 **am** (Pacific) on Friday, 14 June 2024.
20+
21+
**Important** You **must** submit your answers as an HTML or PDF file, built from an RMarkdown (`.RMD`) or Quarto (`.qmd`) file (you can also submit a link to an HTML page if you prefer that route).
22+
23+
## Prompts
24+
25+
Let's end where we began: [predicting house prices](https://www.kaggle.com/c/house-prices-advanced-regression-techniques/) (as we did in the first two problem sets). Specifically, let's see if you can beat your old score using all of your fancy new prediction knowledge and ML skills.
26+
27+
## Getting started
28+
29+
**[01]** (10 points) **Visualize** Make sure you remember all of the variables in the dataset. Once you understand/recall the variables: Create three visualizations of the data that show some interesting insights. These figures should be publication quality: well labeled, aesthetically pleasing, and insightful.
30+
31+
*Why?* Visualization is good practice—you should always visualize your data before and after analyzing it. Start the exam by making a few figures to understand the data. You can always make better figures after you finish the other steps.
32+
33+
**[02]** (10 points) **Better regression?** In the past we used fairly simplistic imputation approaches for missing data. This time, use a more "sophisticated" approach for imputation. Then run a your original regression model. Predict onto the test set and and report your score.
34+
35+
*Questions:*
36+
37+
- Did the fancier imputation approach improve your model?
38+
- Why would "better" imputation matter?
39+
40+
**[03]** (10 points) **Better-er regression?** Repeat **[02]** but this time use a lasso regression model. Report your score.
41+
42+
*Questions:*
43+
44+
- Did this approach improve your model?
45+
- Did the lasso model choose similar variables to your OLS model?
46+
47+
**[04]** (10 points) **Going nonlinear?** Now use a random forest for the prediction. You need to tune it. Also: Keep the variable importance scores.
48+
49+
*Questions:*
50+
51+
- Which hyperparameters did you tune?
52+
- Did the random forest beat your penalized regression model? Report your score.
53+
- Did the variable importance from the random forest match the variables chosen by your penalized regression model?
54+
55+
**[05]** (10 points) **Summary** Answer the following questions:
56+
57+
- Which model performed best?
58+
- Would you say the "best" model is *significantly* better than the other models? Explain your answer.
59+
- What could make your model better?
60+
61+
**[Bonus]** (Optional; 5 points) Use a (tuned) boosted tree model. Report your score and compare it to the other models.

0 commit comments

Comments
 (0)