
Data of married women who were either not pregnant or do not know if they were at the time of interview. The task is to predict the women's current contraceptive method choice (no use, long-term methods, short-term methods) based on her demographic and socio-economic characteristics.
data("ContraceptiveChoice")
A data frame containing 1,437 observations on 10 variables.
wife's age in years.
ordered factor indicating the wife's education, with levels "low"
, "medium-low"
, "medium-high"
and "high"
.
ordered factor indicating the wife's education, with levels "low"
, "medium-low"
, "medium-high"
and "high"
.
number of children.
binary variable indicating the wife's religion, with levels "non-Islam"
and "Islam"
.
binary variable indicating if the wife is working.
ordered factor indicating the husbands occupation, with levels "low"
, "medium-low"
, "medium-high"
and "high"
.
standard of living index with levels "low"
, "medium-low"
, "medium-high"
and "high"
.
binary variable indicating media exposure, with levels "good"
and "not good"
.
factor variable indicating the contraceptive method used, with levels "no-use"
, "long-term"
and "short-term"
.
Lim, T.-S., Loh, W.-Y. & Shih, Y.-S. (1999). A Comparison of Prediction Accuracy, Complexity, and Training Time of Thirty-three Old and New Classification Algorithms. Machine Learning, 40(3), 203--228.
# NOT RUN {
data("ContraceptiveChoice")
summary(ContraceptiveChoice)
# }
# NOT RUN {
suppressWarnings(RNGversion("3.5.0"))
set.seed(1090)
contt <- evtree(contraceptive_method_used ~ . , data = ContraceptiveChoice)
contt
table(predict(contt), ContraceptiveChoice$contraceptive_method_used)
plot(contt)
# }
Run the code above in your browser using DataLab