Index: trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs
===================================================================
--- trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs	(revision 2414)
+++ trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs	(revision 2415)
@@ -79,5 +79,5 @@
       Problem p = SVMHelper.CreateSVMProblem(input, input.GetVariableIndex(targetVariable), newIndex,
         start, end, minTimeOffset, maxTimeOffset);
-      Problem scaledProblem = SVM.Scaling.Scale(p, transform);
+      Problem scaledProblem = transform.Scale(p);
 
       int targetVariableIndex = input.GetVariableIndex(targetVariable);
@@ -155,4 +155,47 @@
       }
     }
+
+    public static void Export(Predictor p, Stream s) {
+      StreamWriter writer = new StreamWriter(s);
+      writer.Write("Targetvariable: "); writer.WriteLine(p.targetVariable);
+      writer.Write("LowerPredictionLimit: "); writer.WriteLine(p.LowerPredictionLimit.ToString());
+      writer.Write("UpperPredictionLimit: "); writer.WriteLine(p.UpperPredictionLimit.ToString());
+      writer.Write("MaxTimeOffset: "); writer.WriteLine(p.MaxTimeOffset.ToString());
+      writer.Write("MinTimeOffset: "); writer.WriteLine(p.MinTimeOffset.ToString());
+      writer.Write("InputVariables :");
+      writer.Write(p.GetInputVariables().First());
+      foreach (string variable in p.GetInputVariables().Skip(1)) {
+        writer.Write("; "); writer.Write(variable);
+      }
+      writer.WriteLine();
+      writer.Flush();
+      using (MemoryStream memStream = new MemoryStream()) {
+        SVMModel.Export(p.Model, memStream);
+        memStream.WriteTo(s);
+      }
+    }
+
+    public static Predictor Import(Stream s) {
+      Predictor p = new Predictor();
+      StreamReader reader = new StreamReader(s);
+      string[] targetVariableLine = reader.ReadLine().Split(':');
+      string[] lowerPredictionLimitLine = reader.ReadLine().Split(':');
+      string[] upperPredictionLimitLine = reader.ReadLine().Split(':');
+      string[] maxTimeOffsetLine = reader.ReadLine().Split(':');
+      string[] minTimeOffsetLine = reader.ReadLine().Split(':');
+      string[] inputVariableLine = reader.ReadLine().Split(':', ';');
+
+      p.targetVariable = targetVariableLine[1].Trim();
+      p.LowerPredictionLimit = double.Parse(lowerPredictionLimitLine[1]);
+      p.UpperPredictionLimit = double.Parse(upperPredictionLimitLine[1]);
+      p.maxTimeOffset = int.Parse(maxTimeOffsetLine[1]);
+      p.minTimeOffset = int.Parse(minTimeOffsetLine[1]);
+      int i = 1;
+      foreach (string inputVariable in inputVariableLine.Skip(1)) {
+        p.variableNames[inputVariable.Trim()] = i++;
+      }
+      p.svmModel = SVMModel.Import(s);
+      return p;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.SupportVectorMachines/3.2/PredictorView.cs
===================================================================
--- trunk/sources/HeuristicLab.SupportVectorMachines/3.2/PredictorView.cs	(revision 2414)
+++ trunk/sources/HeuristicLab.SupportVectorMachines/3.2/PredictorView.cs	(revision 2415)
@@ -29,4 +29,5 @@
 using System.Windows.Forms;
 using HeuristicLab.Core;
+using System.IO;
 
 namespace HeuristicLab.SupportVectorMachines {
@@ -50,18 +51,18 @@
     }
 
-    protected override string GetModelString() {
-      StringBuilder builder = new StringBuilder();
-      builder.Append("LowerPredictionLimit: ").AppendLine(predictor.LowerPredictionLimit.ToString());
-      builder.Append("UpperPredictionLimit: ").AppendLine(predictor.UpperPredictionLimit.ToString());
-      builder.Append("MaxTimeOffset: ").AppendLine(predictor.MaxTimeOffset.ToString());
-      builder.Append("MinTimeOffset: ").AppendLine(predictor.MinTimeOffset.ToString());
-      builder.Append("InputVariables :");
-      builder.Append(predictor.GetInputVariables().First());
-      foreach (string variable in predictor.GetInputVariables().Skip(1)) {
-        builder.Append("; ").Append(variable);
+    protected override void UpdateControls() {
+      base.UpdateControls();
+      textBox.Text = GetModelString();
+    }
+
+    private string GetModelString() {
+      if (predictor == null) return "";
+      using (MemoryStream s = new MemoryStream()) {
+        Predictor.Export(predictor, s);
+        s.Flush();
+        s.Seek(0, System.IO.SeekOrigin.Begin);
+        StreamReader reader = new StreamReader(s);
+        return reader.ReadToEnd();
       }
-      builder.AppendLine();
-      builder.Append(base.GetModelString());
-      return builder.ToString();
     }
   }
Index: trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMModel.cs
===================================================================
--- trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMModel.cs	(revision 2414)
+++ trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMModel.cs	(revision 2415)
@@ -116,4 +116,34 @@
       }
     }
+
+    public static void Export(SVMModel model, Stream s) {
+      StreamWriter writer = new StreamWriter(s);
+      writer.WriteLine("RangeTransform:");
+      using (MemoryStream memStream = new MemoryStream()) {
+        SVM.RangeTransform.Write(memStream, model.RangeTransform);
+        memStream.Seek(0, SeekOrigin.Begin);
+        memStream.WriteTo(s);
+      }
+      writer.WriteLine("Model:");
+
+      using (MemoryStream memStream = new MemoryStream()) {
+        SVM.Model.Write(memStream, model.Model);
+        memStream.Seek(0, SeekOrigin.Begin);
+        memStream.WriteTo(s);
+      }
+      s.Flush();
+    }
+
+    public static SVMModel Import(Stream s) {
+      SVMModel model = new SVMModel();
+      StreamReader reader = new StreamReader(s);
+      while (reader.ReadLine().Trim() != "RangeTransform:") ; // read until line "RangeTransform";
+      model.RangeTransform = SVM.RangeTransform.Read(s);
+
+      // read until "Model:"
+      while (reader.ReadLine().Trim() != "Model:") ;
+      model.Model = SVM.Model.Read(s);
+      return model;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMModelView.cs
===================================================================
--- trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMModelView.cs	(revision 2414)
+++ trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMModelView.cs	(revision 2415)
@@ -49,4 +49,5 @@
       kernelType.DataBindings.Add(new Binding("Text", model.Model.Parameter, "KernelType"));
       gamma.DataBindings.Add(new Binding("Text", model.Model.Parameter, "Gamma"));
+      UpdateControls();
     }
 
@@ -56,21 +57,12 @@
     }
 
-    protected virtual string GetModelString() {
-      StringBuilder builder = new StringBuilder();
-      builder.AppendLine("RangeTransform:");
-      using (MemoryStream stream = new MemoryStream()) {
-        SVM.RangeTransform.Write(stream, model.RangeTransform);
-        stream.Seek(0, System.IO.SeekOrigin.Begin);
-        StreamReader reader = new StreamReader(stream);
-        builder.AppendLine(reader.ReadToEnd());
+    private string GetModelString() {
+      using (MemoryStream s = new MemoryStream()) {
+        SVMModel.Export(model, s);
+        s.Flush();
+        s.Seek(0, System.IO.SeekOrigin.Begin);
+        StreamReader reader = new StreamReader(s);
+        return reader.ReadToEnd();
       }
-      builder.AppendLine("Model:");
-      using (MemoryStream stream = new MemoryStream()) {
-        SVM.Model.Write(stream, model.Model);
-        stream.Seek(0, System.IO.SeekOrigin.Begin);
-        StreamReader reader = new StreamReader(stream);
-        builder.AppendLine(reader.ReadToEnd());
-      }
-      return builder.ToString();
     }
   }
Index: trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorCreator.cs	(revision 2414)
+++ trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorCreator.cs	(revision 2415)
@@ -28,4 +28,5 @@
 using HeuristicLab.DataAnalysis;
 using System.Threading;
+using SVM;
 
 namespace HeuristicLab.SupportVectorMachines {
@@ -85,8 +86,10 @@
       parameter.Nu = GetVariableValue<DoubleData>("SVMNu", scope, true).Data;
       parameter.Gamma = GetVariableValue<DoubleData>("SVMGamma", scope, true).Data;
+      parameter.CacheSize = 500;
+      parameter.Probability = false;
 
       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);
+      SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
+      SVM.Problem scaledProblem = rangeTransform.Scale(problem);
 
       SVM.Model model = StartTraining(scaledProblem, parameter);
Index: trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs	(revision 2414)
+++ trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs	(revision 2415)
@@ -27,4 +27,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
+using SVM;
 
 namespace HeuristicLab.SupportVectorMachines {
@@ -56,5 +57,5 @@
       SVMModel modelData = GetVariableValue<SVMModel>("SVMModel", scope, true);
       SVM.Problem problem = SVMHelper.CreateSVMProblem(dataset, targetVariable, start, end, minTimeOffset, maxTimeOffset);
-      SVM.Problem scaledProblem = SVM.Scaling.Scale(problem, modelData.RangeTransform);
+      SVM.Problem scaledProblem = modelData.RangeTransform.Scale(problem);
 
       double[,] values = new double[scaledProblem.Count, 2];
