You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
340B

  1. library(tidyverse)
  2. # Classification
  3. data(iris)
  4. (
  5. iris %>%
  6. ggplot() +
  7. aes(x = Petal.Width, y = Sepal.Width, color = Species) +
  8. geom_point()
  9. ) %>%
  10. ggsave(plot = ., filename = "classif.png")
  11. library(rpart)
  12. rpart(Species ~ ., data = iris) %T>%
  13. plot(branch = .5, margin = .5) %>%
  14. text(use.n = T, all = T, pretty = T, fancy = T)