Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs	(revision 2161)
@@ -34,7 +34,4 @@
 namespace HeuristicLab.GP.StructureIdentification.Classification {
   public class OffspringSelectionGP : HeuristicLab.GP.StructureIdentification.OffspringSelectionGP, IClassificationAlgorithm {
-    protected override IOperator CreateProblemInjector() {
-      return new ProblemInjector();
-    }
 
     protected override IOperator CreateBestSolutionProcessor() {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs	(revision 2161)
@@ -35,8 +35,4 @@
 namespace HeuristicLab.GP.StructureIdentification.Classification {
   public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, IClassificationAlgorithm {
-    protected override IOperator CreateProblemInjector() {
-      return new ProblemInjector();
-    }
-
     protected override IOperator CreateBestSolutionProcessor() {
       IOperator seq = base.CreateBestSolutionProcessor();
@@ -50,6 +46,6 @@
         AccuracyEvaluator trainingAccuracy = new AccuracyEvaluator();
         trainingAccuracy.GetVariableInfo("Accuracy").ActualName = "TrainingAccuracy";
-        trainingAccuracy.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-        trainingAccuracy.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+        trainingAccuracy.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+        trainingAccuracy.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
 
         AccuracyEvaluator validationAccuracy = new AccuracyEvaluator();
@@ -65,6 +61,6 @@
         ConfusionMatrixEvaluator trainingConfusionMatrix = new ConfusionMatrixEvaluator();
         trainingConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TrainingConfusionMatrix";
-        trainingConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-        trainingConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+        trainingConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+        trainingConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
 
         ConfusionMatrixEvaluator validationConfusionMatrix = new ConfusionMatrixEvaluator();
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs	(revision 2161)
@@ -35,4 +35,17 @@
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
   public class OffspringSelectionGP : HeuristicLab.GP.StructureIdentification.OffspringSelectionGP, ITimeSeriesAlgorithm {
+    public override IOperator ProblemInjector {
+      get {
+        CombinedOperator algo = (CombinedOperator)Engine.OperatorGraph.InitialOperator;
+        return algo.OperatorGraph.InitialOperator.SubOperators[1];
+      }
+      set {
+        CombinedOperator algo = (CombinedOperator)Engine.OperatorGraph.InitialOperator;
+        algo.OperatorGraph.InitialOperator.RemoveSubOperator(1);
+        value.Name = "ProblemInjector";
+        algo.OperatorGraph.InitialOperator.AddSubOperator(value, 1);
+      }
+    }
+
     protected override IOperator CreateFunctionLibraryInjector() {
       return new FunctionLibraryInjector();
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs	(revision 2161)
@@ -35,4 +35,17 @@
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
   public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, ITimeSeriesAlgorithm {
+    public override IOperator ProblemInjector {
+      get {
+        CombinedOperator algo = (CombinedOperator)Engine.OperatorGraph.InitialOperator;
+        return algo.OperatorGraph.InitialOperator.SubOperators[1];
+      }
+      set {
+        CombinedOperator algo = (CombinedOperator)Engine.OperatorGraph.InitialOperator;
+        algo.OperatorGraph.InitialOperator.RemoveSubOperator(1);
+        value.Name = "ProblemInjector";
+        algo.OperatorGraph.InitialOperator.AddSubOperator(value, 1);
+      }
+    }
+    
     protected override IOperator CreateFunctionLibraryInjector() {
       return new FunctionLibraryInjector();
@@ -61,6 +74,6 @@
         SequentialProcessor seq = new SequentialProcessor();
         TheilInequalityCoefficientEvaluator trainingTheil = new TheilInequalityCoefficientEvaluator();
-        trainingTheil.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-        trainingTheil.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+        trainingTheil.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+        trainingTheil.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
         trainingTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = "TrainingTheilInequalityCoefficient";
         trainingTheil.GetVariableInfo("TheilInequalityCoefficientBias").ActualName = "TrainingTheilInequalityCoefficientBias";
@@ -69,6 +82,6 @@
 
         TheilInequalityCoefficientEvaluator validationTheil = new TheilInequalityCoefficientEvaluator();
-        validationTheil.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
-        validationTheil.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
+        validationTheil.GetVariableInfo("SamplesStart").ActualName = "ActualValidationSamplesStart";
+        validationTheil.GetVariableInfo("SamplesEnd").ActualName = "ActualValidationSamplesEnd";
         validationTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = "ValidationTheilInequalityCoefficient";
         validationTheil.GetVariableInfo("TheilInequalityCoefficientBias").ActualName = "ValidationTheilInequalityCoefficientBias";
@@ -77,6 +90,6 @@
 
         TheilInequalityCoefficientEvaluator testTheil = new TheilInequalityCoefficientEvaluator();
-        testTheil.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
-        testTheil.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
+        testTheil.GetVariableInfo("SamplesStart").ActualName = "ActualTestSamplesStart";
+        testTheil.GetVariableInfo("SamplesEnd").ActualName = "ActualTestSamplesEnd";
         testTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = "TestTheilInequalityCoefficient";
         testTheil.GetVariableInfo("TheilInequalityCoefficientBias").ActualName = "TestTheilInequalityCoefficientBias";
@@ -85,6 +98,6 @@
 
         SimpleEvaluator trainingEvaluator = new SimpleEvaluator();
-        trainingEvaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-        trainingEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+        trainingEvaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+        trainingEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
         trainingEvaluator.GetVariableInfo("Values").ActualName = "PredictedValuesTraining";
 
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/AlgorithmBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/AlgorithmBase.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/AlgorithmBase.cs	(revision 2161)
@@ -65,9 +65,9 @@
 
     public virtual IOperator ProblemInjector {
-      get { return algorithm.SubOperators[0]; }
+      get { return algorithm.SubOperators[1]; }
       set {
         value.Name = "ProblemInjector";
-        algorithm.RemoveSubOperator(0);
-        algorithm.AddSubOperator(value, 0);
+        algorithm.RemoveSubOperator(1);
+        algorithm.AddSubOperator(value, 1);
       }
     }
@@ -155,6 +155,6 @@
       MeanSquaredErrorEvaluator evaluator = new MeanSquaredErrorEvaluator();
       evaluator.GetVariableInfo("MSE").ActualName = "Quality";
-      evaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      evaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      evaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      evaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       evaluator.Name = "Evaluator";
 
@@ -165,6 +165,6 @@
       LeftReducer cleanUp = new LeftReducer();
 
+      seq.AddSubOperator(randomInjector);
       seq.AddSubOperator(problemInjector);
-      seq.AddSubOperator(randomInjector);
       seq.AddSubOperator(globalInjector);
       seq.AddSubOperator(funLibInjector);
@@ -465,5 +465,5 @@
       // SequentialProcessor in GP
       algorithm = (SequentialProcessor)co1.OperatorGraph.InitialOperator;
-      return (RandomInjector)algorithm.SubOperators[1];
+      return (RandomInjector)algorithm.SubOperators[0];
     }
 
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs	(revision 2161)
@@ -96,4 +96,13 @@
     }
 
+    public override IOperator ProblemInjector {
+      get { return base.ProblemInjector.SubOperators[0]; }
+      set {
+        value.Name = "ProblemInjector";
+        base.ProblemInjector.RemoveSubOperator(0);
+        base.ProblemInjector.AddSubOperator(value, 0);
+      }
+    }
+
     public StandardGP()
       : base() {
@@ -113,5 +122,16 @@
 
     protected internal override IOperator CreateProblemInjector() {
-      return new ProblemInjector();
+      SequentialProcessor seq = new SequentialProcessor();      
+      var probInject = new ProblemInjector();
+      probInject.GetVariableInfo("MaxNumberOfTrainingSamples").Local = true;
+      probInject.AddVariable(new HeuristicLab.Core.Variable("MaxNumberOfTrainingSamples", new IntData(5000)));
+
+      var shuffler = new DatasetShuffler();
+      shuffler.GetVariableInfo("ShuffleStart").ActualName = "TrainingSamplesStart";
+      shuffler.GetVariableInfo("ShuffleEnd").ActualName = "TrainingSamplesEnd";
+
+      seq.AddSubOperator(probInject);
+      seq.AddSubOperator(shuffler);
+      return seq;
     }
 
@@ -200,4 +220,5 @@
     protected internal override IOperator CreateBestSolutionProcessor() {
       SequentialProcessor bestSolutionProcessor = new SequentialProcessor();
+      #region MSE
       MeanSquaredErrorEvaluator testMseEvaluator = new MeanSquaredErrorEvaluator();
       testMseEvaluator.Name = "TestMeanSquaredErrorEvaluator";
@@ -205,9 +226,11 @@
       testMseEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
       testMseEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
+      #endregion
+      #region MAPE
       MeanAbsolutePercentageErrorEvaluator trainingMapeEvaluator = new MeanAbsolutePercentageErrorEvaluator();
       trainingMapeEvaluator.Name = "TrainingMapeEvaluator";
       trainingMapeEvaluator.GetVariableInfo("MAPE").ActualName = "TrainingMAPE";
-      trainingMapeEvaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      trainingMapeEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      trainingMapeEvaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingMapeEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       MeanAbsolutePercentageErrorEvaluator validationMapeEvaluator = new MeanAbsolutePercentageErrorEvaluator();
       validationMapeEvaluator.Name = "ValidationMapeEvaluator";
@@ -220,9 +243,11 @@
       testMapeEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
       testMapeEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
+      #endregion
+      #region MAPRE
       MeanAbsolutePercentageOfRangeErrorEvaluator trainingMapreEvaluator = new MeanAbsolutePercentageOfRangeErrorEvaluator();
       trainingMapreEvaluator.Name = "TrainingMapreEvaluator";
       trainingMapreEvaluator.GetVariableInfo("MAPRE").ActualName = "TrainingMAPRE";
-      trainingMapreEvaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      trainingMapreEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      trainingMapreEvaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingMapreEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       MeanAbsolutePercentageOfRangeErrorEvaluator validationMapreEvaluator = new MeanAbsolutePercentageOfRangeErrorEvaluator();
       validationMapreEvaluator.Name = "ValidationMapreEvaluator";
@@ -235,9 +260,11 @@
       testMapreEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
       testMapreEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
+      #endregion MAPRE
+      #region R2
       CoefficientOfDeterminationEvaluator trainingR2Evaluator = new CoefficientOfDeterminationEvaluator();
       trainingR2Evaluator.Name = "TrainingR2Evaluator";
       trainingR2Evaluator.GetVariableInfo("R2").ActualName = "TrainingR2";
-      trainingR2Evaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      trainingR2Evaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      trainingR2Evaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingR2Evaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       CoefficientOfDeterminationEvaluator validationR2Evaluator = new CoefficientOfDeterminationEvaluator();
       validationR2Evaluator.Name = "ValidationR2Evaluator";
@@ -250,9 +277,11 @@
       testR2Evaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
       testR2Evaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
+      #endregion
+      #region VAF
       VarianceAccountedForEvaluator trainingVAFEvaluator = new VarianceAccountedForEvaluator();
       trainingVAFEvaluator.Name = "TrainingVAFEvaluator";
       trainingVAFEvaluator.GetVariableInfo("VAF").ActualName = "TrainingVAF";
-      trainingVAFEvaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      trainingVAFEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      trainingVAFEvaluator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingVAFEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       VarianceAccountedForEvaluator validationVAFEvaluator = new VarianceAccountedForEvaluator();
       validationVAFEvaluator.Name = "ValidationVAFEvaluator";
@@ -265,5 +294,5 @@
       testVAFEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
       testVAFEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
-
+      #endregion
       ProgrammableOperator progOperator = new ProgrammableOperator();
       progOperator.RemoveVariableInfo("Result");
Index: trunk/sources/HeuristicLab.LinearRegression/3.2/HeuristicLab.LinearRegression-3.2.csproj
===================================================================
--- trunk/sources/HeuristicLab.LinearRegression/3.2/HeuristicLab.LinearRegression-3.2.csproj	(revision 2160)
+++ trunk/sources/HeuristicLab.LinearRegression/3.2/HeuristicLab.LinearRegression-3.2.csproj	(revision 2161)
@@ -133,4 +133,8 @@
       <Name>HeuristicLab.PluginInfrastructure</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Random\3.2\HeuristicLab.Random-3.2.csproj">
+      <Project>{47019A74-F7F7-482E-83AA-D3F4F777E879}</Project>
+      <Name>HeuristicLab.Random-3.2</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.SequentialEngine\3.2\HeuristicLab.SequentialEngine-3.2.csproj">
       <Project>{B4BE8E53-BA06-4237-9A01-24255F880201}</Project>
Index: trunk/sources/HeuristicLab.LinearRegression/3.2/HeuristicLabLinearRegressionPlugin.cs
===================================================================
--- trunk/sources/HeuristicLab.LinearRegression/3.2/HeuristicLabLinearRegressionPlugin.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.LinearRegression/3.2/HeuristicLabLinearRegressionPlugin.cs	(revision 2161)
@@ -34,4 +34,5 @@
   [Dependency(Dependency = "HeuristicLab.GP.StructureIdentification-3.3")]
   [Dependency(Dependency = "HeuristicLab.Modeling-3.2")]
+  [Dependency(Dependency = "HeuristicLab.Random-3.2")]
   [Dependency(Dependency = "HeuristicLab.SequentialEngine-3.2")]
   public class HeuristicLabLinearRegression : PluginBase {
Index: trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs
===================================================================
--- trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs	(revision 2161)
@@ -33,4 +33,5 @@
 using HeuristicLab.Modeling;
 using HeuristicLab.GP;
+using HeuristicLab.Random;
 
 namespace HeuristicLab.LinearRegression {
@@ -88,16 +89,25 @@
       seq.Name = "LinearRegression";
 
+      var randomInjector = new RandomInjector();
+      randomInjector.Name = "Random Injector";
       IOperator globalInjector = CreateGlobalInjector();
       ProblemInjector problemInjector = new ProblemInjector();
+      problemInjector.GetVariableInfo("MaxNumberOfTrainingSamples").Local = true;
+      problemInjector.AddVariable(new HeuristicLab.Core.Variable("MaxNumberOfTrainingSamples", new IntData(5000)));
+
+      IOperator shuffler = new DatasetShuffler();
+      shuffler.GetVariableInfo("ShuffleStart").ActualName = "TrainingSamplesStart";
+      shuffler.GetVariableInfo("ShuffleEnd").ActualName = "TrainingSamplesEnd";
+
       LinearRegressionOperator lrOperator = new LinearRegressionOperator();
-      lrOperator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      lrOperator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
-
-
+      lrOperator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      lrOperator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
+
+      seq.AddSubOperator(randomInjector);
       seq.AddSubOperator(globalInjector);
       seq.AddSubOperator(problemInjector);
+      seq.AddSubOperator(shuffler);
       seq.AddSubOperator(lrOperator);
       seq.AddSubOperator(CreateModelAnalyser());
-
 
       algo.OperatorGraph.InitialOperator = seq;
@@ -126,6 +136,6 @@
       trainingMSE.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
       trainingMSE.GetVariableInfo("MSE").ActualName = "TrainingQuality";
-      trainingMSE.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
-      trainingMSE.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
+      trainingMSE.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingMSE.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       MeanSquaredErrorEvaluator validationMSE = new MeanSquaredErrorEvaluator();
       validationMSE.Name = "ValidationMseEvaluator";
@@ -147,6 +157,6 @@
       trainingR2.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
       trainingR2.GetVariableInfo("R2").ActualName = "TrainingR2";
-      trainingR2.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      trainingR2.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      trainingR2.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingR2.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       CoefficientOfDeterminationEvaluator validationR2 = new CoefficientOfDeterminationEvaluator();
       validationR2.Name = "ValidationR2Evaluator";
@@ -168,6 +178,6 @@
       trainingMAPE.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
       trainingMAPE.GetVariableInfo("MAPE").ActualName = "TrainingMAPE";
-      trainingMAPE.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      trainingMAPE.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      trainingMAPE.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingMAPE.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       MeanAbsolutePercentageErrorEvaluator validationMAPE = new MeanAbsolutePercentageErrorEvaluator();
       validationMAPE.Name = "ValidationMapeEvaluator";
@@ -189,6 +199,6 @@
       trainingMAPRE.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
       trainingMAPRE.GetVariableInfo("MAPRE").ActualName = "TrainingMAPRE";
-      trainingMAPRE.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      trainingMAPRE.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      trainingMAPRE.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingMAPRE.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       MeanAbsolutePercentageOfRangeErrorEvaluator validationMAPRE = new MeanAbsolutePercentageOfRangeErrorEvaluator();
       validationMAPRE.Name = "ValidationMapreEvaluator";
@@ -210,6 +220,6 @@
       trainingVAF.GetVariableInfo("FunctionTree").ActualName = "LinearRegressionModel";
       trainingVAF.GetVariableInfo("VAF").ActualName = "TrainingVAF";
-      trainingVAF.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      trainingVAF.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      trainingVAF.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      trainingVAF.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       VarianceAccountedForEvaluator validationVAF = new VarianceAccountedForEvaluator();
       validationVAF.Name = "ValidationVafEvaluator";
Index: trunk/sources/HeuristicLab.Modeling/3.2/ProblemInjector.cs
===================================================================
--- trunk/sources/HeuristicLab.Modeling/3.2/ProblemInjector.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.Modeling/3.2/ProblemInjector.cs	(revision 2161)
@@ -56,4 +56,7 @@
       AddVariable(new Variable("TrainingSamplesEnd", new IntData()));
 
+      AddVariableInfo(new VariableInfo("ActualTrainingSamplesStart", "ActualTrainingSamplesStart", typeof(IntData), VariableKind.New));
+      AddVariableInfo(new VariableInfo("ActualTrainingSamplesEnd", "ActualTrainingSamplesEnd", typeof(IntData), VariableKind.New));
+
       AddVariableInfo(new VariableInfo("ValidationSamplesStart", "ValidationSamplesStart", typeof(IntData), VariableKind.New));
       GetVariableInfo("ValidationSamplesStart").Local = true;
@@ -71,4 +74,6 @@
       GetVariableInfo("TestSamplesEnd").Local = true;
       AddVariable(new Variable("TestSamplesEnd", new IntData()));
+
+      AddVariableInfo(new VariableInfo("MaxNumberOfTrainingSamples", "Maximal number of training samples to use (optional)", typeof(IntData), VariableKind.In));
     }
 
@@ -78,11 +83,33 @@
 
     public override IOperation Apply(IScope scope) {
-      foreach(VariableInfo info in VariableInfos) {
-        if(info.Local) {
-          IVariable var = GetVariable(info.FormalName);
-          if(var != null) scope.AddVariable(new Variable(info.ActualName, (IItem)var.Value.Clone()));
-        }
+      AddVariableToScope("Dataset", scope);
+      AddVariableToScope("TargetVariable", scope);
+      AddVariableToScope("AllowedFeatures", scope);
+      AddVariableToScope("TrainingSamplesStart", scope);
+      AddVariableToScope("TrainingSamplesEnd", scope);
+      AddVariableToScope("ValidationSamplesStart", scope);
+      AddVariableToScope("ValidationSamplesEnd", scope);
+      AddVariableToScope("TestSamplesStart", scope);
+      AddVariableToScope("TestSamplesEnd", scope);
+
+      int trainingStart = GetVariableValue<IntData>("TrainingSamplesStart", scope, true).Data;
+      int trainingEnd = GetVariableValue<IntData>("TrainingSamplesEnd", scope, true).Data;
+
+      var maxTraining = GetVariableValue<IntData>("MaxNumberOfTrainingSamples", scope, true, false);
+      int nTrainingSamples;
+      if (maxTraining != null) {
+        nTrainingSamples = Math.Min(maxTraining.Data, trainingEnd - trainingStart);
+        if (nTrainingSamples <= 0)
+          throw new ArgumentException("Maximal number of training samples must be larger than 0", "MaxNumberOfTrainingSamples");
+      } else {
+        nTrainingSamples = trainingEnd - trainingStart;
       }
+      scope.AddVariable(new Variable(scope.TranslateName("ActualTrainingSamplesStart"), new IntData(trainingStart)));
+      scope.AddVariable(new Variable(scope.TranslateName("ActualTrainingSamplesEnd"), new IntData(trainingStart + nTrainingSamples)));
       return null;
+    }
+
+    private void AddVariableToScope(string variableName, IScope scope) {
+      scope.AddVariable(new Variable(variableName, (IItem)GetVariable(variableName).Value.Clone()));      
     }
   }
Index: trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs
===================================================================
--- trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs	(revision 2160)
+++ trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs	(revision 2161)
@@ -142,6 +142,14 @@
       seq.Name = "Initialization";
       seq.AddSubOperator(CreateGlobalInjector());
-      seq.AddSubOperator(new ProblemInjector());
+      ProblemInjector probInjector = new ProblemInjector();
+      probInjector.GetVariableInfo("MaxNumberOfTrainingSamples").Local = true;
+      probInjector.AddVariable(new Variable("MaxNumberOfTrainingSamples", new IntData(5000)));
+      seq.AddSubOperator(probInjector);
       seq.AddSubOperator(new RandomInjector());
+
+      DatasetShuffler shuffler = new DatasetShuffler();
+      shuffler.GetVariableInfo("ShuffleStart").ActualName = "TrainingSamplesStart";
+      shuffler.GetVariableInfo("ShuffleEnd").ActualName = "TrainingSamplesEnd";
+      seq.AddSubOperator(shuffler);
       return seq;
     }
@@ -246,6 +254,6 @@
 
       SupportVectorCreator modelCreator = new SupportVectorCreator();
-      modelCreator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
-      modelCreator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+      modelCreator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
+      modelCreator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
       modelCreator.GetVariableInfo("SVMCost").ActualName = "Cost";
       modelCreator.GetVariableInfo("SVMGamma").ActualName = "Gamma";
@@ -256,5 +264,5 @@
 
       modelProcessor.AddSubOperator(modelCreator);
-      CombinedOperator trainingEvaluator = (CombinedOperator)CreateEvaluator("Training");
+      CombinedOperator trainingEvaluator = (CombinedOperator)CreateEvaluator("ActualTraining");
       trainingEvaluator.OperatorGraph.InitialOperator.SubOperators[1].GetVariableInfo("MSE").ActualName = "Quality";
       modelProcessor.AddSubOperator(trainingEvaluator);
@@ -415,14 +423,14 @@
       model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data;
       model.TestMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TestQuality", false).Data;
-      model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TrainingR2", false).Data;
+      model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingR2", false).Data;
       model.ValidationCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data;
       model.TestCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data;
-      model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data;
+      model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingMAPE", false).Data;
       model.ValidationMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data;
       model.TestMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data;
-      model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPRE", false).Data;
+      model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingMAPRE", false).Data;
       model.ValidationMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data;
       model.TestMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data;
-      model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TrainingVAF", false).Data;
+      model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingVAF", false).Data;
       model.ValidationVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data;
       model.TestVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data;
