source: prdatasets/heart.m @ 95

Last change on this file since 95 was 94, checked in by bduin, 10 years ago
File size: 1.4 KB
RevLine 
[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]18function x = heart(val)
19
20prdatasets(mfilename,1,'http://prtools.org/prdatasets/heart.dat');
21if nargin<1
22        val = 'remove';
23end
24
25user.desc='The Cleveland database from the Heart Disease Databases from UCI.  The class disease-presence is used as target class. ';
26user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/heart-cleveland/';
27cl = {'absent' 'present'};
28fl = {'age' 'sex' 'cp' 'trestbps' 'chol' 'fbs' 'restecg' ...
29        'thalach' 'exang' 'oldpeak' 'slope' 'ca' 'thal'};
30fd = {[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]};
32
33a = load('heart.dat');
34lab = (a(:,end)>0);
[81]35x = pr_dataset(a(:,1:(end-1)),cl(lab+1));
[80]36x = setfeatlab(x,fl);
37x = setname(x,'Heart Cleveland');
38x = setfeatdom(x,fd);
[94]39[x,msg] = misval(x,val);
[80]40user.desc = [user.desc msg];
41x = setuser(x,user);
42
43return
Note: See TracBrowser for help on using the repository browser.