%HEART 303 objects with 13 features in 2 classes
%
% X = HEART
%
% Heart-Cleveland dataset from the Hungarian Institute of Cardiology.
% Budapest: Andras Janosi, M.D.
%
% X = HEART(VAL)
%
% By default objects with missing values are removed. When something else
% is desired, use one of the options in MISVAL.
%
% SEE ALSO PRTools Guide, UCI Website
% PRTOOLS, DATASETS, MISVAL
% Copyright: R.P.W. Duin, r.p.w.duin@prtools.org
function x = heart(val)
prdatasets(mfilename,1,'http://prtools.org/prdatasets/heart.dat');
if nargin<1
val = 'remove';
end
user.desc='The Cleveland database from the Heart Disease Databases from UCI. The class disease-presence is used as target class. ';
user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/heart-cleveland/';
cl = {'absent' 'present'};
fl = {'age' 'sex' 'cp' 'trestbps' 'chol' 'fbs' 'restecg' ...
'thalach' 'exang' 'oldpeak' 'slope' 'ca' 'thal'};
fd = {[0 inf; 0 inf] [0 1] [1 2 3 4] [0 inf; 0 inf] [0 inf; 0 inf]...
[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]};
a = load('heart.dat');
lab = (a(:,end)>0);
x = pr_dataset(a(:,1:(end-1)),cl(lab+1));
x = setfeatlab(x,fl);
x = setname(x,'Heart Cleveland');
x = setfeatdom(x,fd);
[x,msg] = misval(x,val);
user.desc = [user.desc msg];
x = setuser(x,user);
return