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

    r132 r137  
    1313%
    1414% By default objects with missing values are removed. When something else
    15 % is desired, use one of the options in MISVAL for Val.
     15% is desired, use one of the options in MISVAL for VAL.
    1616%
    17 % SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
     17% SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
    1818% PRTOOLS, DATASETS, MISVAL
    1919
    20 % Copyright: R.P.W. Duin
     20% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
    2121
    22 function x = breast(val)
     22function a = breast(val)
    2323
    2424if nargin < 1, val = 'remove'; end
    25 %prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/breastorg.dat');
    2625
    27 a = pr_getdata('http://prtools.tudelft.nl/prdatasets/breastorg.dat',1);
    28 
    29 user.desc='The original database of the Wisconsin Breast Cancer Databases from UCI, containing 699 instances, collected between 1989 and 1991. ';
    30 user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/breast-cancer-wisconsin/';
    31 cl = {'benign' 'malignant'};
    32 fl = {'Clump Thickness' 'Uniformity of Cell Size' ...
    33 'Uniformity of Cell Shape' 'Marginal Adhesion' ...
    34 'Single Epithelial Cell Size' 'Bare Nuclei' 'Bland Chromatin' ...
    35 'Normal Nucleoli' 'Mitoses'};
    36 
    37 %a = load('breastorg.dat'); % Octave cannot find it
    38 %a = load(fullfile(fileparts(which(mfilename)),'breastorg.dat'));
    39 J = find(a==-1);
    40 a(J) = NaN;
    41 nlab = a(:,end)/2;   % the labels for the classes are (2,4), very strange
    42 x = pr_dataset(a(:,2:(end-1)), cl(nlab) );
    43 x = setfeatlab(x,fl);
    44 x = setname(x,'Breast Wisconsin');
    45 x = misval(x,val);
    46 x = setuser(x,user);
     26a = pr_loadmatfile;
     27if isempty(a)
     28  opt.delimeter = ',';
     29  opt.labfeat   = 11;
     30  opt.featnames = {'Clump Thickness' 'Uniformity of Cell Size' ...
     31    'Uniformity of Cell Shape' 'Marginal Adhesion' ...
     32    'Single Epithelial Cell Size' 'Bare Nuclei' 'Bland Chromatin' ...
     33    'Normal Nucleoli' 'Mitoses'};
     34  opt.feats = [2:10];
     35  opt.misvalue = -1;
     36  opt.classnames = {'benign' 'malignant'};
     37  opt.desc='The original database of the Wisconsin Breast Cancer Databases from UCI, containing 699 instances, collected between 1989 and 1991. ';
     38  opt.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/breast-cancer-wisconsin/';
     39  opt.dsetname = 'Breast Wisconsin';
     40  a = pr_download('http://prtools.tudelft.nl/prdatasets/breastorg.dat',[],opt);
     41end
     42a = misval(a,val);
    4743
    4844return
Note: See TracChangeset for help on using the changeset viewer.