Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
608 B
3
Indexable
Never
set.seed(48103)
as_tibble(bc_data) %>%
  mutate(Diagnosis = factor(case_when(Diagnosis == 0 ~ "B",  Diagnosis == 1 ~ "M"), 
                            levels = c("B", "M"), labels = c("Benign", "Malignant"))) %>%
  ggplot(aes(x = feature_8, color = Diagnosis)) + 
  geom_density(aes(fill = Diagnosis), alpha = 0.2) + 
  geom_jitter(aes(y = 0, pch = Diagnosis), size = 1) + 
  scale_color_aaas() + 
  scale_fill_aaas() + 
  theme_bw() +  
  theme(legend.position = "bottom") + 
  labs(y = "Density curves for feature_8") + 
  geom_vline(xintercept = 0.0485, linetype = "dashed", size = 1, color = "black")
 
Leave a Comment