Line | |
---|
1 | %HEART 303 objects with 13 features in 2 classes |
---|
2 | % |
---|
3 | % X = HEART; |
---|
4 | % |
---|
5 | % Heart-Cleveland dataset from the Hungarian Institute of Cardiology. |
---|
6 | % Budapest: Andras Janosi, M.D. |
---|
7 | % |
---|
8 | % X = HEART(VAL); |
---|
9 | % |
---|
10 | % Per default the missing values are replaced by -1. When you want to |
---|
11 | % do something else, use one of the options in missingvalues.m. |
---|
12 | function x = heart(val) |
---|
13 | |
---|
14 | prdatasets(mfilename,1,'http://prtools.org/prdatasets/heart.dat'); |
---|
15 | if nargin<1 |
---|
16 | val = 'remove'; |
---|
17 | end |
---|
18 | |
---|
19 | user.desc='The Cleveland database from the Heart Disease Databases from UCI. The class disease-presence is used as target class. '; |
---|
20 | user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/heart-cleveland/'; |
---|
21 | cl = {'absent' 'present'}; |
---|
22 | fl = {'age' 'sex' 'cp' 'trestbps' 'chol' 'fbs' 'restecg' ... |
---|
23 | 'thalach' 'exang' 'oldpeak' 'slope' 'ca' 'thal'}; |
---|
24 | fd = {[0 inf; 0 inf] [0 1] [1 2 3 4] [0 inf; 0 inf] [0 inf; 0 inf]... |
---|
25 | [0 1] [0 1 2] [0 inf; 0 inf] [0 1] [0 inf; 0 inf] [1 2 3] [-1 0 1 2 3] [3 6 7]}; |
---|
26 | |
---|
27 | a = load('heart.dat'); |
---|
28 | lab = (a(:,end)>0); |
---|
29 | x = pr_dataset(a(:,1:(end-1)),cl(lab+1)); |
---|
30 | x = setfeatlab(x,fl); |
---|
31 | x = setname(x,'Heart Cleveland'); |
---|
32 | x = setfeatdom(x,fd); |
---|
33 | [x,msg] = prmissingvalues(x,val); |
---|
34 | user.desc = [user.desc msg]; |
---|
35 | x = setuser(x,user); |
---|
36 | |
---|
37 | return |
---|
Note: See
TracBrowser
for help on using the repository browser.