Mercurial > hg > camir-aes2014
annotate core/tools/machine_learning/cvpartition_alltrain.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
rev | line source |
---|---|
wolffd@0 | 1 % --- |
wolffd@0 | 2 % fake partitioning for comparison |
wolffd@0 | 3 % to stober08: |
wolffd@0 | 4 % --- |
wolffd@0 | 5 classdef cvpartition_alltrain |
wolffd@0 | 6 |
wolffd@0 | 7 properties (Hidden) |
wolffd@0 | 8 |
wolffd@0 | 9 mtest; |
wolffd@0 | 10 mtraining; |
wolffd@0 | 11 end |
wolffd@0 | 12 properties |
wolffd@0 | 13 N; |
wolffd@0 | 14 NumTestSets; |
wolffd@0 | 15 TrainSize; |
wolffd@0 | 16 TestSize; |
wolffd@0 | 17 end |
wolffd@0 | 18 |
wolffd@0 | 19 |
wolffd@0 | 20 methods |
wolffd@0 | 21 |
wolffd@0 | 22 % --- |
wolffd@0 | 23 % constuctor: directly calculates the truncated testset |
wolffd@0 | 24 % --- |
wolffd@0 | 25 function P = cvpartition_alltrain(nData, nRuns) |
wolffd@0 | 26 |
wolffd@0 | 27 P.NumTestSets = nRuns; |
wolffd@0 | 28 P.N = nData; |
wolffd@0 | 29 |
wolffd@0 | 30 % build training and test sets |
wolffd@0 | 31 for i = 1:P.NumTestSets |
wolffd@0 | 32 P.TrainSize(i) = nData; |
wolffd@0 | 33 P.TestSize(i) = nData; |
wolffd@0 | 34 P.mtraining{i} = ones(P.N, 1); |
wolffd@0 | 35 P.mtest{i} = ones(P.N, 1); |
wolffd@0 | 36 end |
wolffd@0 | 37 end |
wolffd@0 | 38 |
wolffd@0 | 39 function out = test(P, i) |
wolffd@0 | 40 |
wolffd@0 | 41 out = P.mtest{i}; |
wolffd@0 | 42 end |
wolffd@0 | 43 |
wolffd@0 | 44 function out = training(P, i) |
wolffd@0 | 45 |
wolffd@0 | 46 out = P.mtraining{i}; |
wolffd@0 | 47 end |
wolffd@0 | 48 |
wolffd@0 | 49 end |
wolffd@0 | 50 end |