Prev: Reading large file and sorting
Next: please can any one post the matlab script for these s•generate 100 random number or use the test data provided by the standard;• write Convolution Encoder using MATLAB script; Then you need to verifythe Convolution Encoder by • call
From: Artur Stoppa on 19 Jan 2010 14:33 I have a code : % testowanie bazy glass.data % glass.data - http://archive.ics.uci.edu/ml/ Data = load('glass.data', '-ascii'); Data(:,1) = []; [NumOfRows, NumOfCols] = size (Data); Classes = Data(:,NumOfCols); Data(:,NumOfCols) = []; MainSet = dataset(Data,Classes); clear Data; MAXT = 95; % maksymalna liczba klasyfikatorów TSTART = 5; TSTEP = 10; ITERATIONS = 10; Result = []; VoteResult = []; AvgVoteResult = zeros((MAXT + TSTART) / TSTEP, 2); % podział na zbiór uczący i testowy [LearnSet, TestSet, LI, TI] = gendat(MainSet,0.8); [NumOfRows, NumOfCols] = size (LearnSet); [tsNumOfClasses, tmp] = size(getlablist(TestSet)); Learning = LearnSet * treec; Testing = TestSet * Learning; Error1 = Testing * testc; Error1 for iter = 1:ITERATIONS VoteResult = []; for j = TSTART:TSTEP:MAXT LearnedClassifiers = cell (1,1); k = 0; for i = 1:j % utwórz zbiór uczący (losujac ze zwracaniem z LearnSet) NewSetIndices = betarnd(2,2,NumOfRows,1); NewSetIndices = round(NumOfRows.*NewSetIndices); NewSetIndices(find (NewSetIndices == 0)) = 1; NewSetIndices(find (NewSetIndices > NumOfRows)) = NumOfRows; NewSetLabels = getlab(LearnSet); NewLearnSet = dataset(LearnSet.data(NewSetIndices,:),NewSetLabels(NewSetIndices)); % w całym procesie biorą udział zbiory o jednakowej liczbie klas [NumOfClasses, tmp] = size(getlablist(NewLearnSet)); if (NumOfClasses == tsNumOfClasses) k = k + 1; % LearnSets{1,i} = NewLearnSet; %zagregowanie zbiorów uczących w cell array (opcjonalne) % Uczymy klasyfikator i dodajemy do zbioru LearningTmp = NewLearnSet * treec; LearnedClassifiers{1,k} = LearningTmp;%NewLearnSet * treec; % badanie jakości klasyfikatora wylosowanego (stopa błędu) %TestingTmp = TestSet * LearningTmp; %ErrorT = TestingTmp * testc; %ResultVector = [j, i, ErrorT]; %Result = [Result; [j, i, ErrorT]]; end; % ewentualne uwzględnianie jakości klasyfikatora przy wyborze do % komitetu % if 0.7*ErrorT > Error1 %sprintf('Błąd klasyfikatora %d większy od błędu klasyfikatora pierwotnego\nNie bierze udziału w głosowaniu', i) % else % VotingLearnSets {1,i} = NewLearnSet; %sprintf('AAAAAAAAAAAAAAAAAAA') % end; end; % testowanie decyzji grupowej komitetu (klasyfikatory kombinowane % votec) VALL = [LearnedClassifiers{:}]; VC = VALL * votec; Testing = TestSet * VC; ErVote = Testing * testc; % zebranie wartości błędów w macierz VoteResult = [VoteResult; [j, ErVote]]; end; AvgVoteResult(:,2) = AvgVoteResult(:,2) + VoteResult(:,2); %AvgVoteResult = [AvgVoteResult VoteResult(:,2)]; end; AvgVoteResult(:,1) = VoteResult(:,1); AvgVoteResult(:,2) = AvgVoteResult(:,2) / ITERATIONS; when i run that , I only see : " PR_Warning: getprior: testc: No priors found in dataset, class frequencies are used instead PR_Warning: getprior: testc: No priors found in dataset, class frequencies are used instead PR_Warning: getprior: testc: No priors found in dataset, class frequencies are used instead PR_Warning: getprior: testc: No priors found in dataset, class frequencies are used instead " I have this program from my friend - he said to me that he worked. I have to do : "The quality of classifiers, after the passage through bugging, set against with the quality of primitive classifiers"
|
Pages: 1 Prev: Reading large file and sorting Next: please can any one post the matlab script for these s•generate 100 random number or use the test data provided by the standard;• write Convolution Encoder using MATLAB script; Then you need to verifythe Convolution Encoder by • call |