20180603 Packages used in this chapter include C50 (Kuhn and Quinlan 2023), RWeka (Hornik 2023), party (Hothorn et al. 2023), partykit (Hothorn and Zeileis 2023), rpart (Therneau and Atkinson 2022), rpart.plot (Milborrow 2022), and rattle (G. Williams 2023).
Packages are loaded into the currently running R session from your
local library directories on disk. Missing packages can be installed
using utils::install.packages() within R. On Ubuntu, for
example, R packages can also be installed using
$ wajig install r-cran-<pkgname>.
# Load required packages from local library into the R session. library(C50) # Original C5.0 implementation. library(RWeka) # Weka decision tree J48. library(party) # Conditional decision trees ctree(). library(partykit) # Convert rpart object to BinaryTree library(rattle) # GUI for building trees and fancy tree plot. library(rpart) # Popular decision tree algorithm. library(rpart.plot) # Enhanced tree plots.
<- "weatherAUS" dsname <- get(dsname) ds <- nrow(ds) nobs <- names(ds) vnames %<>% clean_names(numerals="right") ds names(vnames) <- names(ds) <- names(ds) vars <- "rain_tomorrow" target <- c(target, vars) %>% unique() %>% rev()vars
It is always useful to remind ourselves of the dataset with a random sample:
%>% sample_frac() %>% select(date, location, sample(3:length(vars), 5))ds
## # A tibble: 226,868 × 7 ## date location evaporation pressure_3pm min_temp wind_speed_3pm temp_9am ## <date> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 2023-02-08 Launces… NA NA 14.8 19 16.3 ## 2 2014-07-19 Penrith NA NA 5.8 15 12 ## 3 2017-09-25 Melbour… 7.4 1011. 9.3 30 11.2 ## 4 2014-07-23 Mildura 1.8 1017. 2.7 20 5 ....
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0