Changeset 137 for prdatasets/heart.m
- Timestamp:
- 12/18/19 15:46:35 (5 years ago)
- Location:
- prdatasets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
prdatasets
- Property svn:ignore
-
old new 3 3 *.data 4 4 *.asv 5 data
-
- Property svn:ignore
-
prdatasets/heart.m
r132 r137 11 11 % is desired, use one of the options in MISVAL. 12 12 % 13 % SEE ALSO <a href="http:// prtools.tudelft.nl/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>13 % SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a> 14 14 % PRTOOLS, DATASETS, MISVAL 15 15 16 % Copyright: R.P.W. Duin 16 % Copyright: R.P.W. Duin, r.p.w.duin@37steps.com 17 17 18 function x= heart(val)18 function a = heart(val) 19 19 20 prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/heart.dat');21 20 if nargin<1 22 21 val = 'remove'; 23 22 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'}; 30 fd = {[0 inf; 0 inf] [0 1] [1 2 3 4] [0 inf; 0 inf] [0 inf; 0 inf] ... 23 a = pr_loadmatfile; 24 if isempty(a) 25 opt.labfeat = 14; 26 opt.featnames = {'age' 'sex' 'cp' 'trestbps' 'chol' 'fbs' 'restecg' ... 27 'thalach' 'exang' 'oldpeak' 'slope' 'ca' 'thal'}; 28 opt.classnames = {'absent' 'present' 'present' 'present' 'present'}; 29 opt.desc='The Cleveland database from the Heart Disease Databases from UCI. The class disease-presence is used as target class. '; 30 opt.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/heart-cleveland/'; 31 opt.dsetname = 'Heart Cleveland'; 32 a = pr_download('http://prtools.tudelft.nl/prdatasets/heart.dat',[],opt); 33 nlab = getnlab(a); 34 nlab(nlab>1) = 2; 35 a = setnlab(a,nlab); 36 a = remclass(a); 37 fd = {[0 inf; 0 inf] [0 1] [1 2 3 4] [0 inf; 0 inf] [0 inf; 0 inf] ... 31 38 [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 33 a = load('heart.dat'); 34 lab = (a(:,end)>0); 35 x = pr_dataset(a(:,1:(end-1)),cl(lab+1)); 36 x = setfeatlab(x,fl); 37 x = setname(x,'Heart Cleveland'); 38 x = setfeatdom(x,fd); 39 [x,msg] = misval(x,val); 40 user.desc = [user.desc msg]; 41 x = setuser(x,user); 39 x = setfeatdom(a,fd); 40 pr_savematfile(a); 41 end 42 [a,msg] = misval(a,val); 42 43 43 44 return
Note: See TracChangeset
for help on using the changeset viewer.