source: prdatasets/heart.m @ 90

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