Mercurial > hg > camir-aes2014
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 % --- | |
2 % fake partitioning for comparison | |
3 % to stober08: | |
4 % --- | |
5 classdef cvpartition_alltrain | |
6 | |
7 properties (Hidden) | |
8 | |
9 mtest; | |
10 mtraining; | |
11 end | |
12 properties | |
13 N; | |
14 NumTestSets; | |
15 TrainSize; | |
16 TestSize; | |
17 end | |
18 | |
19 | |
20 methods | |
21 | |
22 % --- | |
23 % constuctor: directly calculates the truncated testset | |
24 % --- | |
25 function P = cvpartition_alltrain(nData, nRuns) | |
26 | |
27 P.NumTestSets = nRuns; | |
28 P.N = nData; | |
29 | |
30 % build training and test sets | |
31 for i = 1:P.NumTestSets | |
32 P.TrainSize(i) = nData; | |
33 P.TestSize(i) = nData; | |
34 P.mtraining{i} = ones(P.N, 1); | |
35 P.mtest{i} = ones(P.N, 1); | |
36 end | |
37 end | |
38 | |
39 function out = test(P, i) | |
40 | |
41 out = P.mtest{i}; | |
42 end | |
43 | |
44 function out = training(P, i) | |
45 | |
46 out = P.mtraining{i}; | |
47 end | |
48 | |
49 end | |
50 end |