annotate core/tools/machine_learning/cvpartition_alltrain.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 % ---
Daniel@0 2 % fake partitioning for comparison
Daniel@0 3 % to stober08:
Daniel@0 4 % ---
Daniel@0 5 classdef cvpartition_alltrain
Daniel@0 6
Daniel@0 7 properties (Hidden)
Daniel@0 8
Daniel@0 9 mtest;
Daniel@0 10 mtraining;
Daniel@0 11 end
Daniel@0 12 properties
Daniel@0 13 N;
Daniel@0 14 NumTestSets;
Daniel@0 15 TrainSize;
Daniel@0 16 TestSize;
Daniel@0 17 end
Daniel@0 18
Daniel@0 19
Daniel@0 20 methods
Daniel@0 21
Daniel@0 22 % ---
Daniel@0 23 % constuctor: directly calculates the truncated testset
Daniel@0 24 % ---
Daniel@0 25 function P = cvpartition_alltrain(nData, nRuns)
Daniel@0 26
Daniel@0 27 P.NumTestSets = nRuns;
Daniel@0 28 P.N = nData;
Daniel@0 29
Daniel@0 30 % build training and test sets
Daniel@0 31 for i = 1:P.NumTestSets
Daniel@0 32 P.TrainSize(i) = nData;
Daniel@0 33 P.TestSize(i) = nData;
Daniel@0 34 P.mtraining{i} = ones(P.N, 1);
Daniel@0 35 P.mtest{i} = ones(P.N, 1);
Daniel@0 36 end
Daniel@0 37 end
Daniel@0 38
Daniel@0 39 function out = test(P, i)
Daniel@0 40
Daniel@0 41 out = P.mtest{i};
Daniel@0 42 end
Daniel@0 43
Daniel@0 44 function out = training(P, i)
Daniel@0 45
Daniel@0 46 out = P.mtraining{i};
Daniel@0 47 end
Daniel@0 48
Daniel@0 49 end
Daniel@0 50 end