Rev | Line | |
---|
[80] | 1 | %HEART 303 objects with 13 features in 2 classes |
---|
| 2 | % |
---|
[94] | 3 | % X = HEART |
---|
[80] | 4 | % |
---|
| 5 | % Heart-Cleveland dataset from the Hungarian Institute of Cardiology. |
---|
| 6 | % Budapest: Andras Janosi, M.D. |
---|
| 7 | % |
---|
[94] | 8 | % X = HEART(VAL) |
---|
[80] | 9 | % |
---|
[94] | 10 | % By default objects with missing values are removed. When something else |
---|
| 11 | % is desired, use one of the options in MISVAL. |
---|
| 12 | % |
---|
| 13 | % SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a> |
---|
| 14 | % PRTOOLS, DATASETS, MISVAL |
---|
| 15 | |
---|
| 16 | % Copyright: R.P.W. Duin, r.p.w.duin@prtools.org |
---|
| 17 | |
---|
[80] | 18 | function x = heart(val) |
---|
| 19 | |
---|
| 20 | prdatasets(mfilename,1,'http://prtools.org/prdatasets/heart.dat'); |
---|
| 21 | if nargin<1 |
---|
| 22 | val = 'remove'; |
---|
| 23 | end |
---|
| 24 | |
---|
| 25 | user.desc='The Cleveland database from the Heart Disease Databases from UCI. The class disease-presence is used as target class. '; |
---|
| 26 | user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/heart-cleveland/'; |
---|
| 27 | cl = {'absent' 'present'}; |
---|
| 28 | fl = {'age' 'sex' 'cp' 'trestbps' 'chol' 'fbs' 'restecg' ... |
---|
| 29 | 'thalach' 'exang' 'oldpeak' 'slope' 'ca' 'thal'}; |
---|
[122] | 30 | fd = {[0 inf; 0 inf] [0 1] [1 2 3 4] [0 inf; 0 inf] [0 inf; 0 inf] ... |
---|
| 31 | [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]}; |
---|
[80] | 32 | |
---|
| 33 | a = load('heart.dat'); |
---|
| 34 | lab = (a(:,end)>0); |
---|
[81] | 35 | x = pr_dataset(a(:,1:(end-1)),cl(lab+1)); |
---|
[80] | 36 | x = setfeatlab(x,fl); |
---|
| 37 | x = setname(x,'Heart Cleveland'); |
---|
| 38 | x = setfeatdom(x,fd); |
---|
[94] | 39 | [x,msg] = misval(x,val); |
---|
[80] | 40 | user.desc = [user.desc msg]; |
---|
| 41 | x = setuser(x,user); |
---|
| 42 | |
---|
| 43 | return |
---|
Note: See
TracBrowser
for help on using the repository browser.