Description Usage Format Source References See Also Examples
Artificial data set concerning the conditions suitable for playing some unspecified game.
1 | data("WeatherPlay")
|
A data frame containing 14 observations on 5 variables.
factor.
numeric.
numeric.
factor.
factor.
Table 1.3 in Witten and Frank (2011).
Witten IH, Frank E (2011). Data Mining: Practical Machine Learning Tools and Techniques. 3rd Edition, Morgan Kaufmann, San Francisco.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## load weather data
data("WeatherPlay", package = "partykitR1")
WeatherPlay
## construct simple tree
pn <- partynode(1L,
split = partysplit(1L, index = 1:3),
kids = list(
partynode(2L,
split = partysplit(3L, breaks = 75),
kids = list(
partynode(3L, info = "yes"),
partynode(4L, info = "no"))),
partynode(5L, info = "yes"),
partynode(6L,
split = partysplit(4L, index = 1:2),
kids = list(
partynode(7L, info = "yes"),
partynode(8L, info = "no")))))
pn
## couple with data
py <- party(pn, WeatherPlay)
## print/plot/predict
print(py)
plot(py)
predict(py, newdata = WeatherPlay)
## customize printing
print(py,
terminal_panel = function(node) paste(": play=", info_node(node), sep = ""))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.