Select Git revision
PcInfection_test4.m
PcInfection_test4.m 7.50 KiB
% Developed by ASA Salgadoe (asalgado@myune.edu.au, surantha_a@yahoo.com)
% on 29/10/2019
% new test of choosing wl that can classify the healthy and control
% PLSR (diamention REduction) + LDA or QDA for classification
% ############################################
load('allDAI.mat');
% col1: week, col2:trt , col3 onwards:spectral
% for Pc infected
wls=allDAI(1,3:end);
dataSet=allDAI(2:end,:);
cat=dataSet(:,1:2);
% remove first few spectra (for noise removal)
% subset the wl 400 onwards
loc400=find(wls==400);
wls=wls(:,loc400:end);
% All sampled data col1-treeId, col2-group, col3 onwards-bands
% RAW spectra
spec=dataSet(:,3:end);
spec=spec(:,loc400:end);
dataClean=[cat,spec];
dataClean=sortrows(dataClean,1);
% % % 1st method analyse as helathy vs dis groups
% % % 2nd method analyse as healthy vs dis per each week
% % for 1st method
% grp_trt=dataSet(:,2:end);
% grp_trt=sortrows(grp_trt,1);
% for 2nd method
% DAI codes 1,2,3,4,5,6,7
grp_trt=dataClean(find(dataSet(:,1)==7),2:end);
grp_trt=sortrows(grp_trt,1);
% % % % % for water stressed#############
% % % % load('glassH_WS_26_9_2017_s3.mat')
% % % % dataWS=glassH_WS_26_9_2017_s3;
% % % % wls=dataWS(1,3:end);
% % % % dataSetW=dataWS(2:end,:);
% % % % catW=dataSetW(:,2);
% % % %
% % % % % remove first few spectra (for noise removal)
% % % % % subset the wl 400 onwards
% % % % loc400=find(wls==400);
% % % % wls=wls(:,loc400:end);
% % % %
% % % % % All sampled data col1-treeId, col2-group, col3 onwards-bands
% % % % % RAW spectra
% % % % specW=dataSetW(:,3:end);
% % % % specW=specW(:,loc400:end);
% % % % dataCleanW=[catW,specW];
% % % % dataCleanW=sortrows(dataCleanW,1);
% % % % grp_trt=dataCleanW;
% % % % grp_trt=sortrows(grp_trt,1);
% #####################################
% asignment of X and Y
x=grp_trt(:,2:end); %spectra
y=grp_trt(:,1);%categories