source: prdatasets/spectrometer.m

Last change on this file was 150, checked in by bduin, 5 years ago
File size: 1.7 KB
Line 
1%SPECTROMETER Part of the IRAS Low Resolution Spectrometer Database
2%PRTools UCI dataset import, 531 objects, 101 integer features, 10 classes
3%
4%  A = SPECTROMETER
5%
6%DESCRIPTION
7%This command downloads one of the UCI data sets, converts it into PRTools
8%format and stores it locally for future use. Consult the <a href="http://archive.ics.uci.edu/ml/datasets/Low+Resolution+Spectrometer">related website</a>
9%for further information. Please make the appropriate references in
10%publications that make use of this dataset.
11%
12%Refer to the dataset documentation before using this routine. The 
13%attributes 1 and 2 are removed (LRS name and LRS class). Consequently
14%featues 1-8 contain header information, feature 9-52 the blue band and
15%feature 53-101 the red band.
16%
17%Just the basic classes are used as class labels (floor of attribute_2/10).
18%There are five classes with a very few objects (1 2 6 7 and 6 objects).
19%Remove them by A = REMCLASS(A,N) with, e.g., N = 7.
20%
21%SEE ALSO <a href="http://prtools.tudelft.nl/prtools/">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
22%PRTOOLS, DATASETS, REMCLASS
23
24% Copyright: R.P.W. Duin
25
26function a = spectrometer
27
28a = pr_download_uci('Low+Resolution+Spectrometer','lrs.data');
29if size(a,1) ~= 531
30  % no proper mat-file yet, construct it from irregular dat-file
31  userdata = getuser(a,'data');
32  fid = fopen(pr_datfiles);
33  s = fread(fid);
34  s([s==40 | s==41 | s==10]) = [];
35  t = textscan(char(s'),['%s' repmat('%n',1,102)]);
36  a = prdataset([t{3:end}],ceil(t{2}/10));
37  a = setname(a,'Low Resolution Spectrometer');
38  a = setuser(a,userdata,'data');
39  pr_savematfile(a);
40  fclose(fid);
41end
42
43
44
Note: See TracBrowser for help on using the repository browser.