Changeset 137 for prdatasets/hepatitis.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/hepatitis.m

    r132 r137  
    11%HEPATITIS 155 objects with 19 features in 2 classes
    22%
    3 %             X = HEPATITIS
     3%             A = HEPATITIS
    44%
    55% The hepatitis database from UCI to predict if the patient will live or
    66% die.
    77%
    8 %             X = HEPATITIS(VAL)
     8%             A = HEPATITIS(VAL)
    99%
    1010% By default objects with missing values are removed. When something else
    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 = hepatitis(val);
     18function a = hepatitis(val)
    1919
    20 prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/hepatitis.dat');
    2120if nargin<1
    22         val = 'remove';
     21  val = 'remove';
    2322end
    2423
    25 user.desc = 'The hepatitis database from UCI to predict if the patient will live or die.';
    26 user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/hepatitis/';
    27 cl = {'die' 'live'};
    28 fl = {'age' 'sex' 'steroid' 'antivirals' 'fatigue' 'malaise' ...
    29 'anorexia' 'liver big' 'liver firm' 'spleen palpable' 'spiders' ...
    30 'ascites' 'varices' 'bilirubin' 'alk phosphate' 'sgot' 'albumin' ...
    31 'protime' 'histology'};
    32 
    33 a = load('hepatitis.dat');
    34 x = pr_dataset(a(:,2:end),cl(a(:,1)));
    35 x = setfeatlab(x,fl);
    36 x = setname(x,'Hepatitis');
    37 [x,msg] = misval(x,val);
    38 user.desc = [user.desc msg];
    39 x = setuser(x,user);
     24a = pr_loadmatfile;
     25if isempty(a)
     26  opt.delimeter = ' ';
     27  opt.labfeat   = 1;
     28  opt.featnames = {'age' 'sex' 'steroid' 'antivirals' 'fatigue' 'malaise' ...
     29    'anorexia' 'liver big' 'liver firm' 'spleen palpable' 'spiders' ...
     30    'ascites' 'varices' 'bilirubin' 'alk phosphate' 'sgot' 'albumin' ...
     31    'protime' 'histology'};
     32  opt.classnames = {'die' 'live'};
     33  opt.desc = 'The hepatitis database from UCI to predict if the patient will live or die.';
     34  user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/hepatitis/';
     35  opt.dsetname = 'Hepatitis Data Set';
     36  a = pr_download('http://prtools.tudelft.nl/prdatasets/hepatitis.dat',[],opt);
     37end
     38a = misval(a,val);
Note: See TracChangeset for help on using the changeset viewer.