source: prdatasets/heart.m @ 133

Last change on this file since 133 was 132, checked in by bduin, 5 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%
[132]13% SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
[94]14% PRTOOLS, DATASETS, MISVAL
15
[132]16% Copyright: R.P.W. Duin
[94]17
[80]18function x = heart(val)
19
[127]20prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/heart.dat');
[80]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'};
[122]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]};
[80]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.