Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhuig committed Mar 19, 2024
1 parent e5d5411 commit 5ab5e2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
5 changes: 3 additions & 2 deletions vignettes/TwoGroup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ mimic <- mimic %>%
# Use 700 labels to train the mimic
train_data <- mimic %>% filter(row_number() <= 700)
# Fit a random forest model
rf_model <- randomForest(factor(day_28_flg) ~ ., data = train_data, seed = 123)
set.seed(123)
rf_model <- randomForest(factor(day_28_flg) ~ ., data = train_data, ntree = 100)
# Test the model on the remaining data
test_data <- mimic %>% filter(row_number() > 700)
Expand All @@ -97,7 +98,7 @@ We choose threshold = 0.41 so that the overall FPR is around 5%.
cut_off <- 0.41
test_data %>%
mutate(pred = ifelse(pred > 0.41, 1, 0)) %>%
mutate(pred = ifelse(pred > cut_off, 1, 0)) %>%
filter(day_28_flg == 0) %>%
summarise(fpr = mean(pred))
```
Expand Down
19 changes: 0 additions & 19 deletions vignettes/groupfairness.Rmd

This file was deleted.

0 comments on commit 5ab5e2b

Please sign in to comment.