Changeset 137 for prdatasets/heart.m


Ignore:
Timestamp:
12/18/19 15:46:35 (5 years ago)
Author:
bduin
Message:
 
Location:
prdatasets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • prdatasets

    • Property svn:ignore
      •  

        old new  
        33*.data
        44*.asv
         5data
  • prdatasets/heart.m

    r132 r137  
    1111% is desired, use one of the options in MISVAL.
    1212%
    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>
    1414% PRTOOLS, DATASETS, MISVAL
    1515
    16 % Copyright: R.P.W. Duin
     16% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
    1717
    18 function x = heart(val)
     18function a = heart(val)
    1919
    20 prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/heart.dat');
    2120if nargin<1
    2221        val = 'remove';
    2322end
    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] ...
     23a = pr_loadmatfile;
     24if 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] ...
    3138      [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);
     41end
     42[a,msg] = misval(a,val);
    4243
    4344return
Note: See TracChangeset for help on using the changeset viewer.