Learn R Programming

evtree (version 1.0-2)

StatlogHeart: Statlog Heart

Description

Models of this data predict the absence or presence of heart disease.

Usage

data("StatlogHeart")

Arguments

Format

A data frame containing 270 observations on 14 variables.

Source

The dataset has been taken from the UCI Repository Of Machine Learning Databases at http://archive.ics.uci.edu/ml/.

Details

The use of a cost matrix is suggested for this dataset. It is worse to class patients with heart disease as patients without heart disease (cost = 5), than it is to class patients without heart disease as having heart disease (cost = 1).

Examples

Run this code
data("StatlogHeart")
summary(StatlogHeart)
shw <- array(1, nrow(StatlogHeart))
shw[StatlogHeart$heart_disease == "presence"] <- 5
set.seed(1090)
sht <- evtree(heart_disease ~ . , data = StatlogHeart, weights = shw) 
sht
table(predict(sht), StatlogHeart$heart_disease)
plot(sht)

Run the code above in your browser using DataLab