Skip to main content

Currently Skimming:


Pages 223-233

The Chapter Skim interface presents what we've algorithmically identified as the most significant single chunk of text within every page in the chapter.
Select key terms on the right to highlight them within pages of the chapter.


From page 223...
... Appendix B Matlab Programs for Contaminant Classification This appendix contains the Matlab1 programs that were used to conduct the classification exercises described in Chapter 5 of this report. class_init.m -- initialization code lin_class.m -- code to train a linear classifier nn_class.m -- code to train a neural network classifier class_error.m -- code for error analysis lin_predict.m -- code to predict classification using the linear classifier nn_predict.m -- code to predict classification using the neural network classifier % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % NRC Committee on Drinking Water Contaminants % Filename: class_init.m % Matlab code to initialize the classification problem.
From page 224...
... S=load(‘caldata.txt') ; % the name of the calibration data file id=S(:,1)
From page 225...
... subplot (5,5,i) , plot (X1 (: , i)
From page 226...
... set (gca, ‘LineWidth', 1) if i==5 text (-3, 0, str(5)
From page 227...
... % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % NRC Committee on Drinking Water Contaminants % Filename: nn_class.m % Matlab code to build a neural network classifier on the training data set. % After this, run class_error.m and nn_predict.m.
From page 228...
... net.b{i} net.layers{i}.transferFcn end end y=sim(net,X')
From page 229...
... Nmisclass=[Nmisclass Nmc] ; %The total number misclassified e00=N0mc/sum(idxZero)
From page 230...
... else thresh=threshes; end sthresh=size(thresh) ; if sthresh(2)
From page 231...
... h=findobj (gca, ‘Type', ‘patch') ; set (h, ‘LineWidth', 2)
From page 232...
... % End of program % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -% -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -% NRC Committee on Drinking Water Contaminants % Filename: lin_predict.m % Matlab code to predict classification for test cases using linear classifier. % Run this after running lin_class.m and class_error.m.
From page 233...
... SP=load (‘testdata.txt') ; % the name of the data file containing test cases idP=SP(: , 1)

Key Terms



This material may be derived from roughly machine-read images, and so is provided only to facilitate research.
More information on Chapter Skim is available.