Index: /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs
===================================================================
--- /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs	(revision 2346)
+++ /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs	(revision 2347)
@@ -40,12 +40,20 @@
     private Dictionary<string, int> variableNames = new Dictionary<string, int>();
     private string targetVariable;
+    private int minTimeOffset;
+    private int maxTimeOffset;
 
     public Predictor() : base() { } // for persistence
 
-    public Predictor(SVMModel model, string targetVariable, Dictionary<string, int> variableNames)
+    public Predictor(SVMModel model, string targetVariable, Dictionary<string, int> variableNames) :
+      this(model, targetVariable, variableNames, 0, 0) {
+    }
+
+    public Predictor(SVMModel model, string targetVariable, Dictionary<string, int> variableNames, int minTimeOffset, int maxTimeOffset)
       : base() {
       this.svmModel = model;
       this.targetVariable = targetVariable;
       this.variableNames = variableNames;
+      this.minTimeOffset = minTimeOffset;
+      this.maxTimeOffset = maxTimeOffset;
     }
 
@@ -61,5 +69,6 @@
       }
 
-      Problem p = SVMHelper.CreateSVMProblem(input, input.GetVariableIndex(targetVariable), newIndex, start, end);
+      Problem p = SVMHelper.CreateSVMProblem(input, input.GetVariableIndex(targetVariable), newIndex,
+        start, end, minTimeOffset, maxTimeOffset);
       Problem scaledProblem = SVM.Scaling.Scale(p, transform);
 
@@ -82,4 +91,6 @@
       clone.targetVariable = targetVariable;
       clone.variableNames = new Dictionary<string, int>(variableNames);
+      clone.minTimeOffset = minTimeOffset;
+      clone.maxTimeOffset = maxTimeOffset;
       return clone;
     }
@@ -90,4 +101,10 @@
       targetVarAttr.Value = targetVariable;
       node.Attributes.Append(targetVarAttr);
+      XmlAttribute minTimeOffsetAttr = document.CreateAttribute("MinTimeOffset");
+      XmlAttribute maxTimeOffsetAttr = document.CreateAttribute("MaxTimeOffset");
+      minTimeOffsetAttr.Value = XmlConvert.ToString(minTimeOffset);
+      maxTimeOffsetAttr.Value = XmlConvert.ToString(maxTimeOffset);
+      node.Attributes.Append(minTimeOffsetAttr);
+      node.Attributes.Append(maxTimeOffsetAttr);
       node.AppendChild(PersistenceManager.Persist(svmModel, document, persistedObjects));
       XmlNode variablesNode = document.CreateElement("Variables");
@@ -111,4 +128,6 @@
       svmModel = (SVMModel)PersistenceManager.Restore(node.ChildNodes[0], restoredObjects);
 
+      if (node.Attributes["MinTimeOffset"] != null) minTimeOffset = XmlConvert.ToInt32(node.Attributes["MinTimeOffset"].Value);
+      if (node.Attributes["MaxTimeOffset"] != null) maxTimeOffset = XmlConvert.ToInt32(node.Attributes["MaxTimeOffset"].Value);
       variableNames = new Dictionary<string, int>();
       XmlNode variablesNode = node.ChildNodes[1];
Index: /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMHelper.cs
===================================================================
--- /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMHelper.cs	(revision 2346)
+++ /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMHelper.cs	(revision 2347)
@@ -10,9 +10,9 @@
   public class SVMHelper {
 
-    public static SVM.Problem CreateSVMProblem(Dataset dataset, int targetVariable, int start, int end) {
-      return CreateSVMProblem(dataset, targetVariable, Enumerable.Range(0, dataset.Columns).ToDictionary<int, int>(x => x), start, end);
+    public static SVM.Problem CreateSVMProblem(Dataset dataset, int targetVariable, int start, int end, int minTimeOffset, int maxTimeOffset) {
+      return CreateSVMProblem(dataset, targetVariable, Enumerable.Range(0, dataset.Columns).ToDictionary<int, int>(x => x), start, end, minTimeOffset, maxTimeOffset);
     }
 
-    public static SVM.Problem CreateSVMProblem(Dataset dataset, int targetVariable, Dictionary<int, int> columnMapping, int start, int end) {
+    public static SVM.Problem CreateSVMProblem(Dataset dataset, int targetVariable, Dictionary<int, int> columnMapping, int start, int end, int minTimeOffset, int maxTimeOffset) {
       int rowCount = end - start;
       List<int> skippedFeatures = new List<int>();
@@ -24,5 +24,5 @@
       }
 
-      int maxColumns = dataset.Columns - skippedFeatures.Count();
+      int maxColumns = (dataset.Columns - skippedFeatures.Count()) * (maxTimeOffset-minTimeOffset);
 
       double[] targetVector = new double[rowCount];
@@ -36,11 +36,15 @@
       List<SVM.Node> tempRow;
       int addedRows = 0;
+      int timeOffsetBase = columnMapping.Count;
       for (int row = 0; row < rowCount; row++) {
         tempRow = new List<SVM.Node>();
         for (int col = 0; col < dataset.Columns; col++) {
           if (!skippedFeatures.Contains(col) && col != targetVariable && columnMapping.ContainsKey(col)) {
-            double value = dataset.GetValue(start + row, col);
-            if (!double.IsNaN(value))
-              tempRow.Add(new SVM.Node(columnMapping[col], value));
+            for (int timeOffset = minTimeOffset; timeOffset <= maxTimeOffset; timeOffset++) {
+              int actualColumn = columnMapping[col] * (maxTimeOffset - minTimeOffset) + (timeOffset - maxTimeOffset) + 1;
+              double value = dataset.GetValue(start + row + timeOffset, col);
+              if (!double.IsNaN(value))
+                tempRow.Add(new SVM.Node(actualColumn, value));
+            }
           }
         }
Index: /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorCreator.cs	(revision 2346)
+++ /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorCreator.cs	(revision 2347)
@@ -42,4 +42,6 @@
       AddVariableInfo(new VariableInfo("SamplesStart", "Start index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("SamplesEnd", "End index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("MaxTimeOffset", "Maximal time offset for time-series prognosis", typeof(IntData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("MinTimeOffset", "Minimal time offset for time-series prognosis", typeof(IntData), VariableKind.In));
 
       //SVM parameters
@@ -69,5 +71,6 @@
       int start = GetVariableValue<IntData>("SamplesStart", scope, true).Data;
       int end = GetVariableValue<IntData>("SamplesEnd", scope, true).Data;
-
+      int maxTimeOffset = GetVariableValue<IntData>("MaxTimeOffset", scope, true).Data;
+      int minTimeOffset = GetVariableValue<IntData>("MinTimeOffset", scope, true).Data;
       string svmType = GetVariableValue<StringData>("SVMType", scope, true).Data;
       string svmKernelType = GetVariableValue<StringData>("SVMKernelType", scope, true).Data;
@@ -81,5 +84,5 @@
       parameter.Gamma = GetVariableValue<DoubleData>("SVMGamma", scope, true).Data;
 
-      SVM.Problem problem = SVMHelper.CreateSVMProblem(dataset, targetVariable, start, end);
+      SVM.Problem problem = SVMHelper.CreateSVMProblem(dataset, targetVariable, start, end, minTimeOffset, maxTimeOffset);
       SVM.RangeTransform rangeTransform = SVM.Scaling.DetermineRange(problem);
       SVM.Problem scaledProblem = SVM.Scaling.Scale(problem, rangeTransform);
Index: /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs	(revision 2346)
+++ /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs	(revision 2347)
@@ -38,5 +38,6 @@
       AddVariableInfo(new VariableInfo("SamplesStart", "Start index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("SamplesEnd", "End index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
-
+      AddVariableInfo(new VariableInfo("MaxTimeOffset", "Maximal allowed time offset for input variables", typeof(IntData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("MinTimeOffset", "Minimal allowed time offset for input variables", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("SVMModel", "Represent the model learned by the SVM", typeof(SVMModel), VariableKind.In));
       AddVariableInfo(new VariableInfo("Values", "Target vs predicted values", typeof(DoubleMatrixData), VariableKind.New | VariableKind.Out));
@@ -49,13 +50,14 @@
       int start = GetVariableValue<IntData>("SamplesStart", scope, true).Data;
       int end = GetVariableValue<IntData>("SamplesEnd", scope, true).Data;
-
+      int minTimeOffset = GetVariableValue<IntData>("MinTimeOffset", scope, true).Data;
+      int maxTimeOffset = GetVariableValue<IntData>("MaxTimeOffset", scope, true).Data;
       SVMModel modelData = GetVariableValue<SVMModel>("SVMModel", scope, true);
-      SVM.Problem problem = SVMHelper.CreateSVMProblem(dataset, targetVariable, start, end);
+      SVM.Problem problem = SVMHelper.CreateSVMProblem(dataset, targetVariable, start, end, minTimeOffset, maxTimeOffset);
       SVM.Problem scaledProblem = SVM.Scaling.Scale(problem, modelData.RangeTransform);
 
       double[,] values = new double[scaledProblem.Count, 2];
       for (int i = 0; i < scaledProblem.Count; i++) {
-        values[i,0] = SVM.Prediction.Predict(modelData.Model, scaledProblem.X[i]);
-        values[i,1] = dataset.GetValue(start + i,targetVariable);
+        values[i, 0] = SVM.Prediction.Predict(modelData.Model, scaledProblem.X[i]);
+        values[i, 1] = dataset.GetValue(start + i, targetVariable);
       }
 
Index: /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs
===================================================================
--- /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs	(revision 2346)
+++ /trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs	(revision 2347)
@@ -107,4 +107,14 @@
     }
 
+    public int MaxTimeOffset {
+      get { return GetVariableInjector().GetVariable("MaxTimeOffset").GetValue<IntData>().Data; }
+      set { GetVariableInjector().GetVariable("MaxTimeOffset").GetValue<IntData>().Data = value; }
+    }
+
+    public int MinTimeOffset {
+      get { return GetVariableInjector().GetVariable("MinTimeOffset").GetValue<IntData>().Data; }
+      set { GetVariableInjector().GetVariable("MinTimeOffset").GetValue<IntData>().Data = value; }
+    }
+
     public SupportVectorRegression() {
       engine = new SequentialEngine.SequentialEngine();
@@ -115,4 +125,6 @@
       MaxNuIndex = NuList.Data.Length;
       MaxGammaIndex = GammaList.Data.Length;
+      MaxTimeOffset = 0;
+      MinTimeOffset = 0;
     }
 
@@ -147,8 +159,8 @@
       seq.AddSubOperator(new RandomInjector());
 
-      DatasetShuffler shuffler = new DatasetShuffler();
-      shuffler.GetVariableInfo("ShuffleStart").ActualName = "TrainingSamplesStart";
-      shuffler.GetVariableInfo("ShuffleEnd").ActualName = "TrainingSamplesEnd";
-      seq.AddSubOperator(shuffler);
+      //DatasetShuffler shuffler = new DatasetShuffler();
+      //shuffler.GetVariableInfo("ShuffleStart").ActualName = "TrainingSamplesStart";
+      //shuffler.GetVariableInfo("ShuffleEnd").ActualName = "TrainingSamplesEnd";
+      //seq.AddSubOperator(shuffler);
       return seq;
     }
@@ -395,5 +407,6 @@
       injector.AddVariable(new HeuristicLab.Core.Variable("Type", new StringData("NU_SVR")));
       injector.AddVariable(new HeuristicLab.Core.Variable("PunishmentFactor", new DoubleData(1000.0)));
-
+      injector.AddVariable(new HeuristicLab.Core.Variable("MaxTimeOffset", new IntData()));
+      injector.AddVariable(new HeuristicLab.Core.Variable("MinTimeOffset", new IntData()));
       return injector;
     }
