cmu-delphi / cmu-delphi/epipredict

bug: can't predict identity transformation on grad student employ dataset

Open
#450 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
18
Forks
13
Avg merge
21d 58m
Merged PRs (30d)
1

Description

Ran across this when testing Yeo Johnson. Dug down into lm and as far as I can tell, x and y are the same vector, but for some reason lm fits a model with a large negative constant offset (when it should be 0) and a coefficient of 1 (which is correct). Didn't dig further, since I wanted to focus on YJ.

```r
filtered_data <- epidatasets::grad_employ_subset
r <- epi_recipe(filtered_data) %>%
step_epi_lag(med_income_2y, lag = 0) %>%
step_epi_ahead(med_income_2y, ahead = 0, role = "outcome") %>%
step_epi_naomit()
f <- frosting() %>%
layer_predict()
wf <- epi_workflow(r, linear_reg()) %>%
fit(filtered_data) %>%
add_frosting(f)

# These should be the same (you can try this with another datsaset like JHU
out1 <- filtered_data %>% as_tibble()
out2 <- forecast(wf) %>% rename(med_income_2y = .pred)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.