diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/tools/machine_learning/cvpartition_alltrain.m	Tue Feb 10 15:05:51 2015 +0000
@@ -0,0 +1,50 @@
+% ---
+% fake partitioning for comparison 
+% to stober08:
+% ---
+classdef cvpartition_alltrain
+  
+properties (Hidden)
+
+    mtest;
+    mtraining;
+end
+properties
+    N;
+    NumTestSets;
+    TrainSize;
+    TestSize;
+end
+    
+        
+methods 
+    
+% ---
+% constuctor: directly calculates the truncated testset
+% ---
+function P = cvpartition_alltrain(nData, nRuns)
+    
+    P.NumTestSets = nRuns;
+    P.N = nData; 
+
+    % build training and test sets
+    for i = 1:P.NumTestSets
+        P.TrainSize(i) = nData;
+        P.TestSize(i) = nData;
+        P.mtraining{i} = ones(P.N, 1);
+        P.mtest{i} = ones(P.N, 1);
+    end
+end
+
+function out = test(P, i)
+
+    out = P.mtest{i};
+end
+
+function out = training(P, i)
+
+    out = P.mtraining{i};
+end
+
+end  
+end
\ No newline at end of file