Index: branches/DataAnalysis.Extensions/DataAnalysis.Extensions.sln
===================================================================
--- branches/DataAnalysis.Extensions/DataAnalysis.Extensions.sln	(revision 4844)
+++ branches/DataAnalysis.Extensions/DataAnalysis.Extensions.sln	(revision 4858)
@@ -4,7 +4,7 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3", "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj", "{125D3006-67F5-48CB-913E-73C0548F17FA}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis-3.3", "HeuristicLab.Problems.DataAnalysis\3.3\HeuristicLab.Problems.DataAnalysis-3.3.csproj", "{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}"
+EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3", "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3.csproj", "{6F42C5F8-16CD-43EE-8208-FD4573A69D85}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters", "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters.csproj", "{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}"
 EndProject
 Global
@@ -30,4 +30,16 @@
 		{125D3006-67F5-48CB-913E-73C0548F17FA}.Release|x86.ActiveCfg = Release|x86
 		{125D3006-67F5-48CB-913E-73C0548F17FA}.Release|x86.Build.0 = Release|x86
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|x64.ActiveCfg = Debug|x64
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|x64.Build.0 = Debug|x64
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|x86.ActiveCfg = Debug|x86
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|x86.Build.0 = Debug|x86
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|x64.ActiveCfg = Release|x64
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|x64.Build.0 = Release|x64
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|x86.ActiveCfg = Release|x86
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|x86.Build.0 = Release|x86
 		{6F42C5F8-16CD-43EE-8208-FD4573A69D85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{6F42C5F8-16CD-43EE-8208-FD4573A69D85}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -42,12 +54,4 @@
 		{6F42C5F8-16CD-43EE-8208-FD4573A69D85}.Release|x86.ActiveCfg = Release|x86
 		{6F42C5F8-16CD-43EE-8208-FD4573A69D85}.Release|x86.Build.0 = Release|x86
-		{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}.Release|Any CPU.Build.0 = Release|Any CPU
-		{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}.Release|x64.ActiveCfg = Release|Any CPU
-		{FF6261F7-B9F4-46A7-A5F7-E0FEC6D555BA}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/CsvFileParser.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/CsvFileParser.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/CsvFileParser.cs	(revision 4858)
@@ -0,0 +1,316 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class CsvFileParser {
+    private const string VARIABLENAMES = "VARIABLENAMES";
+    private Tokenizer tokenizer;
+    private List<string> variableNames;
+    private List<List<double>> rowValues;
+
+    private int rows;
+    public int Rows {
+      get { return rows; }
+      set { rows = value; }
+    }
+
+    private int columns;
+    public int Columns {
+      get { return columns; }
+      set { columns = value; }
+    }
+
+    private double[,] values;
+    public double[,] Values {
+      get {
+        return values;
+      }
+    }
+
+    public IEnumerable<string> VariableNames {
+      get {
+        if (variableNames.Count > 0) return variableNames;
+        else {
+          string[] names = new string[columns];
+          for (int i = 0; i < names.Length; i++) {
+            names[i] = "X" + i.ToString("000");
+          }
+          return names;
+        }
+      }
+    }
+
+    public CsvFileParser() {
+      rowValues = new List<List<double>>();
+      variableNames = new List<string>();
+    }
+
+    private void Reset() {
+      variableNames.Clear();
+      rowValues.Clear();
+    }
+
+    public void Parse(string fileName) {
+      TryParse(fileName);
+      // translate the list of samples into a DoubleMatrixData item
+      rows = rowValues.Count;
+      columns = rowValues[0].Count;
+      values = new double[rows, columns];
+
+      int rowIndex = 0;
+      int columnIndex = 0;
+      foreach (List<double> row in rowValues) {
+        columnIndex = 0;
+        foreach (double element in row) {
+          values[rowIndex, columnIndex++] = element;
+        }
+        rowIndex++;
+      }
+    }
+
+    private void TryParse(string fileName) {
+      Exception lastEx = null;
+      NumberFormatInfo[] possibleFormats = new NumberFormatInfo[] { CultureInfo.InvariantCulture.NumberFormat };
+      foreach (NumberFormatInfo numberFormat in possibleFormats) {
+        using (StreamReader reader = new StreamReader(fileName)) {
+          tokenizer = new Tokenizer(reader, numberFormat);
+          try {
+            // parse the file
+            Parse();
+            return; // parsed without errors -> return;
+          }
+          catch (DataFormatException ex) {
+            lastEx = ex;
+          }
+        }
+      }
+      // all number formats threw an exception -> rethrow the last exception
+      throw lastEx;
+    }
+
+    #region tokenizer
+    internal enum TokenTypeEnum {
+      NewLine, Separator, String, Double
+    }
+
+    internal class Token {
+      public TokenTypeEnum type;
+      public string stringValue;
+      public double doubleValue;
+
+      public Token(TokenTypeEnum type, string value) {
+        this.type = type;
+        stringValue = value;
+        doubleValue = 0.0;
+      }
+
+      public override string ToString() {
+        return stringValue;
+      }
+    }
+
+
+    internal class Tokenizer {
+      private StreamReader reader;
+      private List<Token> tokens;
+      private NumberFormatInfo numberFormatInfo;
+
+      private int currentLineNumber = 0;
+      public int CurrentLineNumber {
+        get { return currentLineNumber; }
+        private set { currentLineNumber = value; }
+      }
+      private string currentLine;
+      public string CurrentLine {
+        get { return currentLine; }
+        private set { currentLine = value; }
+      }
+
+      private Token newlineToken;
+      public Token NewlineToken {
+        get { return newlineToken; }
+        private set { newlineToken = value; }
+      }
+      private Token separatorToken;
+      public Token SeparatorToken {
+        get { return separatorToken; }
+        private set { separatorToken = value; }
+      }
+
+      public Tokenizer(StreamReader reader, NumberFormatInfo numberFormatInfo, char separator) {
+        this.reader = reader;
+        this.numberFormatInfo = numberFormatInfo;
+        separatorToken = new Token(TokenTypeEnum.Separator, separator.ToString());
+        newlineToken = new Token(TokenTypeEnum.NewLine, Environment.NewLine);
+        tokens = new List<Token>();
+        ReadNextTokens();
+      }
+      public Tokenizer(StreamReader reader, NumberFormatInfo numberFormatInfo)
+        : this(reader, numberFormatInfo, ';') {
+      }
+
+      private void ReadNextTokens() {
+        if (!reader.EndOfStream) {
+          CurrentLine = reader.ReadLine();
+          var newTokens = from str in Split(CurrentLine)
+                          let trimmedStr = str.Trim()
+                          where !string.IsNullOrEmpty(trimmedStr)
+                          select MakeToken(trimmedStr.Trim());
+
+          tokens.AddRange(newTokens);
+          tokens.Add(NewlineToken);
+          CurrentLineNumber++;
+        }
+      }
+
+      private IEnumerable<string> Split(string line) {
+        StringBuilder subStr = new StringBuilder();
+        foreach (char c in line) {
+          if (c == ';') {
+            yield return subStr.ToString();
+            subStr = new StringBuilder();
+            yield return c.ToString();
+          } else {
+            subStr.Append(c);
+          }
+        }
+        yield return subStr.ToString();
+      }
+
+      private Token MakeToken(string strToken) {
+        Token token = new Token(TokenTypeEnum.String, strToken);
+        if (strToken.Equals(SeparatorToken.stringValue)) {
+          return SeparatorToken;
+        } else if (double.TryParse(strToken, NumberStyles.Float, numberFormatInfo, out token.doubleValue)) {
+          token.type = TokenTypeEnum.Double;
+          return token;
+        }
+
+        // couldn't parse the token as an int or float number so return a string token
+        return token;
+      }
+
+      public Token Peek() {
+        return tokens[0];
+      }
+
+      public Token Next() {
+        Token next = tokens[0];
+        tokens.RemoveAt(0);
+        if (tokens.Count == 0) {
+          ReadNextTokens();
+        }
+        return next;
+      }
+
+      public bool HasNext() {
+        return tokens.Count > 0 || !reader.EndOfStream;
+      }
+    }
+    #endregion
+
+    #region parsing
+    private void Parse() {
+      ParseVariableNames();
+      if (!tokenizer.HasNext()) Error("Couldn't parse data values. Probably because of incorrect number format (the parser expects english number format with a '.' as decimal separator).", "", tokenizer.CurrentLineNumber);
+      ParseValues();
+      if (rowValues.Count == 0) Error("Couldn't parse data values. Probably because of incorrect number format (the parser expects english number format with a '.' as decimal separator).", "", tokenizer.CurrentLineNumber);
+    }
+
+    private void ParseValues() {
+      while (tokenizer.HasNext()) {
+        List<double> row = new List<double>();
+        row.Add(NextValue(tokenizer));
+        while (tokenizer.HasNext() && tokenizer.Peek() == tokenizer.SeparatorToken) {
+          Expect(tokenizer.SeparatorToken);
+          row.Add(NextValue(tokenizer));
+        }
+        Expect(tokenizer.NewlineToken);
+        // all rows have to have the same number of values            
+        // the first row defines how many samples are needed
+        if (rowValues.Count > 0 && rowValues[0].Count != row.Count) {
+          Error("The first row of the dataset has " + rowValues[0].Count + " columns." +
+            "\nLine " + tokenizer.CurrentLineNumber + " has " + row.Count + " columns.", "", tokenizer.CurrentLineNumber);
+        }
+        // add the current row to the collection of rows and start a new row
+        rowValues.Add(row);
+        row = new List<double>();
+      }
+    }
+
+    private double NextValue(Tokenizer tokenizer) {
+      if (tokenizer.Peek() == tokenizer.SeparatorToken || tokenizer.Peek() == tokenizer.NewlineToken) return double.NaN;
+      Token current = tokenizer.Next();
+      if (current.type == TokenTypeEnum.Separator || current.type == TokenTypeEnum.String) {
+        return double.NaN;
+      } else if (current.type == TokenTypeEnum.Double) {
+        // just take the value
+        return current.doubleValue;
+      }
+      // found an unexpected token => throw error 
+      Error("Unexpected token.", current.stringValue, tokenizer.CurrentLineNumber);
+      // this line is never executed because Error() throws an exception
+      throw new InvalidOperationException();
+    }
+
+    private void ParseVariableNames() {
+      // if the first line doesn't start with a double value then we assume that the
+      // first line contains variable names
+      if (tokenizer.HasNext() && tokenizer.Peek().type != TokenTypeEnum.Double) {
+
+        List<Token> tokens = new List<Token>();
+        Token valueToken;
+        valueToken = tokenizer.Next();
+        tokens.Add(valueToken);
+        while (tokenizer.HasNext() && tokenizer.Peek() == tokenizer.SeparatorToken) {
+          Expect(tokenizer.SeparatorToken);
+          valueToken = tokenizer.Next();
+          if (valueToken != tokenizer.NewlineToken) {
+            tokens.Add(valueToken);
+          }
+        }
+        if (valueToken != tokenizer.NewlineToken) {
+          Expect(tokenizer.NewlineToken);
+        }
+        variableNames = tokens.Select(x => x.stringValue.Trim()).ToList();
+      }
+    }
+
+    private void Expect(Token expectedToken) {
+      Token actualToken = tokenizer.Next();
+      if (actualToken != expectedToken) {
+        Error("Expected: " + expectedToken, actualToken.stringValue, tokenizer.CurrentLineNumber);
+      }
+    }
+
+    private void Error(string message, string token, int lineNumber) {
+      throw new DataFormatException("Error while parsing.\n" + message, token, lineNumber);
+    }
+    #endregion
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs	(revision 4858)
@@ -0,0 +1,153 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Item("Data Analysis Problem", "Represents a data analysis problem.")]
+  [Creatable("Problems")]
+  [StorableClass]
+  public class DataAnalysisProblem : ParameterizedNamedItem, IDataAnalysisProblem, IStorableContent {
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+
+    public string Filename { get; set; }
+
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
+    }
+
+    #region Parameter Properties
+    public ValueParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (ValueParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected DataAnalysisProblem(bool deserializing) : base(deserializing) { }
+    protected DataAnalysisProblem(DataAnalysisProblem original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    public DataAnalysisProblem()
+      : base() {
+      Parameters.Add(new ValueParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data set, target variable and input variables of the data analysis problem.", new DataAnalysisProblemData()));
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    #region events
+    protected virtual void OnDataAnalysisProblemChanged(EventArgs e) {
+      RaiseReset(e);
+    }
+
+    private void RegisterParameterEvents() {
+      DataAnalysisProblemDataParameter.ValueChanged += new EventHandler(DataAnalysisProblemDataParameter_ValueChanged);
+    }
+
+    private void RegisterParameterValueEvents() {
+      DataAnalysisProblemData.ProblemDataChanged += new EventHandler(DataAnalysisProblemData_ProblemDataChanged);
+    }
+
+    private void DataAnalysisProblemDataParameter_ValueChanged(object sender, EventArgs e) {
+      OnDataAnalysisProblemChanged(e);
+    }
+
+    private void DataAnalysisProblemData_ProblemDataChanged(object sender, EventArgs e) {
+      OnDataAnalysisProblemChanged(e);
+    }
+    #endregion
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DataAnalysisProblem(this, cloner);
+    }
+
+    #region IProblem Members
+
+    public virtual IParameter SolutionCreatorParameter {
+      get { return null; }
+    }
+
+    public virtual ISolutionCreator SolutionCreator {
+      get { return null; }
+    }
+
+    public virtual IParameter EvaluatorParameter {
+      get { return null; }
+    }
+
+    public virtual IEvaluator Evaluator {
+      get { return null; }
+    }
+
+    public virtual IEnumerable<IOperator> Operators {
+      get { return new IOperator[0]; }
+    }
+
+    public event EventHandler SolutionCreatorChanged;
+    protected void RaiseSolutionCreatorChanged(EventArgs e) {
+      var changed = SolutionCreatorChanged;
+      if (changed != null)
+        changed(this, e);
+    }
+
+    public event EventHandler EvaluatorChanged;
+    protected void RaiseEvaluatorChanged(EventArgs e) {
+      var changed = EvaluatorChanged;
+      if (changed != null)
+        changed(this, e);
+    }
+
+    public event EventHandler OperatorsChanged;
+    protected void RaiseOperatorsChanged(EventArgs e) {
+      var changed = OperatorsChanged;
+      if (changed != null)
+        changed(this, e);
+    }
+
+    public event EventHandler Reset;
+    protected void RaiseReset(EventArgs e) {
+      var changed = Reset;
+      if (changed != null)
+        changed(this, e);
+    }
+    #endregion
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs	(revision 4858)
@@ -0,0 +1,420 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Item("DataAnalysisProblemData", "Represents an item containing all data defining a data analysis problem.")]
+  [StorableClass]
+  public class DataAnalysisProblemData : ParameterizedNamedItem, IStorableContent {
+    protected bool suppressEvents = false;
+    #region IStorableContent Members
+    public string Filename { get; set; }
+    #endregion
+    #region default data
+    // y = x^4 + x^3 + x^2 + x
+    private static double[,] kozaF1 = new double[,] {
+{2.017885919,	-1.449165046},
+{1.30060506,	-1.344523885},
+{1.147134798,	-1.317989331},
+{0.877182504,	-1.266142284},
+{0.852562452,	-1.261020794},
+{0.431095788,	-1.158793317},
+{0.112586002,	-1.050908405},
+{0.04594507,	-1.021989402},
+{0.042572879,	-1.020438113},
+{-0.074027291,	-0.959859562},
+{-0.109178553,	-0.938094706},
+{-0.259721109,	-0.803635355},
+{-0.272991057,	-0.387519561},
+{-0.161978191,	-0.193611001},
+{-0.102489983,	-0.114215349},
+{-0.01469968,	-0.014918985},
+{-0.008863365,	-0.008942626},
+{0.026751057,	0.026054094},
+{0.166922436,	0.14309643},
+{0.176953808,	0.1504144},
+{0.190233418,	0.159916534},
+{0.199800708,	0.166635331},
+{0.261502822,	0.207600348},
+{0.30182879,	0.232370249},
+{0.83763905,	0.468046718}
+    };
+    #endregion
+    #region parameter properties
+    public ValueParameter<Dataset> DatasetParameter {
+      get { return (ValueParameter<Dataset>)Parameters["Dataset"]; }
+    }
+    public IValueParameter<StringValue> TargetVariableParameter {
+      get { return (IValueParameter<StringValue>)Parameters["TargetVariable"]; }
+    }
+    public IValueParameter<ICheckedItemList<StringValue>> InputVariablesParameter {
+      get { return (IValueParameter<ICheckedItemList<StringValue>>)Parameters["InputVariables"]; }
+    }
+    public IValueParameter<IntValue> TrainingSamplesStartParameter {
+      get { return (IValueParameter<IntValue>)Parameters["TrainingSamplesStart"]; }
+    }
+    public IValueParameter<IntValue> TrainingSamplesEndParameter {
+      get { return (IValueParameter<IntValue>)Parameters["TrainingSamplesEnd"]; }
+    }
+    public IValueParameter<IntValue> TestSamplesStartParameter {
+      get { return (IValueParameter<IntValue>)Parameters["TestSamplesStart"]; }
+    }
+    public IValueParameter<IntValue> TestSamplesEndParameter {
+      get { return (IValueParameter<IntValue>)Parameters["TestSamplesEnd"]; }
+    }
+    public IValueParameter<PercentValue> ValidationPercentageParameter {
+      get { return (IValueParameter<PercentValue>)Parameters["ValidationPercentage"]; }
+    }
+    #endregion
+
+    #region properties
+    public Dataset Dataset {
+      get { return DatasetParameter.Value; }
+      set {
+        if (value != Dataset) {
+          if (value == null) throw new ArgumentNullException();
+          DatasetParameter.Value = value;
+        }
+      }
+    }
+    public StringValue TargetVariable {
+      get { return TargetVariableParameter.Value; }
+      set {
+        if (value != TargetVariableParameter.Value) {
+          if (value == null) throw new ArgumentNullException();
+          if (TargetVariable != null) DeregisterStringValueEventHandlers(TargetVariable);
+          TargetVariableParameter.Value = value;
+        }
+      }
+    }
+    public ICheckedItemList<StringValue> InputVariables {
+      get { return InputVariablesParameter.Value; }
+      set {
+        if (value != InputVariables) {
+          if (value == null) throw new ArgumentNullException();
+          if (InputVariables != null) DeregisterInputVariablesEventHandlers();
+          InputVariablesParameter.Value = value;
+        }
+      }
+    }
+    public IntValue TrainingSamplesStart {
+      get { return TrainingSamplesStartParameter.Value; }
+      set {
+        if (value != TrainingSamplesStart) {
+          if (value == null) throw new ArgumentNullException();
+          if (TrainingSamplesStart != null) DeregisterValueTypeEventHandlers(TrainingSamplesStart);
+          TrainingSamplesStartParameter.Value = value;
+        }
+      }
+    }
+    public IntValue TrainingSamplesEnd {
+      get { return TrainingSamplesEndParameter.Value; }
+      set {
+        if (value != TrainingSamplesEnd) {
+          if (value == null) throw new ArgumentNullException();
+          if (TrainingSamplesEnd != null) DeregisterValueTypeEventHandlers(TrainingSamplesEnd);
+          TrainingSamplesEndParameter.Value = value;
+        }
+      }
+    }
+    public IntValue TestSamplesStart {
+      get { return TestSamplesStartParameter.Value; }
+      set {
+        if (value != TestSamplesStart) {
+          if (value == null) throw new ArgumentNullException();
+          if (TestSamplesStart != null) DeregisterValueTypeEventHandlers(TestSamplesStart);
+          TestSamplesStartParameter.Value = value;
+        }
+      }
+    }
+    public IntValue TestSamplesEnd {
+      get { return TestSamplesEndParameter.Value; }
+      set {
+        if (value != TestSamplesEnd) {
+          if (value == null) throw new ArgumentNullException();
+          if (TestSamplesEnd != null) DeregisterValueTypeEventHandlers(TestSamplesEnd);
+          TestSamplesEndParameter.Value = value;
+        }
+      }
+    }
+    public PercentValue ValidationPercentage {
+      get { return ValidationPercentageParameter.Value; }
+      set {
+        if (value != ValidationPercentage) {
+          if (value == null) throw new ArgumentNullException();
+          if (value.Value < 0 || value.Value > 1) throw new ArgumentException("ValidationPercentage must be between 0 and 1.");
+          if (ValidationPercentage != null) DeregisterValueTypeEventHandlers(ValidationPercentage);
+          ValidationPercentageParameter.Value = value;
+        }
+      }
+    }
+
+    public IEnumerable<int> TrainingIndizes {
+      get {
+        return Enumerable.Range(TrainingSamplesStart.Value, TrainingSamplesEnd.Value - TrainingSamplesStart.Value)
+                         .Where(i => i >= 0 && i < Dataset.Rows && (i < TestSamplesStart.Value || TestSamplesEnd.Value <= i));
+      }
+    }
+    public IEnumerable<int> TestIndizes {
+      get {
+        return Enumerable.Range(TestSamplesStart.Value, TestSamplesEnd.Value - TestSamplesStart.Value)
+           .Where(i => i >= 0 && i < Dataset.Rows);
+      }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected DataAnalysisProblemData(bool deserializing) : base(deserializing) { }
+    protected DataAnalysisProblemData(DataAnalysisProblemData original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterParameterEventHandlers();
+      RegisterParameterValueEventHandlers();
+    }
+    public DataAnalysisProblemData()
+      : base() {
+      var inputVariables = new CheckedItemList<StringValue>();
+      StringValue inputVariable = new StringValue("x");
+      inputVariables.Add(inputVariable);
+      StringValue targetVariable = new StringValue("y");
+      var validTargetVariables = new ItemSet<StringValue>();
+      validTargetVariables.Add(targetVariable);
+      Parameters.Add(new ValueParameter<Dataset>("Dataset", new Dataset(new string[] { "y", "x" }, kozaF1)));
+      Parameters.Add(new ValueParameter<ICheckedItemList<StringValue>>("InputVariables", inputVariables.AsReadOnly()));
+      Parameters.Add(new ConstrainedValueParameter<StringValue>("TargetVariable", validTargetVariables, targetVariable));
+      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", new IntValue(0)));
+      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesEnd", new IntValue(15)));
+      Parameters.Add(new ValueParameter<IntValue>("TestSamplesStart", new IntValue(15)));
+      Parameters.Add(new ValueParameter<IntValue>("TestSamplesEnd", new IntValue(25)));
+      Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
+
+      DatasetParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
+      RegisterParameterEventHandlers();
+      RegisterParameterValueEventHandlers();
+    }
+
+    public DataAnalysisProblemData(Dataset dataset, IEnumerable<string> inputVariables, string targetVariable,
+      int trainingSamplesStart, int trainingSamplesEnd, int testSamplesStart, int testSamplesEnd) {
+      var inputVariablesList = new CheckedItemList<StringValue>(inputVariables.Select(x => new StringValue(x)).ToList());
+      StringValue targetVariableValue = new StringValue(targetVariable);
+      var validTargetVariables = new ItemSet<StringValue>();
+      foreach (var variable in dataset.VariableNames)
+        if (variable != targetVariable)
+          validTargetVariables.Add(new StringValue(variable));
+      validTargetVariables.Add(targetVariableValue);
+      Parameters.Add(new ValueParameter<Dataset>("Dataset", dataset));
+      Parameters.Add(new ValueParameter<ICheckedItemList<StringValue>>("InputVariables", inputVariablesList.AsReadOnly()));
+      Parameters.Add(new ConstrainedValueParameter<StringValue>("TargetVariable", validTargetVariables, targetVariableValue));
+      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", new IntValue(trainingSamplesStart)));
+      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesEnd", new IntValue(trainingSamplesEnd)));
+      Parameters.Add(new ValueParameter<IntValue>("TestSamplesStart", new IntValue(testSamplesStart)));
+      Parameters.Add(new ValueParameter<IntValue>("TestSamplesEnd", new IntValue(testSamplesEnd)));
+      Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
+
+      DatasetParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
+      RegisterParameterEventHandlers();
+      RegisterParameterValueEventHandlers();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DataAnalysisProblemData(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey("ValidationPercentage"))
+        Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
+
+      DatasetParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
+      RegisterParameterEventHandlers();
+      RegisterParameterValueEventHandlers();
+    }
+
+    #region events
+    public event EventHandler ProblemDataChanged;
+    protected virtual void OnProblemDataChanged(EventArgs e) {
+      if (TrainingSamplesStart.Value < 0) TrainingSamplesStart.Value = 0;
+      else if (TestSamplesStart.Value < 0) TestSamplesStart.Value = 0;
+      else if (TrainingSamplesEnd.Value > Dataset.Rows - 1) TrainingSamplesEnd.Value = Dataset.Rows - 1;
+      else if (TestSamplesEnd.Value > Dataset.Rows - 1) TestSamplesEnd.Value = Dataset.Rows - 1;
+      else if (TrainingSamplesStart.Value > TrainingSamplesEnd.Value) TrainingSamplesStart.Value = TestSamplesEnd.Value;
+      else if (TestSamplesStart.Value > TestSamplesEnd.Value) TestSamplesStart.Value = TestSamplesEnd.Value;
+      else if (ValidationPercentage.Value < 0) ValidationPercentage.Value = 0;
+      else if (ValidationPercentage.Value > 1) ValidationPercentage.Value = 1;
+      else if (!TrainingIndizes.Any()) throw new ArgumentException("No training samples are available.");
+      else if (!suppressEvents) {
+        var listeners = ProblemDataChanged;
+        if (listeners != null) listeners(this, e);
+      }
+    }
+
+    private void RegisterParameterEventHandlers() {
+      DatasetParameter.ValueChanged += new EventHandler(DatasetParameter_ValueChanged);
+      InputVariablesParameter.ValueChanged += new EventHandler(InputVariablesParameter_ValueChanged);
+      TargetVariableParameter.ValueChanged += new EventHandler(TargetVariableParameter_ValueChanged);
+      TrainingSamplesStartParameter.ValueChanged += new EventHandler(TrainingSamplesStartParameter_ValueChanged);
+      TrainingSamplesEndParameter.ValueChanged += new EventHandler(TrainingSamplesEndParameter_ValueChanged);
+      TestSamplesStartParameter.ValueChanged += new EventHandler(TestSamplesStartParameter_ValueChanged);
+      TestSamplesEndParameter.ValueChanged += new EventHandler(TestSamplesEndParameter_ValueChanged);
+      ValidationPercentageParameter.ValueChanged += new EventHandler(ValidationPercentageParameter_ValueChanged);
+    }
+
+    private void RegisterParameterValueEventHandlers() {
+      RegisterInputVariablesEventHandlers();
+      if (TargetVariable != null) RegisterStringValueEventHandlers(TargetVariable);
+      RegisterValueTypeEventHandlers(TrainingSamplesStart);
+      RegisterValueTypeEventHandlers(TrainingSamplesEnd);
+      RegisterValueTypeEventHandlers(TestSamplesStart);
+      RegisterValueTypeEventHandlers(TestSamplesEnd);
+      RegisterValueTypeEventHandlers(ValidationPercentage);
+    }
+
+
+    #region parameter value changed event handlers
+    private void DatasetParameter_ValueChanged(object sender, EventArgs e) {
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void InputVariablesParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterInputVariablesEventHandlers();
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void TargetVariableParameter_ValueChanged(object sender, EventArgs e) {
+      if (TargetVariable != null) {
+        RegisterStringValueEventHandlers(TargetVariable);
+        OnProblemDataChanged(EventArgs.Empty);
+      }
+    }
+    private void TrainingSamplesStartParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(TrainingSamplesStart);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void TrainingSamplesEndParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(TrainingSamplesEnd);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void TestSamplesStartParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(TestSamplesStart);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void TestSamplesEndParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(TestSamplesEnd);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void ValidationPercentageParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(ValidationPercentage);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    #endregion
+
+    private void RegisterInputVariablesEventHandlers() {
+      InputVariables.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CollectionReset);
+      InputVariables.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsAdded);
+      InputVariables.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsRemoved);
+      InputVariables.CheckedItemsChanged += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CheckedItemsChanged);
+      foreach (var item in InputVariables) {
+        item.ValueChanged += new EventHandler(InputVariable_ValueChanged);
+      }
+    }
+
+    private void DeregisterInputVariablesEventHandlers() {
+      InputVariables.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CollectionReset);
+      InputVariables.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsAdded);
+      InputVariables.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsRemoved);
+      InputVariables.CheckedItemsChanged -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CheckedItemsChanged);
+      foreach (var item in InputVariables) {
+        item.ValueChanged -= new EventHandler(InputVariable_ValueChanged);
+      }
+    }
+
+    private void InputVariables_CheckedItemsChanged(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) {
+      OnProblemDataChanged(e);
+    }
+    private void InputVariables_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) {
+      foreach (var indexedItem in e.Items)
+        indexedItem.Value.ValueChanged -= new EventHandler(InputVariable_ValueChanged);
+      OnProblemDataChanged(e);
+    }
+    private void InputVariables_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) {
+      foreach (var indexedItem in e.Items)
+        indexedItem.Value.ValueChanged += new EventHandler(InputVariable_ValueChanged);
+      OnProblemDataChanged(e);
+    }
+    private void InputVariables_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) {
+      foreach (var indexedItem in e.OldItems)
+        indexedItem.Value.ValueChanged -= new EventHandler(InputVariable_ValueChanged);
+      OnProblemDataChanged(e);
+    }
+    private void InputVariable_ValueChanged(object sender, EventArgs e) {
+      OnProblemDataChanged(e);
+    }
+
+    #region helper
+    private void RegisterValueTypeEventHandlers<T>(ValueTypeValue<T> value) where T : struct {
+      value.ValueChanged += new EventHandler(value_ValueChanged);
+    }
+    private void DeregisterValueTypeEventHandlers<T>(ValueTypeValue<T> value) where T : struct {
+      value.ValueChanged -= new EventHandler(value_ValueChanged);
+    }
+    private void RegisterStringValueEventHandlers(StringValue value) {
+      value.ValueChanged += new EventHandler(value_ValueChanged);
+    }
+    private void DeregisterStringValueEventHandlers(StringValue value) {
+      value.ValueChanged -= new EventHandler(value_ValueChanged);
+    }
+
+    private void value_ValueChanged(object sender, EventArgs e) {
+      OnProblemDataChanged(e);
+    }
+    #endregion
+    #endregion
+
+    public virtual void ImportFromFile(string fileName) {
+      var csvFileParser = new CsvFileParser();
+      csvFileParser.Parse(fileName);
+      suppressEvents = true;
+      Name = "Data imported from " + Path.GetFileName(fileName);
+      Dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+      Dataset.Name = Path.GetFileName(fileName);
+      var variableNames = Dataset.VariableNames.Select(x => new StringValue(x).AsReadOnly()).ToList();
+      ((ConstrainedValueParameter<StringValue>)TargetVariableParameter).ValidValues.Clear();
+      foreach (var variableName in variableNames)
+        ((ConstrainedValueParameter<StringValue>)TargetVariableParameter).ValidValues.Add(variableName);
+      TargetVariable = variableNames.First();
+      InputVariables = new CheckedItemList<StringValue>(variableNames).AsReadOnly();
+      InputVariables.SetItemCheckedState(variableNames.First(), false);
+      int middle = (int)(csvFileParser.Rows * 0.5);
+      TrainingSamplesEnd = new IntValue(middle);
+      TrainingSamplesStart = new IntValue(0);
+      TestSamplesEnd = new IntValue(csvFileParser.Rows);
+      TestSamplesStart = new IntValue(middle);
+      suppressEvents = false;
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs	(revision 4858)
@@ -0,0 +1,164 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents a solution for a data analysis problem which can be visualized in the GUI.
+  /// </summary>
+  [Item("DataAnalysisSolution", "Represents a solution for a data analysis problem which can be visualized in the GUI.")]
+  [StorableClass]
+  public abstract class DataAnalysisSolution : NamedItem, IStorableContent {
+    #region IStorableContent Members
+    public string Filename { get; set; }
+    #endregion
+
+    [StorableConstructor]
+    protected DataAnalysisSolution(bool deserializing) : base(deserializing) { }
+    protected DataAnalysisSolution(DataAnalysisSolution original, Cloner cloner)
+      : base(original, cloner) {
+      problemData = (DataAnalysisProblemData)cloner.Clone(original.problemData);
+      model = (IDataAnalysisModel)cloner.Clone(original.model);
+      lowerEstimationLimit = original.lowerEstimationLimit;
+      upperEstimationLimit = original.upperEstimationLimit;
+      AfterDeserialization();
+    }
+    protected DataAnalysisSolution()
+      : base() { }
+    protected DataAnalysisSolution(DataAnalysisProblemData problemData) : this(problemData, double.NegativeInfinity, double.PositiveInfinity) { }
+    protected DataAnalysisSolution(DataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit)
+      : this() {
+      this.problemData = problemData;
+      this.lowerEstimationLimit = lowerEstimationLimit;
+      this.upperEstimationLimit = upperEstimationLimit;
+      AfterDeserialization();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (problemData != null)
+        RegisterProblemDataEvents();
+    }
+
+    [Storable]
+    private DataAnalysisProblemData problemData;
+    public DataAnalysisProblemData ProblemData {
+      get { return problemData; }
+      set {
+        if (problemData != value) {
+          if (value == null) throw new ArgumentNullException();
+          if (model != null && problemData != null && !problemData.InputVariables.Select(c => c.Value).SequenceEqual(
+            value.InputVariables.Select(c => c.Value)))
+            throw new ArgumentException("Could not set new problem data with different structure");
+
+          if (problemData != null) DeregisterProblemDataEvents();
+          problemData = value;
+          RegisterProblemDataEvents();
+          OnProblemDataChanged();
+          RecalculateEstimatedValues();
+        }
+      }
+    }
+
+    [Storable]
+    private IDataAnalysisModel model;
+    public IDataAnalysisModel Model {
+      get { return model; }
+      set {
+        if (model != value) {
+          if (value == null) throw new ArgumentNullException();
+          model = value;
+          OnModelChanged();
+          RecalculateEstimatedValues();
+        }
+      }
+    }
+
+    [Storable]
+    private double lowerEstimationLimit;
+    public double LowerEstimationLimit {
+      get { return lowerEstimationLimit; }
+      set {
+        if (lowerEstimationLimit != value) {
+          lowerEstimationLimit = value;
+          RecalculateEstimatedValues();
+        }
+      }
+    }
+
+    [Storable]
+    private double upperEstimationLimit;
+    public double UpperEstimationLimit {
+      get { return upperEstimationLimit; }
+      set {
+        if (upperEstimationLimit != value) {
+          upperEstimationLimit = value;
+          RecalculateEstimatedValues();
+        }
+      }
+    }
+
+    public abstract IEnumerable<double> EstimatedValues { get; }
+    public abstract IEnumerable<double> EstimatedTrainingValues { get; }
+    public abstract IEnumerable<double> EstimatedTestValues { get; }
+    protected abstract void RecalculateEstimatedValues();
+
+    #region Events
+    protected virtual void RegisterProblemDataEvents() {
+      ProblemData.ProblemDataChanged += new EventHandler(ProblemData_Changed);
+    }
+    protected virtual void DeregisterProblemDataEvents() {
+      ProblemData.ProblemDataChanged += new EventHandler(ProblemData_Changed);
+    }
+    private void ProblemData_Changed(object sender, EventArgs e) {
+      OnProblemDataChanged();
+    }
+
+    public event EventHandler ProblemDataChanged;
+    protected virtual void OnProblemDataChanged() {
+      var listeners = ProblemDataChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+
+    public event EventHandler ModelChanged;
+    protected virtual void OnModelChanged() {
+      EventHandler listeners = ModelChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+
+    public event EventHandler EstimatedValuesChanged;
+    protected virtual void OnEstimatedValuesChanged() {
+      var listeners = EstimatedValuesChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+    #endregion
+
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataFormatException.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataFormatException.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/DataFormatException.cs	(revision 4858)
@@ -0,0 +1,44 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Runtime.Serialization;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Serializable]
+  public class DataFormatException : Exception {
+    private int line;
+    public int Line {
+      get { return line; }
+    }
+    private string token;
+    public string Token {
+      get { return token; }
+    }
+    public DataFormatException(string message, string token, int line)
+      : base(message + "\nToken: " + token + " (line: " + line + ")") {
+      this.token = token;
+      this.line = line;
+    }
+
+    public DataFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs	(revision 4858)
@@ -0,0 +1,216 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Item("Dataset", "Represents a dataset containing data that should be analyzed.")]
+  [StorableClass]
+  public sealed class Dataset : NamedItem, IStringConvertibleMatrix {
+    [StorableConstructor]
+    private Dataset(bool deserializing) : base(deserializing) { }
+    private Dataset(Dataset original, Cloner cloner)
+      : base(original, cloner) {
+      variableNames = original.variableNames;
+      data = original.data;
+    }
+    public Dataset(IEnumerable<string> variableNames, double[,] data)
+      : base() {
+      Name = "-";
+      if (variableNames.Count() != data.GetLength(1)) {
+        throw new ArgumentException("Number of variable names doesn't match the number of columns of data");
+      }
+      this.data = (double[,])data.Clone();
+      this.variableNames = variableNames.ToArray();
+    }
+
+    [Storable]
+    private string[] variableNames;
+    public IEnumerable<string> VariableNames {
+      get { return variableNames; }
+    }
+
+    [Storable]
+    private double[,] data;
+    private double[,] Data {
+      get { return data; }
+    }
+
+    // elementwise access
+    public double this[int rowIndex, int columnIndex] {
+      get { return data[rowIndex, columnIndex]; }
+    }
+    public double this[string variableName, int rowIndex] {
+      get {
+        int columnIndex = GetVariableIndex(variableName);
+        return data[rowIndex, columnIndex];
+      }
+    }
+
+    public double[] GetVariableValues(int variableIndex) {
+      return GetVariableValues(variableIndex, 0, Rows);
+    }
+    public double[] GetVariableValues(int variableIndex, int start, int end) {
+      if (start < 0 || !(start <= end))
+        throw new ArgumentException("Start must be between 0 and end (" + end + ").");
+      if (end > Rows || end < start)
+        throw new ArgumentException("End must be between start (" + start + ") and dataset rows (" + Rows + ").");
+
+      double[] values = new double[end - start];
+      for (int i = 0; i < end - start; i++)
+        values[i] = data[i + start, variableIndex];
+      return values;
+    }
+    public double[] GetVariableValues(string variableName) {
+      return GetVariableValues(GetVariableIndex(variableName), 0, Rows);
+    }
+    public double[] GetVariableValues(string variableName, int start, int end) {
+      return GetVariableValues(GetVariableIndex(variableName), start, end);
+    }
+
+    public IEnumerable<double> GetEnumeratedVariableValues(int variableIndex) {
+      return GetEnumeratedVariableValues(variableIndex, 0, Rows);
+    }
+    public IEnumerable<double> GetEnumeratedVariableValues(int variableIndex, int start, int end) {
+      if (start < 0 || !(start <= end))
+        throw new ArgumentException("Start must be between 0 and end (" + end + ").");
+      if (end > Rows || end < start)
+        throw new ArgumentException("End must be between start (" + start + ") and dataset rows (" + Rows + ").");
+      for (int i = 0; i < end - start; i++)
+        yield return data[i + start, variableIndex];
+    }
+    public IEnumerable<double> GetEnumeratedVariableValues(int variableIndex, IEnumerable<int> rows) {
+      foreach (int row in rows)
+        yield return data[row, variableIndex];
+    }
+
+    public IEnumerable<double> GetEnumeratedVariableValues(string variableName) {
+      return GetEnumeratedVariableValues(GetVariableIndex(variableName), 0, Rows);
+    }
+    public IEnumerable<double> GetEnumeratedVariableValues(string variableName, int start, int end) {
+      return GetEnumeratedVariableValues(GetVariableIndex(variableName), start, end);
+    }
+    public IEnumerable<double> GetEnumeratedVariableValues(string variableName, IEnumerable<int> rows) {
+      return GetEnumeratedVariableValues(GetVariableIndex(variableName), rows);
+    }
+
+    public string GetVariableName(int variableIndex) {
+      return variableNames[variableIndex];
+    }
+
+    public int GetVariableIndex(string variableName) {
+      for (int i = 0; i < variableNames.Length; i++) {
+        if (variableNames[i].Equals(variableName)) return i;
+      }
+      throw new ArgumentException("The variable name " + variableName + " was not found.");
+    }
+
+    public double[,] GetClonedData() {
+      return (double[,])data.Clone();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Dataset(this, cloner);
+    }
+
+    public event EventHandler Reset;
+    private void OnReset(EventArgs e) {
+      var listeners = Reset;
+      if (listeners != null) listeners(this, e);
+    }
+
+    #region IStringConvertibleMatrix Members
+
+    public int Rows {
+      get { return data.GetLength(0); }
+      set { throw new NotSupportedException(); }
+    }
+
+    public int Columns {
+      get { return data.GetLength(1); }
+      set { throw new NotSupportedException(); }
+    }
+
+    public bool SortableView {
+      get { return false; }
+      set { throw new NotSupportedException(); }
+    }
+
+    public bool ReadOnly {
+      get { return true; }
+    }
+
+    IEnumerable<string> IStringConvertibleMatrix.ColumnNames {
+      get { return this.VariableNames; }
+      set { throw new NotSupportedException(); }
+    }
+
+    IEnumerable<string> IStringConvertibleMatrix.RowNames {
+      get { return new List<string>(); }
+      set { throw new NotSupportedException(); }
+    }
+
+    public bool Validate(string value, out string errorMessage) {
+      throw new NotSupportedException();
+    }
+
+    public string GetValue(int rowIndex, int columnIndex) {
+      return data[rowIndex, columnIndex].ToString();
+    }
+
+    public bool SetValue(string value, int rowIndex, int columnIndex) {
+      throw new NotSupportedException();
+    }
+
+    public event EventHandler ColumnNamesChanged;
+    private void OnColumnNamesChanged() {
+      EventHandler listeners = ColumnNamesChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+    public event EventHandler RowNamesChanged;
+    private void OnRowNamesChanged() {
+      EventHandler listeners = RowNamesChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+    public event EventHandler SortableViewChanged;
+    private void OnSortableViewChanged() {
+      EventHandler listeners = SortableViewChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+    public event EventHandler<EventArgs<int, int>> ItemChanged;
+    private void OnItemChanged(int rowIndex, int columnIndex) {
+      var listeners = ItemChanged;
+      if (listeners != null)
+        listeners(this, new EventArgs<int, int>(rowIndex, columnIndex));
+      OnToStringChanged();
+    }
+    #endregion
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineCovarianceEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineCovarianceEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineCovarianceEvaluator.cs	(revision 4858)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineCovarianceEvaluator : IOnlineEvaluator {
+
+    private double originalMean, estimatedMean, Cn;
+    private int n;
+    public double Covariance {
+      get {
+        if (n < 1)
+          throw new InvalidOperationException("No elements");
+        else
+          return Cn / n;
+      }
+    }
+
+    public OnlineCovarianceEvaluator() {
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return Covariance; }
+    }
+    public void Reset() {
+      n = 0;
+      Cn = 0.0;
+      originalMean = 0.0;
+      estimatedMean = 0.0;
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Covariance is not defined for series containing NaN or infinity elements");
+      } else {
+        n++;
+        // online calculation of tMean
+        originalMean = originalMean + (original - originalMean) / n;
+        double delta = estimated - estimatedMean; // delta = (y - yMean(n-1))
+        estimatedMean = estimatedMean + delta / n;
+
+        // online calculation of covariance
+        Cn = Cn + delta * (original - originalMean); // C(n) = C(n-1) + (y - yMean(n-1)) (t - tMean(n))       
+      }
+    }
+    #endregion
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs	(revision 4858)
@@ -0,0 +1,66 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineMeanAbsolutePercentageErrorEvaluator : IOnlineEvaluator {
+
+    private double sre;
+    private int n;
+    public double MeanAbsolutePercentageError {
+      get {
+        if (n < 1)
+          throw new InvalidOperationException("No elements");
+        else
+          return sre / n;
+      }
+    }
+
+    public OnlineMeanAbsolutePercentageErrorEvaluator() {
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return MeanAbsolutePercentageError; }
+    }
+    public void Reset() {
+      n = 0;
+      sre = 0.0;
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Relative error is not defined for variables with NaN or infinity values.");
+      } else {
+        if (!original.IsAlmost(0.0)) {
+          sre += Math.Abs((estimated - original) / original);
+          n++;
+        }
+      }
+    }
+
+    #endregion
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAndVarianceCalculator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAndVarianceCalculator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAndVarianceCalculator.cs	(revision 4858)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineMeanAndVarianceCalculator {
+
+    private double m_oldM, m_newM, m_oldS, m_newS;
+    private int n;
+
+    public double Variance {
+      get {
+        return (n > 1) ? m_newS / (n - 1) : 0.0;
+      }
+    }
+
+    public double PopulationVariance {
+      get {
+        return (n > 0) ? m_newS / n : 0.0;
+      }
+    }
+
+    public double Mean {
+      get {
+        return (n > 0) ? m_newM : 0.0;
+      }
+    }
+
+    public int Count {
+      get { return n; }
+    }
+
+    public OnlineMeanAndVarianceCalculator() {
+      Reset();
+    }
+
+    public void Reset() {
+      n = 0;
+    }
+
+    public void Add(double x) {
+      if (double.IsNaN(x) || double.IsInfinity(x)) {
+        throw new ArgumentException("Mean and variance are not defined for NaN or infinity elements");
+      } else {
+        n++;
+        // See Knuth TAOCP vol 2, 3rd edition, page 232
+        if (n == 1) {
+          m_oldM = m_newM = x;
+          m_oldS = 0.0;
+        } else {
+          m_newM = m_oldM + (x - m_oldM) / n;
+          m_newS = m_oldS + (x - m_oldM) * (x - m_newM);
+
+          // set up for next iteration
+          m_oldM = m_newM;
+          m_oldS = m_newS;
+        }
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanSquaredErrorEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanSquaredErrorEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanSquaredErrorEvaluator.cs	(revision 4858)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineMeanSquaredErrorEvaluator : IOnlineEvaluator {
+
+    private double sse;
+    private int n;
+    public double MeanSquaredError {
+      get {
+        if (n < 1)
+          throw new InvalidOperationException("No elements");
+        else
+          return sse / n;
+      }
+    }
+
+    public OnlineMeanSquaredErrorEvaluator() {
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return MeanSquaredError; }
+    }
+    public void Reset() {
+      n = 0;
+      sse = 0.0;
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Mean squared error is not defined for NaN or infinity elements");
+      } else {
+        double error = estimated - original;
+        sse += error * error;
+        n++;
+      }
+    }
+    #endregion
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs	(revision 4858)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineNormalizedMeanSquaredErrorEvaluator : IOnlineEvaluator {
+    private OnlineMeanAndVarianceCalculator meanSquaredErrorCalculator;
+    private OnlineMeanAndVarianceCalculator originalVarianceCalculator;
+
+    public double NormalizedMeanSquaredError {
+      get {
+        return meanSquaredErrorCalculator.Mean / originalVarianceCalculator.Variance;
+      }
+    }
+
+    public OnlineNormalizedMeanSquaredErrorEvaluator() {
+      meanSquaredErrorCalculator = new OnlineMeanAndVarianceCalculator();
+      originalVarianceCalculator = new OnlineMeanAndVarianceCalculator();
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return NormalizedMeanSquaredError; }
+    }
+
+    public void Reset() {
+      meanSquaredErrorCalculator.Reset();
+      originalVarianceCalculator.Reset();
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Mean squared error is not defined for NaN or infinity elements");
+      } else {
+        double error = estimated - original;
+        meanSquaredErrorCalculator.Add(error * error);
+        originalVarianceCalculator.Add(original);
+      }
+    }
+    #endregion
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlinePearsonsRSquaredEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlinePearsonsRSquaredEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlinePearsonsRSquaredEvaluator.cs	(revision 4858)
@@ -0,0 +1,71 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlinePearsonsRSquaredEvaluator : IOnlineEvaluator {
+    private OnlineCovarianceEvaluator covEvaluator = new OnlineCovarianceEvaluator();
+    private OnlineMeanAndVarianceCalculator sxEvaluator = new OnlineMeanAndVarianceCalculator();
+    private OnlineMeanAndVarianceCalculator syEvaluator = new OnlineMeanAndVarianceCalculator();
+
+    public double RSquared {
+      get {
+        double xVar = sxEvaluator.PopulationVariance;
+        double yVar = syEvaluator.PopulationVariance;
+        if (xVar.IsAlmost(0.0) || yVar.IsAlmost(0.0)) {
+          return 0.0;
+        } else {
+          double r = covEvaluator.Covariance / (Math.Sqrt(xVar) * Math.Sqrt(yVar));
+          return r * r;
+        }
+      }
+    }
+
+    public OnlinePearsonsRSquaredEvaluator() { }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return RSquared; }
+    }
+    public void Reset() {
+      covEvaluator.Reset();
+      sxEvaluator.Reset();
+      syEvaluator.Reset();
+    }
+
+    public void Add(double x, double y) {
+      if (IsInvalidValue(x) || IsInvalidValue(y)) {
+        throw new ArgumentException("R² is not defined for variables with NaN or infinity values.");
+      }
+      covEvaluator.Add(x, y);
+      sxEvaluator.Add(x);
+      syEvaluator.Add(y);
+    }
+
+    #endregion
+
+    private bool IsInvalidValue(double x) {
+      return double.IsNaN(x) || double.IsInfinity(x);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleEvaluator.cs	(revision 4858)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public abstract class SimpleEvaluator : SingleSuccessorOperator {
+    public const int ORIGINAL_INDEX = 0;
+    public const int ESTIMATION_INDEX = 1;
+
+    public ILookupParameter<DoubleMatrix> ValuesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters["Values"]; }
+    }
+    [StorableConstructor]
+    protected SimpleEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleEvaluator(SimpleEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SimpleEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Values", "Table of original and predicted values for which the quality value should be evaluated."));
+    }
+
+    public override IOperation Apply() {
+      DoubleMatrix values = ValuesParameter.ActualValue;
+      Apply(values);
+      return base.Apply();
+    }
+
+    protected abstract void Apply(DoubleMatrix values);
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMSEEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMSEEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMSEEvaluator.cs	(revision 4858)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleMSEEvaluator : SimpleEvaluator {
+
+    public ILookupParameter<DoubleValue> MeanSquaredErrorParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MeanSquaredError"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleMSEEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleMSEEvaluator(SimpleMSEEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleMSEEvaluator(this, cloner);
+    }
+    public SimpleMSEEvaluator() {
+      Parameters.Add(new LookupParameter<DoubleValue>("MeanSquaredError", "The mean squared error of estimated values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      MeanSquaredErrorParameter.ActualValue = new DoubleValue(Calculate(values));
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      var onlineMseEvaluator = new OnlineMeanSquaredErrorEvaluator();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+        onlineMseEvaluator.Add(o, e);
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return onlineMseEvaluator.MeanSquaredError;
+      }
+    }
+
+    public static double Calculate(DoubleMatrix values) {
+      var original = from row in Enumerable.Range(0, values.Rows)
+                     select values[row, ORIGINAL_INDEX];
+      var estimated = from row in Enumerable.Range(0, values.Rows)
+                      select values[row, ESTIMATION_INDEX];
+      return Calculate(original, estimated);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageErrorEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageErrorEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageErrorEvaluator.cs	(revision 4858)
@@ -0,0 +1,74 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleMeanAbsolutePercentageErrorEvaluator : SimpleEvaluator {
+    public ILookupParameter<PercentValue> AverageRelativeErrorParameter {
+      get { return (ILookupParameter<PercentValue>)Parameters["AverageRelativeError"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleMeanAbsolutePercentageErrorEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleMeanAbsolutePercentageErrorEvaluator(SimpleMeanAbsolutePercentageErrorEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SimpleMeanAbsolutePercentageErrorEvaluator() {
+      Parameters.Add(new LookupParameter<PercentValue>("AverageRelativeError", "The average relative error of estimated values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+      AverageRelativeErrorParameter.ActualValue = new PercentValue(Calculate(original, estimated));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleMeanAbsolutePercentageErrorEvaluator(this, cloner);
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      OnlineMeanAbsolutePercentageErrorEvaluator onlineEvaluator = new OnlineMeanAbsolutePercentageErrorEvaluator();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+        onlineEvaluator.Add(o, e);
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return onlineEvaluator.MeanAbsolutePercentageError;
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs	(revision 4858)
@@ -0,0 +1,92 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleMeanAbsolutePercentageOfRangeErrorEvaluator : SimpleEvaluator {
+
+    public ILookupParameter<PercentValue> AveragePercentageOfRangeErrorParameter {
+      get { return (ILookupParameter<PercentValue>)Parameters["AveragePercentageOfRangeError"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleMeanAbsolutePercentageOfRangeErrorEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleMeanAbsolutePercentageOfRangeErrorEvaluator(SimpleMeanAbsolutePercentageOfRangeErrorEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SimpleMeanAbsolutePercentageOfRangeErrorEvaluator() {
+      Parameters.Add(new LookupParameter<PercentValue>("AveragePercentageOfRangeError", "The average relative (percentage of range) error of estimated values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+      AveragePercentageOfRangeErrorParameter.ActualValue = new PercentValue(Calculate(original, estimated));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleMeanAbsolutePercentageOfRangeErrorEvaluator(this, cloner);
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      double errorsSum = 0.0;
+      int n = 0;
+      IList<double> originalList = original as IList<double>;
+      if (originalList == null) originalList = original.ToList();
+
+      double range = originalList.Max() - originalList.Min();
+      if (double.IsInfinity(range)) return double.MaxValue;
+      if (range.IsAlmost(0.0)) return double.MaxValue;
+
+
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+
+        if (!double.IsNaN(e) && !double.IsInfinity(e) &&
+          !double.IsNaN(o) && !double.IsInfinity(o) && !o.IsAlmost(0.0)) {
+          double percent_error = Math.Abs((e - o) / range);
+          errorsSum += percent_error;
+          n++;
+        }
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else if (n == 0) {
+        return double.MaxValue;
+      } else {
+        return errorsSum / n;
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleNMSEEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleNMSEEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleNMSEEvaluator.cs	(revision 4858)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleNMSEEvaluator : SimpleEvaluator {
+
+    public ILookupParameter<DoubleValue> NormalizedMeanSquaredErrorParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["NormalizedMeanSquaredError"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleNMSEEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleNMSEEvaluator(SimpleNMSEEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleNMSEEvaluator(this, cloner);
+    }
+    public SimpleNMSEEvaluator() {
+      Parameters.Add(new LookupParameter<DoubleValue>("NormalizedMeanSquaredError", "The normalized mean squared error (divided by variance) of estimated values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+
+      NormalizedMeanSquaredErrorParameter.ActualValue = new DoubleValue(Calculate(original, estimated));
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      OnlineNormalizedMeanSquaredErrorEvaluator nmseEvaluator = new OnlineNormalizedMeanSquaredErrorEvaluator();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        nmseEvaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
+      }
+      if (originalEnumerator.MoveNext() || estimatedEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumerations doesn't match.");
+      }
+      return nmseEvaluator.NormalizedMeanSquaredError;
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleRSquaredEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleRSquaredEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleRSquaredEvaluator.cs	(revision 4858)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleRSquaredEvaluator : SimpleEvaluator {
+    public ILookupParameter<DoubleValue> RSquaredParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["RSquared"]; }
+    }
+    [StorableConstructor]
+    protected SimpleRSquaredEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleRSquaredEvaluator(SimpleRSquaredEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleRSquaredEvaluator(this, cloner);
+    }
+    public SimpleRSquaredEvaluator() {
+      Parameters.Add(new LookupParameter<DoubleValue>("RSquared", "The squared Pearson's Product Moment Correlation (R²) of estimated values and original values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+      RSquaredParameter.ActualValue = new DoubleValue(Calculate(original, estimated));
+    }
+
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      var onlinePearsonRSquaredEvaluator = new OnlinePearsonsRSquaredEvaluator();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+        onlinePearsonRSquaredEvaluator.Add(o, e);
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return onlinePearsonRSquaredEvaluator.RSquared;
+      }
+    }
+
+    private static bool IsInvalidValue(double d) {
+      return double.IsNaN(d) || double.IsInfinity(d);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleVarianceAccountedForEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleVarianceAccountedForEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleVarianceAccountedForEvaluator.cs	(revision 4858)
@@ -0,0 +1,91 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  /// <summary>
+  /// The Variance Accounted For (VAF) function calculates is computed as
+  /// VAF(y,y') =  1 - var(y-y')/var(y)
+  /// where y' denotes the predicted / modelled values for y and var(x) the variance of a signal x.
+  /// </summary>
+  public class SimpleVarianceAccountedForEvaluator : SimpleEvaluator {
+
+    public ILookupParameter<DoubleValue> VarianceAccountedForParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["VarianceAccountedFor"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleVarianceAccountedForEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleVarianceAccountedForEvaluator(SimpleVarianceAccountedForEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleVarianceAccountedForEvaluator(this, cloner);
+    }
+    public SimpleVarianceAccountedForEvaluator() {
+      Parameters.Add(new LookupParameter<DoubleValue>("VarianceAccountedFor", "The variance of the original values accounted for by the estimated values (VAF(y,y') = 1 - var(y-y') / var(y) )."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+      VarianceAccountedForParameter.ActualValue = new DoubleValue(Calculate(original, estimated));
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      var errors = new List<double>();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+        if (!double.IsNaN(e) && !double.IsInfinity(e) &&
+          !double.IsNaN(o) && !double.IsInfinity(o)) {
+          errors.Add(o - e);
+        }
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      }
+
+      double errorsVariance = errors.Variance();
+      double originalsVariance = original.Variance();
+      if (originalsVariance.IsAlmost(0.0))
+        if (errorsVariance.IsAlmost(0.0)) {
+          return 1.0;
+        } else {
+          return double.MaxValue;
+        } else {
+        return 1.0 - errorsVariance / originalsVariance;
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj	(revision 4858)
@@ -0,0 +1,274 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis-3.3</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.2.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.LibSVM-1.6.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\LibSVM-1.6.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabProblemsDataAnalysisPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+    <Compile Include="Evaluators\OnlineCovarianceEvaluator.cs" />
+    <Compile Include="Evaluators\OnlineMeanAndVarianceCalculator.cs" />
+    <Compile Include="Evaluators\OnlineNormalizedMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="DataAnalysisSolution.cs" />
+    <Compile Include="CsvFileParser.cs" />
+    <Compile Include="DataAnalysisProblem.cs" />
+    <Compile Include="DataAnalysisProblemData.cs" />
+    <Compile Include="DataFormatException.cs" />
+    <Compile Include="Dataset.cs" />
+    <Compile Include="Evaluators\OnlineMeanAbsolutePercentageErrorEvaluator.cs" />
+    <Compile Include="Evaluators\OnlineMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="Evaluators\OnlinePearsonsRSquaredEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleMeanAbsolutePercentageErrorEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleMSEEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleNMSEEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleRSquaredEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleVarianceAccountedForEvaluator.cs" />
+    <Compile Include="HeuristicLabProblemsDataAnalysisPlugin.cs" />
+    <Compile Include="Interfaces\ISingleObjectiveDataAnalysisProblem.cs" />
+    <Compile Include="Interfaces\IDataAnalysisModel.cs" />
+    <Compile Include="Interfaces\IDataAnalysisProblem.cs" />
+    <Compile Include="Interfaces\IOnlineEvaluator.cs" />
+    <Compile Include="MatrixExtensions.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="RandomEnumerable.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineCrossValidationEvaluator.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineModel.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineModelCreator.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineModelEvaluator.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineUtil.cs" />
+    <Compile Include="Symbolic\ArithmeticExpressionGrammar.cs" />
+    <Compile Include="Symbolic\FullFunctionalExpressionGrammar.cs" />
+    <Compile Include="Symbolic\ISymbolicExpressionTreeInterpreter.cs" />
+    <Compile Include="Symbolic\SimpleArithmeticExpressionInterpreter.cs" />
+    <Compile Include="Symbolic\SymbolicSimplifier.cs" />
+    <Compile Include="Symbolic\Symbols\Addition.cs" />
+    <Compile Include="Symbolic\Symbols\Constant.cs" />
+    <Compile Include="Symbolic\Symbols\ConstantTreeNode.cs" />
+    <Compile Include="Symbolic\Symbols\LaggedVariable.cs" />
+    <Compile Include="Symbolic\Symbols\LaggedVariableTreeNode.cs" />
+    <Compile Include="Symbolic\Symbols\GreaterThan.cs" />
+    <Compile Include="Symbolic\Symbols\LessThan.cs" />
+    <Compile Include="Symbolic\Symbols\And.cs" />
+    <Compile Include="Symbolic\Symbols\Or.cs" />
+    <Compile Include="Symbolic\Symbols\Not.cs" />
+    <Compile Include="Symbolic\Symbols\Logarithm.cs" />
+    <Compile Include="Symbolic\Symbols\Exponential.cs" />
+    <Compile Include="Symbolic\Symbols\Sine.cs" />
+    <Compile Include="Symbolic\Symbols\Cosine.cs" />
+    <Compile Include="Symbolic\Symbols\Tangent.cs" />
+    <Compile Include="Symbolic\Symbols\Average.cs" />
+    <Compile Include="Symbolic\Symbols\IfThenElse.cs" />
+    <Compile Include="Symbolic\Symbols\Division.cs" />
+    <Compile Include="Symbolic\Symbols\Multiplication.cs" />
+    <Compile Include="Symbolic\Symbols\Subtraction.cs" />
+    <Compile Include="Symbolic\Symbols\Variable.cs" />
+    <Compile Include="Symbolic\Symbols\VariableTreeNode.cs" />
+    <Compile Include="Symbolic\VariableFrequencyAnalyser.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj">
+      <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Operators\" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <PostBuildEvent>copy "$(TargetPath)" "C:\Program Files\HeuristicLab 3.3\"</PostBuildEvent>
+  </PropertyGroup>
+</Project>
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLabProblemsDataAnalysisPlugin.cs.frame
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLabProblemsDataAnalysisPlugin.cs.frame	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLabProblemsDataAnalysisPlugin.cs.frame	(revision 4858)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Plugin("HeuristicLab.Problems.DataAnalysis","3.3.1.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.ALGLIB", "2.5")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.3")]
+  [PluginDependency("HeuristicLab.LibSVM", "1.6.3.0")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization","3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  public class HeuristicLabProblemsDataAnalysisPlugin : PluginBase {
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs	(revision 4858)
@@ -0,0 +1,29 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDataAnalysisModel : INamedItem {
+    IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end);
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisProblem.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisProblem.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisProblem.cs	(revision 4858)
@@ -0,0 +1,28 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDataAnalysisProblem : IProblem {
+    DataAnalysisProblemData DataAnalysisProblemData { get; }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IOnlineEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IOnlineEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IOnlineEvaluator.cs	(revision 4858)
@@ -0,0 +1,29 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IOnlineEvaluator {
+    double Value { get; }
+    void Reset();
+    void Add(double original, double estimated);
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ISingleObjectiveDataAnalysisProblem.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ISingleObjectiveDataAnalysisProblem.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ISingleObjectiveDataAnalysisProblem.cs	(revision 4858)
@@ -0,0 +1,26 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Optimization;
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface ISingleObjectiveDataAnalysisProblem : ISingleObjectiveProblem, IDataAnalysisProblem {
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/MatrixExtensions.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/MatrixExtensions.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/MatrixExtensions.cs	(revision 4858)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public static class MatrixExtensions<T> {
+    public static T[,] Create(T[] first, T[] second) {
+      if (first.Length != second.Length)
+        throw new ArgumentException("Both arrays must be of same length.");
+      T[,] array = new T[first.Length, 2];
+      for (int i = 0; i < first.Length; i++) {
+        array[i, 0] = first[i];
+        array[i, 1] = second[i];
+      }
+      return array;
+    }
+
+    public static T[] GetColumn(T[,] matrix, int column) {
+      if (column >= matrix.GetLength(1)) throw new ArgumentException("Invalid column index: " + column + ". Matrix has only " + matrix.GetLength(1) + " columns.");
+      T[] result = new T[matrix.GetLength(0)];
+      for (int i = 0; i < result.Length; i++) {
+        result[i] = matrix[i, column];
+      }
+      return result;
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Properties/AssemblyInfo.frame
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Properties/AssemblyInfo.frame	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Properties/AssemblyInfo.frame	(revision 4858)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis")]
+[assembly: AssemblyDescription("HeuristicLab generic data analysis problem classes")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("73d531fb-a823-4000-b980-3087eb5975f1")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.1.$WCREV$")]
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/RandomEnumerable.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/RandomEnumerable.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/RandomEnumerable.cs	(revision 4858)
@@ -0,0 +1,52 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class RandomEnumerable {
+    public static IEnumerable<int> SampleRandomNumbers(int maxElement, int count) {
+      return SampleRandomNumbers(Environment.TickCount, 0, maxElement, count);
+    }
+
+    public static IEnumerable<int> SampleRandomNumbers(int start, int end, int count) {
+      return SampleRandomNumbers(Environment.TickCount, start, end, count);
+    }
+
+    //algorithm taken from progamming pearls page 127
+    //IMPORTANT because IEnumerables with yield are used the seed must best be specified to return always 
+    //the same sequence of numbers without caching the values.
+    public static IEnumerable<int> SampleRandomNumbers(int seed, int start, int end, int count) {
+      int remaining = end - start;
+      var mt = new FastRandom(seed);
+      for (int i = start; i < end && count > 0; i++) {
+        double probability = mt.NextDouble();
+        if (probability < ((double)count) / remaining) {
+          count--;
+          yield return i;
+        }
+        remaining--;
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 4858)
@@ -0,0 +1,254 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  /// <summary>
+  /// Represents an operator that performs SVM cross validation with the given parameters.
+  /// </summary>
+  [StorableClass]
+  [Item("SupportVectorMachineCrossValidationEvaluator", "Represents an operator that performs SVM cross validation with the given parameters.")]
+  public class SupportVectorMachineCrossValidationEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {
+    private const string RandomParameterName = "Random";
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string SvmTypeParameterName = "SvmType";
+    private const string KernelTypeParameterName = "KernelType";
+    private const string CostParameterName = "Cost";
+    private const string NuParameterName = "Nu";
+    private const string GammaParameterName = "Gamma";
+    private const string EpsilonParameterName = "Epsilon";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string ActualSamplesParameterName = "ActualSamples";
+    private const string NumberOfFoldsParameterName = "NumberOfFolds";
+    private const string QualityParameterName = "Quality";
+
+    #region parameter properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> SvmTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[SvmTypeParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> KernelTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[KernelTypeParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> NuParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[NuParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> CostParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[CostParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> GammaParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[GammaParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> EpsilonParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[EpsilonParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> ActualSamplesParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[ActualSamplesParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> NumberOfFoldsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[NumberOfFoldsParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public StringValue SvmType {
+      get { return SvmTypeParameter.ActualValue; }
+    }
+    public StringValue KernelType {
+      get { return KernelTypeParameter.ActualValue; }
+    }
+    public DoubleValue Nu {
+      get { return NuParameter.ActualValue; }
+    }
+    public DoubleValue Cost {
+      get { return CostParameter.ActualValue; }
+    }
+    public DoubleValue Gamma {
+      get { return GammaParameter.ActualValue; }
+    }
+    public DoubleValue Epsilon {
+      get { return EpsilonParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    public IntValue NumberOfFolds {
+      get { return NumberOfFoldsParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SupportVectorMachineCrossValidationEvaluator(bool deserializing) : base(deserializing) { }
+
+    protected SupportVectorMachineCrossValidationEvaluator(SupportVectorMachineCrossValidationEvaluator original,
+      Cloner cloner)
+      : base(original, cloner) { }
+    public SupportVectorMachineCrossValidationEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(NuParameterName, "The value of the nu parameter nu-SVC, one-class SVM and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(CostParameterName, "The value of the C (cost) parameter of C-SVC, epsilon-SVR and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(GammaParameterName, "The value of the gamma parameter in the kernel function."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(EpsilonParameterName, "The value of the epsilon parameter for epsilon-SVR."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(ActualSamplesParameterName, "The percentage of the training set that should be acutally used for cross-validation (samples are picked randomly from the training set)."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(NumberOfFoldsParameterName, "The number of folds to use for cross-validation."));
+      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The cross validation quality reached with the given parameters."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineCrossValidationEvaluator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      double reductionRatio = 1.0; // TODO: make parameter
+      if (ActualSamplesParameter.ActualValue != null)
+        reductionRatio = ActualSamplesParameter.ActualValue.Value;
+      IEnumerable<int> rows =
+        Enumerable.Range(SamplesStart.Value, SamplesEnd.Value - SamplesStart.Value)
+        .Where(i => i < DataAnalysisProblemData.TestSamplesStart.Value || DataAnalysisProblemData.TestSamplesEnd.Value <= i);
+
+      // create a new DataAnalysisProblemData instance
+      DataAnalysisProblemData reducedProblemData = (DataAnalysisProblemData)DataAnalysisProblemData.Clone();
+      reducedProblemData.Dataset =
+        CreateReducedDataset(RandomParameter.ActualValue, reducedProblemData.Dataset, rows, reductionRatio);
+      reducedProblemData.TrainingSamplesStart.Value = 0;
+      reducedProblemData.TrainingSamplesEnd.Value = reducedProblemData.Dataset.Rows;
+      reducedProblemData.TestSamplesStart.Value = reducedProblemData.Dataset.Rows;
+      reducedProblemData.TestSamplesEnd.Value = reducedProblemData.Dataset.Rows;
+      reducedProblemData.ValidationPercentage.Value = 0;
+
+      double quality = PerformCrossValidation(reducedProblemData,
+                             SvmType.Value, KernelType.Value,
+                             Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value, NumberOfFolds.Value);
+
+      QualityParameter.ActualValue = new DoubleValue(quality);
+      return base.Apply();
+    }
+
+    private Dataset CreateReducedDataset(IRandom random, Dataset dataset, IEnumerable<int> rowIndices, double reductionRatio) {
+
+      // must not make a fink:
+      // => select n rows randomly from start..end
+      // => sort the selected rows by index
+      // => move rows to beginning of partition (start)
+
+      // all possible rowIndexes from start..end
+      int[] rowIndexArr = rowIndices.ToArray();
+      int n = (int)Math.Max(1.0, rowIndexArr.Length * reductionRatio);
+
+      // knuth shuffle
+      for (int i = rowIndexArr.Length - 1; i > 0; i--) {
+        int j = random.Next(0, i);
+        // swap
+        int tmp = rowIndexArr[i];
+        rowIndexArr[i] = rowIndexArr[j];
+        rowIndexArr[j] = tmp;
+      }
+
+      // take the first n indexes (selected n rowIndexes from start..end)
+      // now order by index
+      int[] orderedRandomIndexes =
+        rowIndexArr.Take(n)
+        .OrderBy(x => x)
+        .ToArray();
+
+      // now build a dataset containing only rows from orderedRandomIndexes 
+      double[,] reducedData = new double[n, dataset.Columns];
+      for (int i = 0; i < n; i++) {
+        for (int column = 0; column < dataset.Columns; column++) {
+          reducedData[i, column] = dataset[orderedRandomIndexes[i], column];
+        }
+      }
+      return new Dataset(dataset.VariableNames, reducedData);
+    }
+
+    private static double PerformCrossValidation(
+      DataAnalysisProblemData problemData,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon,
+      int nFolds) {
+      return PerformCrossValidation(problemData, problemData.TrainingIndizes, svmType, kernelType, cost, nu, gamma, epsilon, nFolds);
+    }
+
+    public static double PerformCrossValidation(
+      DataAnalysisProblemData problemData,
+      IEnumerable<int> rowIndices,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon,
+      int nFolds) {
+      int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
+
+      //extract SVM parameters from scope and set them
+      SVM.Parameter parameter = new SVM.Parameter();
+      parameter.SvmType = (SVM.SvmType)Enum.Parse(typeof(SVM.SvmType), svmType, true);
+      parameter.KernelType = (SVM.KernelType)Enum.Parse(typeof(SVM.KernelType), kernelType, true);
+      parameter.C = cost;
+      parameter.Nu = nu;
+      parameter.Gamma = gamma;
+      parameter.P = epsilon;
+      parameter.CacheSize = 500;
+      parameter.Probability = false;
+
+
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, rowIndices);
+      SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
+      SVM.Problem scaledProblem = Scaling.Scale(rangeTransform, problem);
+
+      return SVM.Training.PerformCrossValidation(scaledProblem, parameter, nFolds, false);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs	(revision 4858)
@@ -0,0 +1,181 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  /// <summary>
+  /// Represents a support vector machine model.
+  /// </summary>
+  [StorableClass]
+  [Item("SupportVectorMachineModel", "Represents a support vector machine model.")]
+  public sealed class SupportVectorMachineModel : NamedItem, IDataAnalysisModel {
+    [StorableConstructor]
+    private SupportVectorMachineModel(bool deserializing) : base(deserializing) { }
+    private SupportVectorMachineModel(SupportVectorMachineModel original, Cloner cloner)
+      : base(original, cloner) {
+      // only using a shallow copy here! (gkronber)
+      this.model = original.model;
+      this.rangeTransform = original.rangeTransform;
+    }
+    public SupportVectorMachineModel() : base() { }
+
+    private SVM.Model model;
+    /// <summary>
+    /// Gets or sets the SVM model.
+    /// </summary>
+    public SVM.Model Model {
+      get { return model; }
+      set {
+        if (value != model) {
+          if (value == null) throw new ArgumentNullException();
+          model = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    /// <summary>
+    /// Gets or sets the range transformation for the model.
+    /// </summary>
+    private SVM.RangeTransform rangeTransform;
+    public SVM.RangeTransform RangeTransform {
+      get { return rangeTransform; }
+      set {
+        if (value != rangeTransform) {
+          if (value == null) throw new ArgumentNullException();
+          rangeTransform = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    public IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end) {
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, Enumerable.Range(start, end - start));
+      SVM.Problem scaledProblem = Scaling.Scale(RangeTransform, problem);
+
+      return (from row in Enumerable.Range(0, scaledProblem.Count)
+              select SVM.Prediction.Predict(Model, scaledProblem.X[row]))
+              .ToList();
+    }
+
+    #region events
+    public event EventHandler Changed;
+    private void OnChanged(EventArgs e) {
+      var handlers = Changed;
+      if (handlers != null)
+        handlers(this, e);
+    }
+    #endregion
+
+    #region persistence
+    [Storable]
+    private int[] SupportVectorIndizes {
+      get { return this.Model.SupportVectorIndizes; }
+      set { this.Model.SupportVectorIndizes = value; }
+    }
+
+    [Storable]
+    private string ModelAsString {
+      get {
+        using (MemoryStream stream = new MemoryStream()) {
+          SVM.Model.Write(stream, Model);
+          stream.Seek(0, System.IO.SeekOrigin.Begin);
+          StreamReader reader = new StreamReader(stream);
+          return reader.ReadToEnd();
+        }
+      }
+      set {
+        using (MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(value))) {
+          model = SVM.Model.Read(stream);
+        }
+      }
+    }
+    [Storable]
+    private string RangeTransformAsString {
+      get {
+        using (MemoryStream stream = new MemoryStream()) {
+          SVM.RangeTransform.Write(stream, RangeTransform);
+          stream.Seek(0, System.IO.SeekOrigin.Begin);
+          StreamReader reader = new StreamReader(stream);
+          return reader.ReadToEnd();
+        }
+      }
+      set {
+        using (MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(value))) {
+          RangeTransform = SVM.RangeTransform.Read(stream);
+        }
+      }
+    }
+    #endregion
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineModel(this, cloner);
+    }
+
+    /// <summary>
+    ///  Exports the <paramref name="model"/> in string representation to stream <paramref name="s"/>
+    /// </summary>
+    /// <param name="model">The support vector regression model to export</param>
+    /// <param name="s">The stream to export the model to</param>
+    public static void Export(SupportVectorMachineModel model, Stream s) {
+      StreamWriter writer = new StreamWriter(s);
+      writer.WriteLine("RangeTransform:");
+      writer.Flush();
+      using (MemoryStream memStream = new MemoryStream()) {
+        SVM.RangeTransform.Write(memStream, model.RangeTransform);
+        memStream.Seek(0, SeekOrigin.Begin);
+        memStream.WriteTo(s);
+      }
+      writer.WriteLine("Model:");
+      writer.Flush();
+      using (MemoryStream memStream = new MemoryStream()) {
+        SVM.Model.Write(memStream, model.Model);
+        memStream.Seek(0, SeekOrigin.Begin);
+        memStream.WriteTo(s);
+      }
+      s.Flush();
+    }
+
+    /// <summary>
+    /// Imports a support vector machine model given as string representation.
+    /// </summary>
+    /// <param name="reader">The reader to retrieve the string representation from</param>
+    /// <returns>The imported support vector machine model.</returns>
+    public static SupportVectorMachineModel Import(TextReader reader) {
+      SupportVectorMachineModel model = new SupportVectorMachineModel();
+      while (reader.ReadLine().Trim() != "RangeTransform:") ; // read until line "RangeTransform";
+      model.RangeTransform = SVM.RangeTransform.Read(reader);
+      // read until "Model:"
+      while (reader.ReadLine().Trim() != "Model:") ;
+      model.Model = SVM.Model.Read(reader);
+      return model;
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs	(revision 4858)
@@ -0,0 +1,187 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  /// <summary>
+  /// Represents an operator that creates a support vector machine model.
+  /// </summary>
+  [StorableClass]
+  [Item("SupportVectorMachineModelCreator", "Represents an operator that creates a support vector machine model.")]
+  public sealed class SupportVectorMachineModelCreator : SingleSuccessorOperator {
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string SvmTypeParameterName = "SvmType";
+    private const string KernelTypeParameterName = "KernelType";
+    private const string CostParameterName = "Cost";
+    private const string NuParameterName = "Nu";
+    private const string GammaParameterName = "Gamma";
+    private const string EpsilonParameterName = "Epsilon";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string ModelParameterName = "SupportVectorMachineModel";
+
+    #region parameter properties
+    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> SvmTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[SvmTypeParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> KernelTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[KernelTypeParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> NuParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[NuParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> CostParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[CostParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> GammaParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[GammaParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> EpsilonParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[EpsilonParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public ILookupParameter<SupportVectorMachineModel> SupportVectorMachineModelParameter {
+      get { return (ILookupParameter<SupportVectorMachineModel>)Parameters[ModelParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public StringValue SvmType {
+      get { return SvmTypeParameter.Value; }
+    }
+    public StringValue KernelType {
+      get { return KernelTypeParameter.Value; }
+    }
+    public DoubleValue Nu {
+      get { return NuParameter.ActualValue; }
+    }
+    public DoubleValue Cost {
+      get { return CostParameter.ActualValue; }
+    }
+    public DoubleValue Gamma {
+      get { return GammaParameter.ActualValue; }
+    }
+    public DoubleValue Epsilon {
+      get { return EpsilonParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SupportVectorMachineModelCreator(bool deserializing) : base(deserializing) { }
+    private SupportVectorMachineModelCreator(SupportVectorMachineModelCreator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineModelCreator(this, cloner);
+    }
+    public SupportVectorMachineModelCreator()
+      : base() {
+      StringValue nuSvrType = new StringValue("NU_SVR").AsReadOnly();
+      StringValue rbfKernelType = new StringValue("RBF").AsReadOnly();
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", nuSvrType));
+      Parameters.Add(new ValueLookupParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", rbfKernelType));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(NuParameterName, "The value of the nu parameter nu-SVC, one-class SVM and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(CostParameterName, "The value of the C (cost) parameter of C-SVC, epsilon-SVR and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(GammaParameterName, "The value of the gamma parameter in the kernel function."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(EpsilonParameterName, "The value of the epsilon parameter for epsilon-SVR."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new LookupParameter<SupportVectorMachineModel>(ModelParameterName, "The result model generated by the SVM."));
+    }
+
+    public override IOperation Apply() {
+      int start = SamplesStart.Value;
+      int end = SamplesEnd.Value;
+      IEnumerable<int> rows =
+        Enumerable.Range(start, end - start)
+        .Where(i => i < DataAnalysisProblemData.TestSamplesStart.Value || DataAnalysisProblemData.TestSamplesEnd.Value <= i);
+
+      SupportVectorMachineModel model = TrainModel(DataAnalysisProblemData,
+                             rows,
+                             SvmType.Value, KernelType.Value,
+                             Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value);
+      SupportVectorMachineModelParameter.ActualValue = model;
+
+      return base.Apply();
+    }
+
+    private static SupportVectorMachineModel TrainModel(
+      DataAnalysisProblemData problemData,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon) {
+      return TrainModel(problemData, problemData.TrainingIndizes, svmType, kernelType, cost, nu, gamma, epsilon);
+    }
+
+    public static SupportVectorMachineModel TrainModel(
+      DataAnalysisProblemData problemData,
+      IEnumerable<int> trainingIndizes,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon) {
+      int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
+
+      //extract SVM parameters from scope and set them
+      SVM.Parameter parameter = new SVM.Parameter();
+      parameter.SvmType = (SVM.SvmType)Enum.Parse(typeof(SVM.SvmType), svmType, true);
+      parameter.KernelType = (SVM.KernelType)Enum.Parse(typeof(SVM.KernelType), kernelType, true);
+      parameter.C = cost;
+      parameter.Nu = nu;
+      parameter.Gamma = gamma;
+      parameter.P = epsilon;
+      parameter.CacheSize = 500;
+      parameter.Probability = false;
+
+
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, trainingIndizes);
+      SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
+      SVM.Problem scaledProblem = Scaling.Scale(rangeTransform, problem);
+      var model = new SupportVectorMachineModel();
+      model.Model = SVM.Training.Train(scaledProblem, parameter);
+      model.RangeTransform = rangeTransform;
+
+      return model;
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelEvaluator.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelEvaluator.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelEvaluator.cs	(revision 4858)
@@ -0,0 +1,117 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2009 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  [StorableClass]
+  [Item("SupportVectorMachineModelEvaluator", "Represents a operator that evaluates a support vector machine model on a data set.")]
+  public class SupportVectorMachineModelEvaluator : SingleSuccessorOperator {
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string ModelParameterName = "SupportVectorMachineModel";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string ValuesParameterName = "Values";
+
+    #region parameter properties
+    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public ILookupParameter<SupportVectorMachineModel> SupportVectorMachineModelParameter {
+      get { return (ILookupParameter<SupportVectorMachineModel>)Parameters[ModelParameterName]; }
+    }
+    public ILookupParameter<DoubleMatrix> ValuesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters[ValuesParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public SupportVectorMachineModel SupportVectorMachineModel {
+      get { return SupportVectorMachineModelParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SupportVectorMachineModelEvaluator(bool deserializing) : base(deserializing) { }
+    protected SupportVectorMachineModelEvaluator(SupportVectorMachineModelEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineModelEvaluator(this, cloner);
+    }
+    public SupportVectorMachineModelEvaluator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
+      Parameters.Add(new LookupParameter<SupportVectorMachineModel>(ModelParameterName, "The result model generated by the SVM."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition on which the SVM model should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition on which the SVM model should be evaluated."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>(ValuesParameterName, "A matrix of original values of the target variable and output values of the SVM model."));
+    }
+
+    public override IOperation Apply() {
+      int start = SamplesStart.Value;
+      int end = SamplesEnd.Value;
+      IEnumerable<int> rows =
+        Enumerable.Range(start, end - start)
+        .Where(i => i < DataAnalysisProblemData.TestSamplesStart.Value || DataAnalysisProblemData.TestSamplesEnd.Value <= i);
+
+      ValuesParameter.ActualValue = new DoubleMatrix(Evaluate(SupportVectorMachineModel, DataAnalysisProblemData, rows));
+      return base.Apply();
+    }
+
+    public static double[,] Evaluate(SupportVectorMachineModel model, DataAnalysisProblemData problemData, IEnumerable<int> rowIndices) {
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, rowIndices);
+      SVM.Problem scaledProblem = model.RangeTransform.Scale(problem);
+
+      int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
+
+      double[,] values = new double[scaledProblem.Count, 2];
+      var rowEnumerator = rowIndices.GetEnumerator();
+      for (int i = 0; i < scaledProblem.Count; i++) {
+        rowEnumerator.MoveNext();
+        values[i, 0] = problemData.Dataset[rowEnumerator.Current, targetVariableIndex];
+        values[i, 1] = SVM.Prediction.Predict(model.Model, scaledProblem.X[i]);
+      }
+
+      return values;
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineUtil.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineUtil.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineUtil.cs	(revision 4858)
@@ -0,0 +1,59 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  public class SupportVectorMachineUtil {
+    /// <summary>
+    /// Transforms <paramref name="problemData"/> into a data structure as needed by libSVM.
+    /// </summary>
+    /// <param name="problemData">The problem data to transform</param>
+    /// <param name="rowIndices">The rows of the dataset that should be contained in the resulting SVM-problem</param>
+    /// <returns>A problem data type that can be used to train a support vector machine.</returns>
+    public static SVM.Problem CreateSvmProblem(DataAnalysisProblemData problemData, IEnumerable<int> rowIndices) {
+      double[] targetVector =
+        problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable.Value, rowIndices)
+        .ToArray();
+
+      SVM.Node[][] nodes = new SVM.Node[targetVector.Length][];
+      List<SVM.Node> tempRow;
+      int maxNodeIndex = 0;
+      int svmProblemRowIndex = 0;
+      foreach (int row in rowIndices) {
+        tempRow = new List<SVM.Node>();
+        foreach (var inputVariable in problemData.InputVariables.CheckedItems) {
+          int col = problemData.Dataset.GetVariableIndex(inputVariable.Value.Value);
+          double value = problemData.Dataset[row, col];
+          if (!double.IsNaN(value)) {
+            int nodeIndex = col + 1; // make sure the smallest nodeIndex is 1 (libSVM convention)
+            tempRow.Add(new SVM.Node(nodeIndex, value));
+            if (nodeIndex > maxNodeIndex) maxNodeIndex = nodeIndex;
+          }
+        }
+        nodes[svmProblemRowIndex++] = tempRow.OrderBy(x => x.Index).ToArray(); // make sure the values are sorted by node index
+      }
+
+      return new SVM.Problem(targetVector.Length, targetVector, nodes, maxNodeIndex);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ArithmeticExpressionGrammar.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ArithmeticExpressionGrammar.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ArithmeticExpressionGrammar.cs	(revision 4858)
@@ -0,0 +1,84 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")]
+  public class ArithmeticExpressionGrammar : DefaultSymbolicExpressionGrammar {
+
+    [StorableConstructor]
+    protected ArithmeticExpressionGrammar(bool deserializing) : base(deserializing) { }
+    protected ArithmeticExpressionGrammar(ArithmeticExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public ArithmeticExpressionGrammar()
+      : base() {
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArithmeticExpressionGrammar(this, cloner);
+    }
+
+    private void Initialize() {
+      var add = new Addition();
+      var sub = new Subtraction();
+      var mul = new Multiplication();
+      var div = new Division();
+      var constant = new Constant();
+      constant.MinValue = -20;
+      constant.MaxValue = 20;
+      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
+
+      var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol };
+      var functionSymbols = new List<Symbol>() { add, sub, mul, div };
+
+      foreach (var symb in allSymbols)
+        AddSymbol(symb);
+
+      foreach (var funSymb in functionSymbols) {
+        SetMinSubtreeCount(funSymb, 1);
+        SetMaxSubtreeCount(funSymb, 3);
+      }
+      SetMinSubtreeCount(constant, 0);
+      SetMaxSubtreeCount(constant, 0);
+      SetMinSubtreeCount(variableSymbol, 0);
+      SetMaxSubtreeCount(variableSymbol, 0);
+
+      // allow each symbol as child of the start symbol
+      foreach (var symb in allSymbols) {
+        SetAllowedChild(StartSymbol, symb, 0);
+      }
+
+      // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
+      foreach (var parent in allSymbols) {
+        for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
+          foreach (var child in allSymbols) {
+            SetAllowedChild(parent, child, i);
+          }
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs	(revision 4858)
@@ -0,0 +1,114 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("FullFunctionalExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
+  public class FullFunctionalExpressionGrammar : DefaultSymbolicExpressionGrammar {
+    [StorableConstructor]
+    protected FullFunctionalExpressionGrammar(bool deserializing) : base(deserializing) { }
+    protected FullFunctionalExpressionGrammar(FullFunctionalExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public FullFunctionalExpressionGrammar()
+      : base() {
+      Initialize();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FullFunctionalExpressionGrammar(this, cloner);
+    }
+
+    private void Initialize() {
+      var add = new Addition();
+      var sub = new Subtraction();
+      var mul = new Multiplication();
+      var div = new Division();
+      var mean = new Average();
+      var sin = new Sine();
+      var cos = new Cosine();
+      var tan = new Tangent();
+      var log = new Logarithm();
+      var exp = new Exponential();
+      var @if = new IfThenElse();
+      var gt = new GreaterThan();
+      var lt = new LessThan();
+      var and = new And();
+      var or = new Or();
+      var not = new Not();
+      var constant = new Constant();
+      constant.MinValue = -20;
+      constant.MaxValue = 20;
+      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
+      var laggedVariable = new LaggedVariable();
+      laggedVariable.InitialFrequency = 0.0;
+
+      var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, constant, variableSymbol, laggedVariable };
+      var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not };
+      var binaryFunctionSymbols = new List<Symbol>() { gt, lt };
+      var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or };
+      var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable };
+
+      foreach (var symb in allSymbols)
+        AddSymbol(symb);
+
+      foreach (var funSymb in functionSymbols) {
+        SetMinSubtreeCount(funSymb, 1);
+        SetMaxSubtreeCount(funSymb, 3);
+      }
+      foreach (var funSymb in unaryFunctionSymbols) {
+        SetMinSubtreeCount(funSymb, 1);
+        SetMaxSubtreeCount(funSymb, 1);
+      }
+      foreach (var funSymb in binaryFunctionSymbols) {
+        SetMinSubtreeCount(funSymb, 2);
+        SetMaxSubtreeCount(funSymb, 2);
+      }
+
+      foreach (var terminalSymbol in terminalSymbols) {
+        SetMinSubtreeCount(terminalSymbol, 0);
+        SetMaxSubtreeCount(terminalSymbol, 0);
+      }
+
+      SetMinSubtreeCount(@if, 3);
+      SetMaxSubtreeCount(@if, 3);
+
+
+      // allow each symbol as child of the start symbol
+      foreach (var symb in allSymbols) {
+        SetAllowedChild(StartSymbol, symb, 0);
+      }
+
+      // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
+      foreach (var parent in allSymbols) {
+        for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
+          foreach (var child in allSymbols) {
+            SetAllowedChild(parent, child, i);
+          }
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ISymbolicExpressionTreeInterpreter.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ISymbolicExpressionTreeInterpreter.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ISymbolicExpressionTreeInterpreter.cs	(revision 4858)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicExpressionTreeInterpreter : IItem {
+    IEnumerable<double> GetSymbolicExpressionTreeValues(SymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows);
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs	(revision 4858)
@@ -0,0 +1,305 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Compiler;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SimpleArithmeticExpressionInterpreter", "Interpreter for arithmetic symbolic expression trees including function calls.")]
+  // not thread safe!
+  public sealed class SimpleArithmeticExpressionInterpreter : NamedItem, ISymbolicExpressionTreeInterpreter {
+    private class OpCodes {
+      public const byte Add = 1;
+      public const byte Sub = 2;
+      public const byte Mul = 3;
+      public const byte Div = 4;
+
+      public const byte Sin = 5;
+      public const byte Cos = 6;
+      public const byte Tan = 7;
+
+      public const byte Log = 8;
+      public const byte Exp = 9;
+
+      public const byte IfThenElse = 10;
+
+      public const byte GT = 11;
+      public const byte LT = 12;
+
+      public const byte AND = 13;
+      public const byte OR = 14;
+      public const byte NOT = 15;
+
+
+      public const byte Average = 16;
+
+      public const byte Call = 17;
+
+      public const byte Variable = 18;
+      public const byte LagVariable = 19;
+      public const byte Constant = 20;
+      public const byte Arg = 21;
+    }
+
+    private Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
+      { typeof(Addition), OpCodes.Add },
+      { typeof(Subtraction), OpCodes.Sub },
+      { typeof(Multiplication), OpCodes.Mul },
+      { typeof(Division), OpCodes.Div },
+      { typeof(Sine), OpCodes.Sin },
+      { typeof(Cosine), OpCodes.Cos },
+      { typeof(Tangent), OpCodes.Tan },
+      { typeof(Logarithm), OpCodes.Log },
+      { typeof(Exponential), OpCodes.Exp },
+      { typeof(IfThenElse), OpCodes.IfThenElse },
+      { typeof(GreaterThan), OpCodes.GT },
+      { typeof(LessThan), OpCodes.LT },
+      { typeof(And), OpCodes.AND },
+      { typeof(Or), OpCodes.OR },
+      { typeof(Not), OpCodes.NOT},
+      { typeof(Average), OpCodes.Average},
+      { typeof(InvokeFunction), OpCodes.Call },
+      { typeof(HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable), OpCodes.Variable },
+      { typeof(LaggedVariable), OpCodes.LagVariable },
+      { typeof(Constant), OpCodes.Constant },
+      { typeof(Argument), OpCodes.Arg },
+    };
+    private const int ARGUMENT_STACK_SIZE = 1024;
+
+    private Dataset dataset;
+    private int row;
+    private Instruction[] code;
+    private int pc;
+    private double[] argumentStack = new double[ARGUMENT_STACK_SIZE];
+    private int argStackPointer;
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    [StorableConstructor]
+    private SimpleArithmeticExpressionInterpreter(bool deserializing) : base(deserializing) { }
+    private SimpleArithmeticExpressionInterpreter(SimpleArithmeticExpressionInterpreter original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleArithmeticExpressionInterpreter(this, cloner);
+    }
+
+    public SimpleArithmeticExpressionInterpreter()
+      : base() {
+    }
+
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(SymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
+      this.dataset = dataset;
+      var compiler = new SymbolicExpressionTreeCompiler();
+      compiler.AddInstructionPostProcessingHook(PostProcessInstruction);
+      code = compiler.Compile(tree, MapSymbolToOpCode);
+      foreach (var row in rows) {
+        this.row = row;
+        pc = 0;
+        argStackPointer = 0;
+        yield return Evaluate();
+      }
+    }
+
+    private Instruction PostProcessInstruction(Instruction instr) {
+      if (instr.opCode == OpCodes.Variable) {
+        var variableTreeNode = instr.dynamicNode as VariableTreeNode;
+        instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
+      } else if (instr.opCode == OpCodes.LagVariable) {
+        var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode;
+        instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
+      }
+      return instr;
+    }
+
+    private byte MapSymbolToOpCode(SymbolicExpressionTreeNode treeNode) {
+      if (symbolToOpcode.ContainsKey(treeNode.Symbol.GetType()))
+        return symbolToOpcode[treeNode.Symbol.GetType()];
+      else
+        throw new NotSupportedException("Symbol: " + treeNode.Symbol);
+    }
+
+    private double Evaluate() {
+      Instruction currentInstr = code[pc++];
+      switch (currentInstr.opCode) {
+        case OpCodes.Add: {
+            double s = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              s += Evaluate();
+            }
+            return s;
+          }
+        case OpCodes.Sub: {
+            double s = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              s -= Evaluate();
+            }
+            if (currentInstr.nArguments == 1) s = -s;
+            return s;
+          }
+        case OpCodes.Mul: {
+            double p = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              p *= Evaluate();
+            }
+            return p;
+          }
+        case OpCodes.Div: {
+            double p = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              p /= Evaluate();
+            }
+            if (currentInstr.nArguments == 1) p = 1.0 / p;
+            return p;
+          }
+        case OpCodes.Average: {
+            double sum = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              sum += Evaluate();
+            }
+            return sum / currentInstr.nArguments;
+          }
+        case OpCodes.Cos: {
+            return Math.Cos(Evaluate());
+          }
+        case OpCodes.Sin: {
+            return Math.Sin(Evaluate());
+          }
+        case OpCodes.Tan: {
+            return Math.Tan(Evaluate());
+          }
+        case OpCodes.Exp: {
+            return Math.Exp(Evaluate());
+          }
+        case OpCodes.Log: {
+            return Math.Log(Evaluate());
+          }
+        case OpCodes.IfThenElse: {
+            double condition = Evaluate();
+            double result;
+            if (condition > 0.0) {
+              result = Evaluate(); SkipBakedCode();
+            } else {
+              SkipBakedCode(); result = Evaluate();
+            }
+            return result;
+          }
+        case OpCodes.AND: {
+            double result = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              if (result <= 0.0) SkipBakedCode();
+              else {
+                result = Evaluate();
+              }
+            }
+            return result <= 0.0 ? -1.0 : 1.0;
+          }
+        case OpCodes.OR: {
+            double result = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              if (result > 0.0) SkipBakedCode();
+              else {
+                result = Evaluate();
+              }
+            }
+            return result > 0.0 ? 1.0 : -1.0;
+          }
+        case OpCodes.NOT: {
+            return -Evaluate();
+          }
+        case OpCodes.GT: {
+            double x = Evaluate();
+            double y = Evaluate();
+            if (x > y) return 1.0;
+            else return -1.0;
+          }
+        case OpCodes.LT: {
+            double x = Evaluate();
+            double y = Evaluate();
+            if (x < y) return 1.0;
+            else return -1.0;
+          }
+        case OpCodes.Call: {
+            // evaluate sub-trees
+            // push on argStack in reverse order 
+            for (int i = 0; i < currentInstr.nArguments; i++) {
+              argumentStack[argStackPointer + currentInstr.nArguments - i] = Evaluate();
+            }
+            argStackPointer += currentInstr.nArguments;
+
+            // save the pc
+            int nextPc = pc;
+            // set pc to start of function  
+            pc = currentInstr.iArg0;
+            // evaluate the function
+            double v = Evaluate();
+
+            // decrease the argument stack pointer by the number of arguments pushed
+            // to set the argStackPointer back to the original location
+            argStackPointer -= currentInstr.nArguments;
+
+            // restore the pc => evaluation will continue at point after my subtrees  
+            pc = nextPc;
+            return v;
+          }
+        case OpCodes.Arg: {
+            return argumentStack[argStackPointer - currentInstr.iArg0];
+          }
+        case OpCodes.Variable: {
+            var variableTreeNode = currentInstr.dynamicNode as VariableTreeNode;
+            return dataset[row, currentInstr.iArg0] * variableTreeNode.Weight;
+          }
+        case OpCodes.LagVariable: {
+            var lagVariableTreeNode = currentInstr.dynamicNode as LaggedVariableTreeNode;
+            int actualRow = row + lagVariableTreeNode.Lag;
+            if (actualRow < 0 || actualRow >= dataset.Rows) throw new ArgumentException("Out of range access to dataset row: " + row);
+            return dataset[actualRow, currentInstr.iArg0] * lagVariableTreeNode.Weight;
+          }
+        case OpCodes.Constant: {
+            var constTreeNode = currentInstr.dynamicNode as ConstantTreeNode;
+            return constTreeNode.Value;
+          }
+        default: throw new NotSupportedException();
+      }
+    }
+
+    // skips a whole branch
+    private void SkipBakedCode() {
+      int i = 1;
+      while (i > 0) {
+        i += code[pc++].nArguments;
+        i--;
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SymbolicSimplifier.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SymbolicSimplifier.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SymbolicSimplifier.cs	(revision 4858)
@@ -0,0 +1,529 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Simplistic simplifier for arithmetic expressions
+  /// </summary>
+  public class SymbolicSimplifier {
+    private Addition addSymbol = new Addition();
+    private Multiplication mulSymbol = new Multiplication();
+    private Division divSymbol = new Division();
+    private Constant constSymbol = new Constant();
+    private Variable varSymbol = new Variable();
+
+    public SymbolicExpressionTree Simplify(SymbolicExpressionTree originalTree) {
+      var clone = (SymbolicExpressionTreeNode)originalTree.Root.Clone();
+      // macro expand (initially no argument trees)
+      var macroExpandedTree = MacroExpand(clone, clone.SubTrees[0], new List<SymbolicExpressionTreeNode>());
+      SymbolicExpressionTreeNode rootNode = (new ProgramRootSymbol()).CreateTreeNode();
+      rootNode.AddSubTree(GetSimplifiedTree(macroExpandedTree));
+      return new SymbolicExpressionTree(rootNode);
+    }
+
+    // the argumentTrees list contains already expanded trees used as arguments for invocations
+    private SymbolicExpressionTreeNode MacroExpand(SymbolicExpressionTreeNode root, SymbolicExpressionTreeNode node, IList<SymbolicExpressionTreeNode> argumentTrees) {
+      List<SymbolicExpressionTreeNode> subtrees = new List<SymbolicExpressionTreeNode>(node.SubTrees);
+      while (node.SubTrees.Count > 0) node.RemoveSubTree(0);
+      if (node.Symbol is InvokeFunction) {
+        var invokeSym = node.Symbol as InvokeFunction;
+        var defunNode = FindFunctionDefinition(root, invokeSym.FunctionName);
+        var macroExpandedArguments = new List<SymbolicExpressionTreeNode>();
+        foreach (var subtree in subtrees) {
+          macroExpandedArguments.Add(MacroExpand(root, subtree, argumentTrees));
+        }
+        return MacroExpand(root, defunNode, macroExpandedArguments);
+      } else if (node.Symbol is Argument) {
+        var argSym = node.Symbol as Argument;
+        // return the correct argument sub-tree (already macro-expanded)
+        return (SymbolicExpressionTreeNode)argumentTrees[argSym.ArgumentIndex].Clone();
+      } else {
+        // recursive application
+        foreach (var subtree in subtrees) {
+          node.AddSubTree(MacroExpand(root, subtree, argumentTrees));
+        }
+        return node;
+      }
+    }
+
+    private SymbolicExpressionTreeNode FindFunctionDefinition(SymbolicExpressionTreeNode root, string functionName) {
+      foreach (var subtree in root.SubTrees.OfType<DefunTreeNode>()) {
+        if (subtree.FunctionName == functionName) return subtree.SubTrees[0];
+      }
+
+      throw new ArgumentException("Definition of function " + functionName + " not found.");
+    }
+
+
+    #region symbol predicates
+    private bool IsDivision(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Division;
+    }
+
+    private bool IsMultiplication(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Multiplication;
+    }
+
+    private bool IsSubtraction(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Subtraction;
+    }
+
+    private bool IsAddition(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Addition;
+    }
+
+    private bool IsVariable(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Variable;
+    }
+
+    private bool IsConstant(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Constant;
+    }
+
+    private bool IsAverage(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Average;
+    }
+    private bool IsLog(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Logarithm;
+    }
+    private bool IsIfThenElse(SymbolicExpressionTreeNode original) {
+      return original.Symbol is IfThenElse;
+    }
+    #endregion
+
+    /// <summary>
+    /// Creates a new simplified tree
+    /// </summary>
+    /// <param name="original"></param>
+    /// <returns></returns>
+    public SymbolicExpressionTreeNode GetSimplifiedTree(SymbolicExpressionTreeNode original) {
+      if (IsConstant(original) || IsVariable(original)) {
+        return (SymbolicExpressionTreeNode)original.Clone();
+      } else if (IsAddition(original)) {
+        return SimplifyAddition(original);
+      } else if (IsSubtraction(original)) {
+        return SimplifySubtraction(original);
+      } else if (IsMultiplication(original)) {
+        return SimplifyMultiplication(original);
+      } else if (IsDivision(original)) {
+        return SimplifyDivision(original);
+      } else if (IsAverage(original)) {
+        return SimplifyAverage(original);
+      } else if (IsLog(original)) {
+        // TODO simplify logarithm
+        return SimplifyAny(original);
+      } else if (IsIfThenElse(original)) {
+        // TODO simplify conditionals
+        return SimplifyAny(original);
+      } else if (IsAverage(original)) {
+        return SimplifyAverage(original);
+      } else {
+        return SimplifyAny(original);
+      }
+    }
+
+    #region specific simplification routines
+    private SymbolicExpressionTreeNode SimplifyAny(SymbolicExpressionTreeNode original) {
+      // can't simplify this function but simplify all subtrees 
+      List<SymbolicExpressionTreeNode> subTrees = new List<SymbolicExpressionTreeNode>(original.SubTrees);
+      while (original.SubTrees.Count > 0) original.RemoveSubTree(0);
+      var clone = (SymbolicExpressionTreeNode)original.Clone();
+      List<SymbolicExpressionTreeNode> simplifiedSubTrees = new List<SymbolicExpressionTreeNode>();
+      foreach (var subTree in subTrees) {
+        simplifiedSubTrees.Add(GetSimplifiedTree(subTree));
+        original.AddSubTree(subTree);
+      }
+      foreach (var simplifiedSubtree in simplifiedSubTrees) {
+        clone.AddSubTree(simplifiedSubtree);
+      }
+      if (simplifiedSubTrees.TrueForAll(t => IsConstant(t))) {
+        SimplifyConstantExpression(clone);
+      }
+      return clone;
+    }
+
+    private SymbolicExpressionTreeNode SimplifyConstantExpression(SymbolicExpressionTreeNode original) {
+      // not yet implemented
+      return original;
+    }
+
+    private SymbolicExpressionTreeNode SimplifyAverage(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return GetSimplifiedTree(original.SubTrees[0]);
+      } else {
+        // simplify expressions x0..xn
+        // make sum(x0..xn) / n
+        Trace.Assert(original.SubTrees.Count > 1);
+        var sum = original.SubTrees
+          .Select(x => GetSimplifiedTree(x))
+          .Aggregate((a, b) => MakeSum(a, b));
+        return MakeFraction(sum, MakeConstant(original.SubTrees.Count));
+      }
+    }
+
+    private SymbolicExpressionTreeNode SimplifyDivision(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return Invert(GetSimplifiedTree(original.SubTrees[0]));
+      } else {
+        // simplify expressions x0..xn
+        // make multiplication (x0 * 1/(x1 * x1 * .. * xn))
+        Trace.Assert(original.SubTrees.Count > 1);
+        var simplifiedTrees = original.SubTrees.Select(x => GetSimplifiedTree(x));
+        return
+          MakeProduct(simplifiedTrees.First(), Invert(simplifiedTrees.Skip(1).Aggregate((a, b) => MakeProduct(a, b))));
+      }
+    }
+
+    private SymbolicExpressionTreeNode SimplifyMultiplication(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return GetSimplifiedTree(original.SubTrees[0]);
+      } else {
+        Trace.Assert(original.SubTrees.Count > 1);
+        return original.SubTrees
+          .Select(x => GetSimplifiedTree(x))
+          .Aggregate((a, b) => MakeProduct(a, b));
+      }
+    }
+
+    private SymbolicExpressionTreeNode SimplifySubtraction(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return Negate(GetSimplifiedTree(original.SubTrees[0]));
+      } else {
+        // simplify expressions x0..xn
+        // make addition (x0,-x1..-xn)
+        Trace.Assert(original.SubTrees.Count > 1);
+        var simplifiedTrees = original.SubTrees.Select(x => GetSimplifiedTree(x));
+        return simplifiedTrees.Take(1)
+          .Concat(simplifiedTrees.Skip(1).Select(x => Negate(x)))
+          .Aggregate((a, b) => MakeSum(a, b));
+      }
+    }
+
+    private SymbolicExpressionTreeNode SimplifyAddition(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return GetSimplifiedTree(original.SubTrees[0]);
+      } else {
+        // simplify expression x0..xn
+        // make addition (x0..xn)
+        Trace.Assert(original.SubTrees.Count > 1);
+        return original.SubTrees
+          .Select(x => GetSimplifiedTree(x))
+          .Aggregate((a, b) => MakeSum(a, b));
+      }
+    }
+    #endregion
+
+
+
+    #region low level tree restructuring
+    // MakeFraction, MakeProduct and MakeSum take two already simplified trees and create a new simplified tree
+
+    private SymbolicExpressionTreeNode MakeFraction(SymbolicExpressionTreeNode a, SymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        // fold constants
+        return MakeConstant(((ConstantTreeNode)a).Value / ((ConstantTreeNode)b).Value);
+      } if (IsConstant(a) && !((ConstantTreeNode)a).Value.IsAlmost(1.0)) {
+        return MakeFraction(MakeConstant(1.0), MakeProduct(b, Invert(a)));
+      } else if (IsVariable(a) && IsConstant(b)) {
+        // merge constant values into variable weights
+        var constB = ((ConstantTreeNode)b).Value;
+        ((VariableTreeNode)a).Weight /= constB;
+        return a;
+      } else if (IsAddition(a) && IsConstant(b)) {
+        return a.SubTrees
+          .Select(x => GetSimplifiedTree(x))
+         .Select(x => MakeFraction(x, b))
+         .Aggregate((c, d) => MakeSum(c, d));
+      } else if (IsMultiplication(a) && IsConstant(b)) {
+        return MakeProduct(a, Invert(b));
+      } else if (IsDivision(a) && IsConstant(b)) {
+        // (a1 / a2) / c => (a1 / (a2 * c))
+        Trace.Assert(a.SubTrees.Count == 2);
+        return MakeFraction(a.SubTrees[0], MakeProduct(a.SubTrees[1], b));
+      } else if (IsDivision(a) && IsDivision(b)) {
+        // (a1 / a2) / (b1 / b2) => 
+        Trace.Assert(a.SubTrees.Count == 2);
+        Trace.Assert(b.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(a.SubTrees[0], b.SubTrees[1]), MakeProduct(a.SubTrees[1], b.SubTrees[0]));
+      } else if (IsDivision(a)) {
+        // (a1 / a2) / b => (a1 / (a2 * b))
+        Trace.Assert(a.SubTrees.Count == 2);
+        return MakeFraction(a.SubTrees[0], MakeProduct(a.SubTrees[1], b));
+      } else if (IsDivision(b)) {
+        // a / (b1 / b2) => (a * b2) / b1
+        Trace.Assert(b.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(a, b.SubTrees[1]), b.SubTrees[0]);
+      } else {
+        var div = divSymbol.CreateTreeNode();
+        div.AddSubTree(a);
+        div.AddSubTree(b);
+        return div;
+      }
+    }
+
+    private SymbolicExpressionTreeNode MakeSum(SymbolicExpressionTreeNode a, SymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        // fold constants
+        ((ConstantTreeNode)a).Value += ((ConstantTreeNode)b).Value;
+        return a;
+      } else if (IsConstant(a)) {
+        // c + x => x + c
+        // b is not constant => make sure constant is on the right
+        return MakeSum(b, a);
+      } else if (IsConstant(b) && ((ConstantTreeNode)b).Value.IsAlmost(0.0)) {
+        // x + 0 => x
+        return a;
+      } else if (IsAddition(a) && IsAddition(b)) {
+        // merge additions
+        var add = addSymbol.CreateTreeNode();
+        for (int i = 0; i < a.SubTrees.Count - 1; i++) add.AddSubTree(a.SubTrees[i]);
+        for (int i = 0; i < b.SubTrees.Count - 1; i++) add.AddSubTree(b.SubTrees[i]);
+        if (IsConstant(a.SubTrees.Last()) && IsConstant(b.SubTrees.Last())) {
+          add.AddSubTree(MakeSum(a.SubTrees.Last(), b.SubTrees.Last()));
+        } else if (IsConstant(a.SubTrees.Last())) {
+          add.AddSubTree(b.SubTrees.Last());
+          add.AddSubTree(a.SubTrees.Last());
+        } else {
+          add.AddSubTree(a.SubTrees.Last());
+          add.AddSubTree(b.SubTrees.Last());
+        }
+        MergeVariablesInSum(add);
+        return add;
+      } else if (IsAddition(b)) {
+        return MakeSum(b, a);
+      } else if (IsAddition(a) && IsConstant(b)) {
+        // a is an addition and b is a constant => append b to a and make sure the constants are merged
+        var add = addSymbol.CreateTreeNode();
+        for (int i = 0; i < a.SubTrees.Count - 1; i++) add.AddSubTree(a.SubTrees[i]);
+        if (IsConstant(a.SubTrees.Last()))
+          add.AddSubTree(MakeSum(a.SubTrees.Last(), b));
+        else {
+          add.AddSubTree(a.SubTrees.Last());
+          add.AddSubTree(b);
+        }
+        return add;
+      } else if (IsAddition(a)) {
+        // a is already an addition => append b
+        var add = addSymbol.CreateTreeNode();
+        add.AddSubTree(b);
+        foreach (var subTree in a.SubTrees) {
+          add.AddSubTree(subTree);
+        }
+        MergeVariablesInSum(add);
+        return add;
+      } else {
+        var add = addSymbol.CreateTreeNode();
+        add.AddSubTree(a);
+        add.AddSubTree(b);
+        MergeVariablesInSum(add);
+        return add;
+      }
+    }
+
+    // makes sure variable symbols in sums are combined
+    // possible improvment: combine sums of products where the products only reference the same variable
+    private void MergeVariablesInSum(SymbolicExpressionTreeNode sum) {
+      var subtrees = new List<SymbolicExpressionTreeNode>(sum.SubTrees);
+      while (sum.SubTrees.Count > 0) sum.RemoveSubTree(0);
+      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
+                            group node by node.VariableName into g
+                            select g;
+      var unchangedSubTrees = subtrees.Where(t => !(t is VariableTreeNode));
+
+      foreach (var variableNodeGroup in groupedVarNodes) {
+        var weightSum = variableNodeGroup.Select(t => t.Weight).Sum();
+        var representative = variableNodeGroup.First();
+        representative.Weight = weightSum;
+        sum.AddSubTree(representative);
+      }
+      foreach (var unchangedSubtree in unchangedSubTrees)
+        sum.AddSubTree(unchangedSubtree);
+    }
+
+
+    private SymbolicExpressionTreeNode MakeProduct(SymbolicExpressionTreeNode a, SymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        // fold constants
+        ((ConstantTreeNode)a).Value *= ((ConstantTreeNode)b).Value;
+        return a;
+      } else if (IsConstant(a)) {
+        // a * $ => $ * a
+        return MakeProduct(b, a);
+      } else if (IsConstant(b) && ((ConstantTreeNode)b).Value.IsAlmost(1.0)) {
+        // $ * 1.0 => $
+        return a;
+      } else if (IsConstant(b) && IsVariable(a)) {
+        // multiply constants into variables weights
+        ((VariableTreeNode)a).Weight *= ((ConstantTreeNode)b).Value;
+        return a;
+      } else if (IsConstant(b) && IsAddition(a)) {
+        // multiply constants into additions
+        return a.SubTrees.Select(x => MakeProduct(x, b)).Aggregate((c, d) => MakeSum(c, d));
+      } else if (IsDivision(a) && IsDivision(b)) {
+        // (a1 / a2) * (b1 / b2) => (a1 * b1) / (a2 * b2)
+        Trace.Assert(a.SubTrees.Count == 2);
+        Trace.Assert(b.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(a.SubTrees[0], b.SubTrees[0]), MakeProduct(a.SubTrees[1], b.SubTrees[1]));
+      } else if (IsDivision(a)) {
+        // (a1 / a2) * b => (a1 * b) / a2
+        Trace.Assert(a.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(a.SubTrees[0], b), a.SubTrees[1]);
+      } else if (IsDivision(b)) {
+        // a * (b1 / b2) => (b1 * a) / b2
+        Trace.Assert(b.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(b.SubTrees[0], a), b.SubTrees[1]);
+      } else if (IsMultiplication(a) && IsMultiplication(b)) {
+        // merge multiplications (make sure constants are merged)
+        var mul = mulSymbol.CreateTreeNode();
+        for (int i = 0; i < a.SubTrees.Count; i++) mul.AddSubTree(a.SubTrees[i]);
+        for (int i = 0; i < b.SubTrees.Count; i++) mul.AddSubTree(b.SubTrees[i]);
+        MergeVariablesAndConstantsInProduct(mul);
+        return mul;
+      } else if (IsMultiplication(b)) {
+        return MakeProduct(b, a);
+      } else if (IsMultiplication(a)) {
+        // a is already an multiplication => append b
+        a.AddSubTree(b);
+        MergeVariablesAndConstantsInProduct(a);
+        return a;
+      } else {
+        var mul = mulSymbol.CreateTreeNode();
+        mul.SubTrees.Add(a);
+        mul.SubTrees.Add(b);
+        MergeVariablesAndConstantsInProduct(mul);
+        return mul;
+      }
+    }
+    #endregion
+
+    // helper to combine the constant factors in products and to combine variables (powers of 2, 3...)
+    private void MergeVariablesAndConstantsInProduct(SymbolicExpressionTreeNode prod) {
+      var subtrees = new List<SymbolicExpressionTreeNode>(prod.SubTrees);
+      while (prod.SubTrees.Count > 0) prod.RemoveSubTree(0);
+      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
+                            group node by node.VariableName into g
+                            orderby g.Count()
+                            select g;
+      var constantProduct = (from node in subtrees.OfType<VariableTreeNode>()
+                             select node.Weight)
+                            .Concat(from node in subtrees.OfType<ConstantTreeNode>()
+                                    select node.Value)
+                            .DefaultIfEmpty(1.0)
+                            .Aggregate((c1, c2) => c1 * c2);
+
+      var unchangedSubTrees = from tree in subtrees
+                              where !(tree is VariableTreeNode)
+                              where !(tree is ConstantTreeNode)
+                              select tree;
+
+      foreach (var variableNodeGroup in groupedVarNodes) {
+        var representative = variableNodeGroup.First();
+        representative.Weight = 1.0;
+        if (variableNodeGroup.Count() > 1) {
+          var poly = mulSymbol.CreateTreeNode();
+          for (int p = 0; p < variableNodeGroup.Count(); p++) {
+            poly.AddSubTree((SymbolicExpressionTreeNode)representative.Clone());
+          }
+          prod.AddSubTree(poly);
+        } else {
+          prod.AddSubTree(representative);
+        }
+      }
+
+      foreach (var unchangedSubtree in unchangedSubTrees)
+        prod.AddSubTree(unchangedSubtree);
+
+      if (!constantProduct.IsAlmost(1.0)) {
+        prod.AddSubTree(MakeConstant(constantProduct));
+      }
+    }
+
+
+    #region helper functions
+    /// <summary>
+    /// x => x * -1
+    /// Doesn't create new trees and manipulates x
+    /// </summary>
+    /// <param name="x"></param>
+    /// <returns>-x</returns>
+    private SymbolicExpressionTreeNode Negate(SymbolicExpressionTreeNode x) {
+      if (IsConstant(x)) {
+        ((ConstantTreeNode)x).Value *= -1;
+      } else if (IsVariable(x)) {
+        var variableTree = (VariableTreeNode)x;
+        variableTree.Weight *= -1.0;
+      } else if (IsAddition(x)) {
+        // (x0 + x1 + .. + xn) * -1 => (-x0 + -x1 + .. + -xn)        
+        foreach (var subTree in x.SubTrees) {
+          Negate(subTree);
+        }
+      } else if (IsMultiplication(x) || IsDivision(x)) {
+        // x0 * x1 * .. * xn * -1 => x0 * x1 * .. * -xn
+        Negate(x.SubTrees.Last()); // last is maybe a constant, prefer to negate the constant
+      } else {
+        // any other function
+        return MakeProduct(x, MakeConstant(-1));
+      }
+      return x;
+    }
+
+    /// <summary>
+    /// x => 1/x
+    /// Doesn't create new trees and manipulates x
+    /// </summary>
+    /// <param name="x"></param>
+    /// <returns></returns>
+    private SymbolicExpressionTreeNode Invert(SymbolicExpressionTreeNode x) {
+      if (IsConstant(x)) {
+        return MakeConstant(1.0 / ((ConstantTreeNode)x).Value);
+      } else if (IsDivision(x)) {
+        Trace.Assert(x.SubTrees.Count == 2);
+        return MakeFraction(x.SubTrees[1], x.SubTrees[0]);
+      } else {
+        // any other function
+        return MakeFraction(MakeConstant(1), x);
+      }
+    }
+
+    private SymbolicExpressionTreeNode MakeConstant(double value) {
+      ConstantTreeNode constantTreeNode = (ConstantTreeNode)(constSymbol.CreateTreeNode());
+      constantTreeNode.Value = value;
+      return (SymbolicExpressionTreeNode)constantTreeNode;
+    }
+
+    private SymbolicExpressionTreeNode MakeVariable(double weight, string name) {
+      var tree = (VariableTreeNode)varSymbol.CreateTreeNode();
+      tree.Weight = weight;
+      tree.VariableName = name;
+      return tree;
+    }
+    #endregion
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Addition.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Addition.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Addition.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Addition", "Symbol that represents the + operator.")]
+  public sealed class Addition : Symbol {
+    [StorableConstructor]
+    private Addition(bool deserializing) : base(deserializing) { }
+    private Addition(Addition original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Addition(this, cloner);
+    }
+    public Addition() : base("Addition", "Symbol that represents the + operator.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/And.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/And.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/And.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("And", "Symbol that represents the boolean AND operator.")]
+  public sealed class And : Symbol {
+    [StorableConstructor]
+    private And(bool deserializing) : base(deserializing) { }
+    private And(And original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new And(this, cloner);
+    }
+    public And() : base("And", "Symbol that represents the boolean AND operator.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Average.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Average.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Average.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Average", "Symbol that represents the average (arithmetic mean) function.")]
+  public sealed class Average : Symbol {
+    [StorableConstructor]
+    private Average(bool deserializing) : base(deserializing) { }
+    private Average(Average original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Average(this, cloner);
+    }
+    public Average() : base("Average", "Symbol that represents the average (arithmetic mean) function.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs	(revision 4858)
@@ -0,0 +1,104 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Constant", "Represents a constant value.")]
+  public sealed class Constant : Symbol {
+    #region Propeties
+    [Storable]
+    private double minValue;
+    public double MinValue {
+      get { return minValue; }
+      set {
+        if (value != minValue) {
+          minValue = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double maxValue;
+    public double MaxValue {
+      get { return maxValue; }
+      set {
+        if (value != maxValue) {
+          maxValue = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double manipulatorNu;
+    public double ManipulatorNu {
+      get { return manipulatorNu; }
+      set {
+        if (value != manipulatorNu) {
+          manipulatorNu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double manipulatorSigma;
+    public double ManipulatorSigma {
+      get { return manipulatorSigma; }
+      set {
+        if (value < 0) throw new ArgumentException();
+        if (value != manipulatorSigma) {
+          manipulatorSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    #endregion
+    [StorableConstructor]
+    private Constant(bool deserializing) : base(deserializing) { }
+    private Constant(Constant original, Cloner cloner)
+      : base(original, cloner) {
+      minValue = original.minValue;
+      maxValue = original.maxValue;
+      manipulatorNu = original.manipulatorNu;
+      manipulatorSigma = original.manipulatorSigma;
+    }
+    public Constant()
+      : base("Constant", "Represents a constant value.") {
+      manipulatorNu = 0.0;
+      manipulatorSigma = 1.0;
+      minValue = -20.0;
+      maxValue = 20.0;
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new ConstantTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Constant(this, cloner);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/ConstantTreeNode.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/ConstantTreeNode.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/ConstantTreeNode.cs	(revision 4858)
@@ -0,0 +1,77 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  public sealed class ConstantTreeNode : SymbolicExpressionTreeTerminalNode {
+    public new Constant Symbol {
+      get { return (Constant)base.Symbol; }
+    }
+
+    private double constantValue;
+    [Storable]
+    public double Value {
+      get { return constantValue; }
+      set { constantValue = value; }
+    }
+
+    [StorableConstructor]
+    private ConstantTreeNode(bool deserializing) : base(deserializing) { }
+
+    private ConstantTreeNode(ConstantTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      constantValue = original.constantValue;
+    }
+
+    private ConstantTreeNode() : base() { }
+    public ConstantTreeNode(Constant constantSymbol) : base(constantSymbol) { }
+
+    public override bool HasLocalParameters {
+      get {
+        return true;
+      }
+    }
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      var range = Symbol.MaxValue - Symbol.MinValue;
+      Value = random.NextDouble() * range - Symbol.MinValue;
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      double x = NormalDistributedRandom.NextDouble(random, Symbol.ManipulatorNu, Symbol.ManipulatorSigma);
+      Value = Value + x * shakingFactor;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ConstantTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      return constantValue.ToString("E4");
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Cosine.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Cosine.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Cosine.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Cosine", "Symbol that represents the cosine function.")]
+  public sealed class Cosine : Symbol {
+    [StorableConstructor]
+    private Cosine(bool deserializing) : base(deserializing) { }
+    private Cosine(Cosine original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Cosine(this, cloner);
+    }
+    public Cosine() : base("Cosine", "Symbol that represents the cosine function.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Division.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Division.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Division.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Division", "Symbol that represents the / operator.")]
+  public sealed class Division : Symbol {
+    [StorableConstructor]
+    private Division(bool deserializing) : base(deserializing) { }
+    private Division(Division original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Division(this, cloner);
+    }
+    public Division() : base("Division", "Symbol that represents the / operator.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Exponential.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Exponential.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Exponential.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Exponential", "Symbol that represents the exponential function.")]
+  public sealed class Exponential : Symbol {
+    [StorableConstructor]
+    private Exponential(bool deserializing) : base(deserializing) { }
+    private Exponential(Exponential original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Exponential(this, cloner);
+    }
+    public Exponential() : base("Exponential", "Symbol that represents the exponential function.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/GreaterThan.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/GreaterThan.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/GreaterThan.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("GreaterThan", "Symbol that represents a greater than relation.")]
+  public sealed class GreaterThan : Symbol {
+    [StorableConstructor]
+    private GreaterThan(bool deserializing) : base(deserializing) { }
+    private GreaterThan(GreaterThan original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GreaterThan(this, cloner);
+    }
+    public GreaterThan() : base("GreaterThan", "Symbol that represents a greater than relation.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/IfThenElse.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/IfThenElse.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/IfThenElse.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("IfThenElse", "Symbol that represents a conditional operator.")]
+  public sealed class IfThenElse : Symbol {
+    [StorableConstructor]
+    private IfThenElse(bool deserializing) : base(deserializing) { }
+    private IfThenElse(IfThenElse original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new IfThenElse(this, cloner);
+    }
+    public IfThenElse() : base("IfThenElse", "Symbol that represents a conditional operator.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariable.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariable.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariable.cs	(revision 4858)
@@ -0,0 +1,62 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("LaggedVariable", "Represents a variable value with a time offset.")]
+  public sealed class LaggedVariable : Variable {
+    [Storable]
+    private int minLag;
+    public int MinLag {
+      get { return minLag; }
+      set { minLag = value; }
+    }
+    [Storable]
+    private int maxLag;
+    public int MaxLag {
+      get { return maxLag; }
+      set { maxLag = value; }
+    }
+    [StorableConstructor]
+    private LaggedVariable(bool deserializing) : base(deserializing) { }
+    private LaggedVariable(LaggedVariable original, Cloner cloner)
+      : base(original, cloner) {
+      minLag = original.minLag;
+      maxLag = original.maxLag;
+    }
+    public LaggedVariable()
+      : base("LaggedVariable", "Represents a variable value with a time offset.") {
+      minLag = -1; maxLag = -1;
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new LaggedVariableTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LaggedVariable(this, cloner);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariableTreeNode.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariableTreeNode.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariableTreeNode.cs	(revision 4858)
@@ -0,0 +1,74 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  public sealed class LaggedVariableTreeNode : VariableTreeNode {
+    public new LaggedVariable Symbol {
+      get { return (LaggedVariable)base.Symbol; }
+    }
+    [Storable]
+    private int lag;
+    public int Lag {
+      get { return lag; }
+      set { lag = value; }
+    }
+
+    [StorableConstructor]
+    private LaggedVariableTreeNode(bool deserializing) : base(deserializing) { }
+    private LaggedVariableTreeNode(LaggedVariableTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      lag = original.lag;
+    }
+    private LaggedVariableTreeNode() { }
+
+    public LaggedVariableTreeNode(LaggedVariable variableSymbol) : base(variableSymbol) { }
+
+    public override bool HasLocalParameters {
+      get {
+        return true;
+      }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      lag = random.Next(Symbol.MinLag, Symbol.MaxLag + 1);
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      lag = Math.Min(Symbol.MaxLag, Math.Max(Symbol.MinLag, lag + random.Next(-1, 2)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LaggedVariableTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      return base.ToString() +
+        " (t" + (lag > 0 ? "+" : "") + lag + ")";
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LessThan.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LessThan.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LessThan.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("LessThan", "Symbol that represents a less than relation.")]
+  public sealed class LessThan : Symbol {
+    [StorableConstructor]
+    private LessThan(bool deserializing) : base(deserializing) { }
+    private LessThan(LessThan original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LessThan(this, cloner);
+    }
+    public LessThan() : base("LessThan", "Symbol that represents a less than relation.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Logarithm.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Logarithm.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Logarithm.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Logarithm", "Symbol that represents the logarithm function.")]
+  public sealed class Logarithm : Symbol {
+    [StorableConstructor]
+    private Logarithm(bool deserializing) : base(deserializing) { }
+    private Logarithm(Logarithm original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Logarithm(this, cloner);
+    }
+    public Logarithm() : base("Logarithm", "Symbol that represents the logarithm function.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Multiplication.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Multiplication.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Multiplication.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Multiplication", "Symbol that represents the * operator.")]
+  public sealed class Multiplication : Symbol {
+    [StorableConstructor]
+    private Multiplication(bool deserializing) : base(deserializing) { }
+    private Multiplication(Multiplication original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Multiplication(this, cloner);
+    }
+    public Multiplication() : base("Multiplication", "Symbol that represents the * operator.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Not.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Not.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Not.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Not", "Symbol that represents the boolean NOT operator.")]
+  public sealed class Not : Symbol {
+    [StorableConstructor]
+    private Not(bool deserializing) : base(deserializing) { }
+    private Not(Not original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Not(this, cloner);
+    }
+    public Not() : base("Not", "Symbol that represents the boolean NOT operator.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Or.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Or.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Or.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Or", "Symbol that represents the boolean OR operator.")]
+  public sealed class Or : Symbol {
+    [StorableConstructor]
+    private Or(bool deserializing) : base(deserializing) { }
+    private Or(Or original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Or(this, cloner);
+    }
+    public Or() : base("Or", "Symbol that represents the boolean OR operator.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Sine.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Sine.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Sine.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Sine", "Symbol that represents the sine function.")]
+  public sealed class Sine : Symbol {
+    [StorableConstructor]
+    private Sine(bool deserializing) : base(deserializing) { }
+    private Sine(Sine original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Sine(this, cloner);
+    }
+    public Sine() : base("Sine", "Symbol that represents the sine function.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Subtraction.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Subtraction.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Subtraction.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Subtraction", "Symbol that represents the - operator.")]
+  public sealed class Subtraction : Symbol {
+    [StorableConstructor]
+    private Subtraction(bool deserializing) : base(deserializing) { }
+    private Subtraction(Subtraction original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Subtraction(this, cloner);
+    }
+    public Subtraction() : base("Subtraction", "Symbol that represents the - operator.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Tangent.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Tangent.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Tangent.cs	(revision 4858)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Tangent", "Symbol that represents the tangent trigonometric function.")]
+  public sealed class Tangent : Symbol {
+    [StorableConstructor]
+    private Tangent(bool deserializing) : base(deserializing) { }
+    private Tangent(Tangent original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Tangent(this, cloner);
+    }
+    public Tangent() : base("Tangent", "Symbol that represents the tangent trigonometric function.") { }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs	(revision 4858)
@@ -0,0 +1,122 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Variable", "Represents a variable value.")]
+  public class Variable : Symbol {
+    #region Properties
+    [Storable]
+    private double weightNu;
+    public double WeightNu {
+      get { return weightNu; }
+      set {
+        if (value != weightNu) {
+          weightNu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double weightSigma;
+    public double WeightSigma {
+      get { return weightSigma; }
+      set {
+        if (weightSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != weightSigma) {
+          weightSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double weightManipulatorNu;
+    public double WeightManipulatorNu {
+      get { return weightManipulatorNu; }
+      set {
+        if (value != weightManipulatorNu) {
+          weightManipulatorNu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double weightManipulatorSigma;
+    public double WeightManipulatorSigma {
+      get { return weightManipulatorSigma; }
+      set {
+        if (weightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != weightManipulatorSigma) {
+          weightManipulatorSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    private List<string> variableNames;
+    [Storable]
+    public IEnumerable<string> VariableNames {
+      get { return variableNames; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        variableNames.Clear();
+        variableNames.AddRange(value);
+        OnChanged(EventArgs.Empty);
+      }
+    }
+    #endregion
+    [StorableConstructor]
+    protected Variable(bool deserializing) : base(deserializing) {
+      variableNames = new List<string>();
+    }
+    protected Variable(Variable original, Cloner cloner)
+      : base(original, cloner) {
+      weightNu = original.weightNu;
+      weightSigma = original.weightSigma;
+      variableNames = new List<string>(original.variableNames);
+      weightManipulatorNu = original.weightManipulatorNu;
+      weightManipulatorSigma = original.weightManipulatorSigma;
+    }
+    public Variable() : this("Variable", "Represents a variable value.") { }
+    public Variable(string name, string description)
+      : base(name, description) {
+      weightNu = 1.0;
+      weightSigma = 1.0;
+      weightManipulatorNu = 0.0;
+      weightManipulatorSigma = 1.0;
+      variableNames = new List<string>();
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new VariableTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Variable(this, cloner);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs	(revision 4858)
@@ -0,0 +1,84 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  public class VariableTreeNode : SymbolicExpressionTreeTerminalNode {
+    public new Variable Symbol {
+      get { return (Variable)base.Symbol; }
+    }
+    [Storable]
+    private double weight;
+    public double Weight {
+      get { return weight; }
+      set { weight = value; }
+    }
+    [Storable]
+    private string variableName;
+    public string VariableName {
+      get { return variableName; }
+      set { variableName = value; }
+    }
+
+    [StorableConstructor]
+    protected VariableTreeNode(bool deserializing) : base(deserializing) { }
+    protected VariableTreeNode(VariableTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      weight = original.weight;
+      variableName = original.variableName;
+    }
+    protected VariableTreeNode() { }
+    public VariableTreeNode(Variable variableSymbol) : base(variableSymbol) { }
+
+    public override bool HasLocalParameters {
+      get {
+        return true;
+      }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightNu, Symbol.WeightSigma);
+      variableName = Symbol.VariableNames.SelectRandom(random);
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorNu, Symbol.WeightManipulatorSigma);
+      weight = weight + x * shakingFactor;
+      variableName = Symbol.VariableNames.SelectRandom(random);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new VariableTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      if (weight.IsAlmost(1.0)) return variableName;
+      else return weight.ToString("E4") + " " + variableName;
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/VariableFrequencyAnalyser.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/VariableFrequencyAnalyser.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/VariableFrequencyAnalyser.cs	(revision 4858)
@@ -0,0 +1,125 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("VariableFrequencyAnalyser", "Calculates the accumulated frequencies of variable-symbols over the whole population.")]
+  [StorableClass]
+  public abstract class VariableFrequencyAnalyser : SingleSuccessorOperator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string VariableFrequenciesParameterName = "VariableFrequencies";
+
+    #region parameter properties
+    public ILookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (ILookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ItemArray<SymbolicExpressionTree>>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DoubleMatrix> VariableFrequenciesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters[VariableFrequenciesParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public ItemArray<SymbolicExpressionTree> SymbolicExpressionTrees {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public DoubleMatrix VariableFrequencies {
+      get { return VariableFrequenciesParameter.ActualValue; }
+      set { VariableFrequenciesParameter.ActualValue = value; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected VariableFrequencyAnalyser(bool deserializing) : base(deserializing) { }
+    protected VariableFrequencyAnalyser(VariableFrequencyAnalyser original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public VariableFrequencyAnalyser()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees that should be analyzed."));
+      Parameters.Add(new LookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The problem data on which the for which the symbolic expression tree is a solution."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>(VariableFrequenciesParameterName, "The relative variable reference frequencies aggregated over the whole population."));
+    }
+
+    public override IOperation Apply() {
+      var inputVariables = DataAnalysisProblemData.InputVariables.Select(x => x.Value);
+      if (VariableFrequencies == null) {
+        VariableFrequencies = new DoubleMatrix(0, 1, inputVariables);
+      }
+      ((IStringConvertibleMatrix)VariableFrequencies).Rows = VariableFrequencies.Rows + 1;
+      int lastRowIndex = VariableFrequencies.Rows - 1;
+      var columnNames = VariableFrequencies.ColumnNames.ToList();
+      foreach (var pair in CalculateVariableFrequencies(SymbolicExpressionTrees, inputVariables)) {
+        int columnIndex = columnNames.IndexOf(pair.Key);
+        VariableFrequencies[lastRowIndex, columnIndex] = pair.Value;
+      }
+      return base.Apply();
+    }
+
+    public static IEnumerable<KeyValuePair<string, double>> CalculateVariableFrequencies(IEnumerable<SymbolicExpressionTree> trees, IEnumerable<string> inputVariables) {
+      Dictionary<string, double> variableReferencesSum = new Dictionary<string, double>();
+      Dictionary<string, double> variableFrequencies = new Dictionary<string, double>();
+      foreach (var inputVariable in inputVariables)
+        variableReferencesSum[inputVariable] = 0.0;
+      foreach (var tree in trees) {
+        var variableReferences = GetVariableReferenceCount(tree, inputVariables);
+        foreach (var pair in variableReferences) {
+          variableReferencesSum[pair.Key] += pair.Value;
+        }
+      }
+      double totalVariableReferences = variableReferencesSum.Values.Sum();
+      foreach (string inputVariable in inputVariables) {
+        double relFreq = variableReferencesSum[inputVariable] / totalVariableReferences;
+        variableFrequencies.Add(inputVariable, relFreq);
+      }
+      return variableFrequencies;
+    }
+
+    private static IEnumerable<KeyValuePair<string, int>> GetVariableReferenceCount(SymbolicExpressionTree tree, IEnumerable<string> inputVariables) {
+      Dictionary<string, int> references = new Dictionary<string, int>();
+      var variableNames = from node in tree.IterateNodesPrefix().OfType<VariableTreeNode>()
+                          select node.VariableName;
+
+      foreach (var variableName in variableNames) {
+        if (!references.ContainsKey(variableName)) {
+          references[variableName] = 1;
+        } else {
+          references[variableName] += 1;
+        }
+      }
+      return references;
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/HeuristicLab.Problems.DataAnalysis.Tests-3.3.csproj
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/HeuristicLab.Problems.DataAnalysis.Tests-3.3.csproj	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/HeuristicLab.Problems.DataAnalysis.Tests-3.3.csproj	(revision 4858)
@@ -0,0 +1,223 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{5A4679EF-A8F3-4647-B722-441A36B3BA6B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Tests_3._3</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Tests-3.3</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Debug\HeuristicLab.Problems.DataAnalysis.Tests-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\HeuristicLab.Problems.DataAnalysis.Tests-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="SymbolicSimplifierTest.cs" />
+    <Compile Include="StatisticCalculatorsTest.cs" />
+    <Compile Include="LinearScalingTest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SimpleArithmeticExpressionInterpreterTest.cs" />
+    <Compile Include="SymbolicExpressionImporter.cs" />
+    <Compile Include="Token.cs" />
+    <Compile Include="Util.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
+      <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
+      <Name>HeuristicLab.Common.Resources-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
+      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
+      <Name>HeuristicLab.Common-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
+      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
+      <Name>HeuristicLab.Core-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
+      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
+      <Name>HeuristicLab.Data-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj">
+      <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\2.5.0\ALGLIB-2.5.0\ALGLIB-2.5.0.csproj">
+      <Project>{29E4B033-1FEF-4FE1-AE17-0A9319D7C54E}</Project>
+      <Name>ALGLIB-2.5.0</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
+      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
+      <Name>HeuristicLab.Operators-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
+      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
+      <Name>HeuristicLab.Parameters-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Problems.DataAnalysis.Regression\3.3\HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj">
+      <Project>{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Regression-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
+      <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
+      <Name>HeuristicLab.Random-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Problems.DataAnalysis-3.3.csproj">
+      <Project>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="bin\" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="RegressionSolution01.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution02.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution03.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution04.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution05.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution06.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/LinearScalingTest.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/LinearScalingTest.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/LinearScalingTest.cs	(revision 4858)
@@ -0,0 +1,83 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+  [TestClass()]
+  public class LinearScalingTest {
+    [TestMethod]
+    public void CalculateScalingParametersTest() {
+      var testData = new double[,] {
+     {5,1,1,1,2,1,3,1,1,2},
+     {5,4,4,5,7,10,3,2,1,2},
+     {3,1,1,1,2,2,3,1,1,2},
+     {6,8,8,1,3,4,3,7,1,2},
+     {4,1,1,3,2,1,3,1,1,2},
+     {8,10,10,8,7,10,9,7,1,4},            
+     {1,1,1,1,2,10,3,1,1,2},              
+     {2,1,2,1,2,1,3,1,1,2},                 
+     {2,1,1,1,2,1,1,1,5,2},                 
+     {4,2,1,1,2,1,2,1,1,2},                   
+     {1,1,1,1,1,1,3,1,1,2},    
+     {2,1,1,1,2,1,2,1,1,2},                   
+     {5,3,3,3,2,3,4,4,1,4},                          
+     {8,7,5,10,7,9,5,5,4,4},          
+     {7,4,6,4,6,1,4,3,1,4},                          
+     {4,1,1,1,2,1,2,1,1,2},     
+     {4,1,1,1,2,1,3,1,1,2},      
+     {10,7,7,6,4,10,4,1,2,4},  
+     {6,1,1,1,2,1,3,1,1,2},     
+     {7,3,2,10,5,10,5,4,4,4},   
+     {10,5,5,3,6,7,7,10,1,4} 
+      };
+
+      double alpha, beta;
+      int n = testData.GetLength(0);
+      {
+        IEnumerable<double> x = from rows in Enumerable.Range(0, n)
+                                select testData[rows, 0];
+        IEnumerable<double> y = from rows in Enumerable.Range(0, n)
+                                select testData[rows, 1];
+        SymbolicRegressionScaledMeanSquaredErrorEvaluator.CalculateScalingParameters(x, y, out beta, out alpha);
+
+        Assert.AreEqual(alpha, 2.757281, 1.0E-6);
+        Assert.AreEqual(beta, 0.720267, 1.0E-6);
+
+        IEnumerable<double> scaledY = from value in y select value * beta + alpha;
+        Assert.AreEqual(x.Average(), scaledY.Average(), 1.0E-6);
+      }
+      {
+        IEnumerable<double> x = from rows in Enumerable.Range(0, n)
+                                select testData[rows, 2] * 1.0E3;
+        IEnumerable<double> y = from rows in Enumerable.Range(0, n)
+                                select testData[rows, 8] * 1.0E-3;
+        SymbolicRegressionScaledMeanSquaredErrorEvaluator.CalculateScalingParameters(x, y, out beta, out alpha);
+
+        IEnumerable<double> scaledY = from value in y select value * beta + alpha;
+        Assert.AreEqual(x.Average(), scaledY.Average(), 1.0E-6);
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Properties/AssemblyInfo.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Properties/AssemblyInfo.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Properties/AssemblyInfo.cs	(revision 4858)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Tests-3.3")]
+[assembly: AssemblyDescription("Test cases for HeuristicLab generic data analysis problem classes")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM componenets.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7dddd116-d8ae-459a-ae2a-d55294e0fd8a")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.1.0")]
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SimpleArithmeticExpressionInterpreterTest.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SimpleArithmeticExpressionInterpreterTest.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SimpleArithmeticExpressionInterpreterTest.cs	(revision 4858)
@@ -0,0 +1,242 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+
+  /// <summary>
+  ///This is a test class for SimpleArithmeticExpressionInterpreter and is intended
+  ///to contain all SimpleArithmeticExpressionInterpreter Unit Tests
+  ///</summary>
+  [TestClass()]
+  public class SimpleArithmeticExpressionInterpreterTest {
+    private const int N = 1000;
+    private const int Rows = 1000;
+    private const int Columns = 50;
+    private static SymbolicExpressionTree[] randomTrees;
+    private static Dataset dataset;
+    private static MersenneTwister twister;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [ClassInitialize()]
+    public static void CreateRandomTrees(TestContext testContext) {
+      twister = new MersenneTwister();
+      dataset = Util.CreateRandomDataset(twister, Rows, Columns);
+      var grammar = new GlobalSymbolicExpressionGrammar(new FullFunctionalExpressionGrammar());
+      grammar.MaxFunctionArguments = 0;
+      grammar.MaxFunctionDefinitions = 0;
+      grammar.MinFunctionArguments = 0;
+      grammar.MinFunctionDefinitions = 0;
+      randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1, 100, 0, 0);
+    }
+
+    [TestMethod]
+    public void SimpleArithmeticExpressionInterpreterPerformanceTest() {
+      double[] estimation = new double[Rows];
+      foreach (SymbolicExpressionTree tree in randomTrees) {
+        Util.InitTree(tree, twister, new List<string>(dataset.VariableNames));
+      }
+      SimpleArithmeticExpressionInterpreter interpreter = new SimpleArithmeticExpressionInterpreter();
+      Util.EvaluateTrees(randomTrees, interpreter, dataset, 10);
+    }
+
+
+    /// <summary>
+    ///A test for Evaluate
+    ///</summary>
+    [TestMethod]
+    public void SimpleArithmeticExpressionInterpreterEvaluateTest() {
+
+      Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] {
+        { 1.0, 1.0, 1.0 },
+        { 2.0, 2.0, 2.0 },
+        { 3.0, 1.0, 2.0 }
+      });
+
+      SimpleArithmeticExpressionInterpreter interpreter = new SimpleArithmeticExpressionInterpreter();
+
+      // constants
+      Evaluate(interpreter, ds, "(+ 1.5 3.5)", 0, 5.0);
+
+      // variables
+      Evaluate(interpreter, ds, "(variable 2.0 a)", 0, 2.0);
+      Evaluate(interpreter, ds, "(variable 2.0 a)", 1, 4.0);
+
+
+      // addition
+      Evaluate(interpreter, ds, "(+ (variable 2.0 a ))", 1, 4.0);
+      Evaluate(interpreter, ds, "(+ (variable 2.0 a ) (variable 3.0 b ))", 0, 5.0);
+      Evaluate(interpreter, ds, "(+ (variable 2.0 a ) (variable 3.0 b ))", 1, 10.0);
+      Evaluate(interpreter, ds, "(+ (variable 2.0 a) (variable 3.0 b ))", 2, 8.0);
+      Evaluate(interpreter, ds, "(+ 8.0 2.0 2.0)", 0, 12.0);
+
+      // subtraction
+      Evaluate(interpreter, ds, "(- (variable 2.0 a ))", 1, -4.0);
+      Evaluate(interpreter, ds, "(- (variable 2.0 a ) (variable 3.0 b))", 0, -1.0);
+      Evaluate(interpreter, ds, "(- (variable 2.0 a ) (variable 3.0 b ))", 1, -2.0);
+      Evaluate(interpreter, ds, "(- (variable 2.0 a ) (variable 3.0 b ))", 2, -4.0);
+      Evaluate(interpreter, ds, "(- 8.0 2.0 2.0)", 0, 4.0);
+
+      // multiplication
+      Evaluate(interpreter, ds, "(* (variable 2.0 a ))", 0, 2.0);
+      Evaluate(interpreter, ds, "(* (variable 2.0 a ) (variable 3.0 b ))", 0, 6.0);
+      Evaluate(interpreter, ds, "(* (variable 2.0 a ) (variable 3.0 b ))", 1, 24.0);
+      Evaluate(interpreter, ds, "(* (variable 2.0 a ) (variable 3.0 b ))", 2, 12.0);
+      Evaluate(interpreter, ds, "(* 8.0 2.0 2.0)", 0, 32.0);
+
+      // division
+      Evaluate(interpreter, ds, "(/ (variable 2.0 a ))", 1, 1.0 / 4.0);
+      Evaluate(interpreter, ds, "(/ (variable 2.0 a ) 2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(/ (variable 2.0 a ) 2.0)", 1, 2.0);
+      Evaluate(interpreter, ds, "(/ (variable 3.0 b ) 2.0)", 2, 3.0);
+      Evaluate(interpreter, ds, "(/ 8.0 2.0 2.0)", 0, 2.0);
+
+      // gt
+      Evaluate(interpreter, ds, "(> (variable 2.0 a) 2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(> 2.0 (variable 2.0 a))", 0, -1.0);
+      Evaluate(interpreter, ds, "(> (variable 2.0 a) 1.9)", 0, 1.0);
+      Evaluate(interpreter, ds, "(> 1.9 (variable 2.0 a))", 0, -1.0);
+      //Evaluate(interpreter, ds, "(> (sqrt -1.0) (log -1.0))", 0, -1.0); // (> nan nan) should be false
+
+      // lt
+      Evaluate(interpreter, ds, "(< (variable 2.0 a) 2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(< 2.0 (variable 2.0 a))", 0, -1.0);
+      Evaluate(interpreter, ds, "(< (variable 2.0 a) 1.9)", 0, -1.0);
+      Evaluate(interpreter, ds, "(< 1.9 (variable 2.0 a))", 0, 1.0);
+      //Evaluate(interpreter, ds, "(< (sqrt -1,0) (log -1,0))", 0, -1.0); // (< nan nan) should be false
+
+      // If
+      Evaluate(interpreter, ds, "(if -10.0 2.0 3.0)", 0, 3.0);
+      Evaluate(interpreter, ds, "(if -1.0 2.0 3.0)", 0, 3.0);
+      Evaluate(interpreter, ds, "(if 0.0 2.0 3.0)", 0, 3.0);
+      Evaluate(interpreter, ds, "(if 1.0 2.0 3.0)", 0, 2.0);
+      Evaluate(interpreter, ds, "(if 10.0 2.0 3.0)", 0, 2.0);
+      // Evaluate(interpreter, ds, "(if (sqrt -1.0) 2.0 3.0)", 0, 3.0); // if(nan) should return the else branch
+
+      // NOT
+      Evaluate(interpreter, ds, "(not -1.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(not -2.0)", 0, 2.0);
+      Evaluate(interpreter, ds, "(not 1.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(not 2.0)", 0, -2.0);
+      Evaluate(interpreter, ds, "(not 0.0)", 0, 0.0);
+
+      // AND
+      Evaluate(interpreter, ds, "(and -1.0 -2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and -1.0 2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and 1.0 -2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and 1.0 0.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and 0.0 0.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and 1.0 2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(and 1.0 2.0 3.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(and 1.0 -2.0 3.0)", 0, -1.0);
+
+      // OR
+      Evaluate(interpreter, ds, "(or -1.0 -2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(or -1.0 2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(or 1.0 -2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(or 1.0 2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(or 0.0 0.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(or -1.0 -2.0 -3.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(or -1.0 -2.0 3.0)", 0, 1.0);
+
+      // sin, cos, tan
+      Evaluate(interpreter, ds, "(sin " + Math.PI.ToString(NumberFormatInfo.InvariantInfo) + ")", 0, 0.0);
+      Evaluate(interpreter, ds, "(sin 0.0)", 0, 0.0);
+      Evaluate(interpreter, ds, "(cos " + Math.PI.ToString(NumberFormatInfo.InvariantInfo) + ")", 0, -1.0);
+      Evaluate(interpreter, ds, "(cos 0.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(tan " + Math.PI.ToString(NumberFormatInfo.InvariantInfo) + ")", 0, Math.Tan(Math.PI));
+      Evaluate(interpreter, ds, "(tan 0.0)", 0, Math.Tan(Math.PI));
+
+      // exp, log
+      Evaluate(interpreter, ds, "(log (exp 7.0))", 0, Math.Log(Math.Exp(7)));
+      Evaluate(interpreter, ds, "(exp (log 7.0))", 0, Math.Exp(Math.Log(7)));
+      Evaluate(interpreter, ds, "(log -3.0)", 0, Math.Log(-3));
+
+      // mean
+      Evaluate(interpreter, ds, "(mean -1.0 1.0 -1.0)", 0, -1.0 / 3.0);
+
+      // ADF      
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN 
+                                      (CALL ADF0)) 
+                                    (defun ADF0 1.0))", 1, 1.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN 
+                                      (* (CALL ADF0) (CALL ADF0)))
+                                    (defun ADF0 2.0))", 1, 4.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN 
+                                      (CALL ADF0 2.0 3.0))
+                                    (defun ADF0 
+                                      (+ (ARG 0) (ARG 1))))", 1, 5.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN (CALL ADF1 2.0 3.0))
+                                    (defun ADF0 
+                                      (- (ARG 1) (ARG 0)))
+                                    (defun ADF1
+                                      (+ (CALL ADF0 (ARG 1) (ARG 0))
+                                         (CALL ADF0 (ARG 0) (ARG 1)))))", 1, 0.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN (CALL ADF1 (variable 2.0 a) 3.0))
+                                    (defun ADF0 
+                                      (- (ARG 1) (ARG 0)))
+                                    (defun ADF1                                                                              
+                                      (CALL ADF0 (ARG 1) (ARG 0))))", 1, 1.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN (CALL ADF1 (variable 2.0 a) 3.0))
+                                    (defun ADF0 
+                                      (- (ARG 1) (ARG 0)))
+                                    (defun ADF1                                                                              
+                                      (+ (CALL ADF0 (ARG 1) (ARG 0))
+                                         (CALL ADF0 (ARG 0) (ARG 1)))))", 1, 0.0);
+    }
+
+    private void Evaluate(SimpleArithmeticExpressionInterpreter interpreter, Dataset ds, string expr, int index, double expected) {
+      var importer = new SymbolicExpressionImporter();
+      SymbolicExpressionTree tree = importer.Import(expr);
+
+      double actual = interpreter.GetSymbolicExpressionTreeValues(tree, ds, Enumerable.Range(index, 1)).First();
+
+      Assert.AreEqual(expected, actual, 1.0E-12, expr);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/StatisticCalculatorsTest.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/StatisticCalculatorsTest.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/StatisticCalculatorsTest.cs	(revision 4858)
@@ -0,0 +1,117 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+  [TestClass()]
+  public class StatisticCalculatorsTest {
+    private double[,] testData = new double[,] {
+     {5,1,1,1,2,1,3,1,1,2},
+     {5,4,4,5,7,10,3,2,1,2},
+     {3,1,1,1,2,2,3,1,1,2},
+     {6,8,8,1,3,4,3,7,1,2},
+     {4,1,1,3,2,1,3,1,1,2},
+     {8,10,10,8,7,10,9,7,1,4},            
+     {1,1,1,1,2,10,3,1,1,2},              
+     {2,1,2,1,2,1,3,1,1,2},                 
+     {2,1,1,1,2,1,1,1,5,2},                 
+     {4,2,1,1,2,1,2,1,1,2},                   
+     {1,1,1,1,1,1,3,1,1,2},    
+     {2,1,1,1,2,1,2,1,1,2},                   
+     {5,3,3,3,2,3,4,4,1,4},                          
+     {8,7,5,10,7,9,5,5,4,4},          
+     {7,4,6,4,6,1,4,3,1,4},                          
+     {4,1,1,1,2,1,2,1,1,2},     
+     {4,1,1,1,2,1,3,1,1,2},      
+     {10,7,7,6,4,10,4,1,2,4},  
+     {6,1,1,1,2,1,3,1,1,2},     
+     {7,3,2,10,5,10,5,4,4,4},   
+     {10,5,5,3,6,7,7,10,1,4} 
+      };
+
+    [TestMethod]
+    public void CalculateMeanAndVarianceTest() {
+      System.Random random = new System.Random(31415);
+
+      int n = testData.GetLength(0);
+      int cols = testData.GetLength(1);
+      {
+        for (int col = 0; col < cols; col++) {
+          double scale = random.NextDouble() * 1E7;
+          IEnumerable<double> x = from rows in Enumerable.Range(0, n)
+                                  select testData[rows, col] * scale;
+          double[] xs = x.ToArray();
+          double mean_alglib, variance_alglib;
+          mean_alglib = variance_alglib = 0.0;
+          double tmp = 0;
+
+          alglib.descriptivestatistics.calculatemoments(ref xs, n, ref mean_alglib, ref variance_alglib, ref tmp, ref tmp);
+
+          var calculator = new OnlineMeanAndVarianceCalculator();
+          for (int i = 0; i < n; i++) {
+            calculator.Add(xs[i]);
+          }
+          double mean = calculator.Mean;
+          double variance = calculator.Variance;
+
+          Assert.AreEqual(mean_alglib, mean, 1E-6 * scale);
+          Assert.AreEqual(variance_alglib, variance, 1E-6 * scale);
+        }
+      }
+    }
+
+    [TestMethod]
+    public void CalculatePearsonsRSquaredTest() {
+      System.Random random = new System.Random(31415);
+      int n = testData.GetLength(0);
+      int cols = testData.GetLength(1);
+      for (int c1 = 0; c1 < cols; c1++) {
+        for (int c2 = c1 + 1; c2 < cols; c2++) {
+          {
+            double c1Scale = random.NextDouble() * 1E7;
+            double c2Scale = random.NextDouble() * 1E7;
+            IEnumerable<double> x = from rows in Enumerable.Range(0, n)
+                                    select testData[rows, c1] * c1Scale;
+            IEnumerable<double> y = from rows in Enumerable.Range(0, n)
+                                    select testData[rows, c2] * c2Scale;
+            double[] xs = x.ToArray();
+            double[] ys = y.ToArray();
+            double r2_alglib = alglib.correlation.pearsoncorrelation(ref xs, ref ys, n);
+            r2_alglib *= r2_alglib;
+
+            var r2Calculator = new OnlinePearsonsRSquaredEvaluator();
+            for (int i = 0; i < n; i++) {
+              r2Calculator.Add(xs[i], ys[i]);
+            }
+            double r2 = r2Calculator.RSquared;
+
+            Assert.AreEqual(r2_alglib, r2, 1E-6 * Math.Max(c1Scale, c2Scale));
+          }
+        }
+      }
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicExpressionImporter.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicExpressionImporter.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicExpressionImporter.cs	(revision 4858)
@@ -0,0 +1,169 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+  internal class SymbolicExpressionImporter {
+    private const string VARSTART = "VAR";
+    private const string DEFUNSTART = "DEFUN";
+    private const string ARGSTART = "ARG";
+    private const string INVOKESTART = "CALL";
+    private Dictionary<string, Symbol> knownSymbols = new Dictionary<string, Symbol>() 
+      {
+        {"+", new Addition()},
+        {"/", new Division()},
+        {"*", new Multiplication()},
+        {"-", new Subtraction()},
+        {"EXP", new Exponential()},
+        {"LOG", new Logarithm()},
+        {"SIN",new Sine()},
+        {"COS", new Cosine()},
+        {"TAN", new Tangent()},
+        {"MEAN", new Average()},
+        {"IF", new IfThenElse()},
+        {">", new GreaterThan()},
+        {"<", new LessThan()},
+        {"AND", new And()},
+        {"OR", new Or()},
+        {"NOT", new Not()},
+        {"PROG", new ProgramRootSymbol()},
+        {"MAIN", new StartSymbol()},
+      };
+
+    Constant constant = new Constant();
+    Variable variable = new Variable();
+    Defun defun = new Defun();
+
+    ProgramRootSymbol programRootSymbol = new ProgramRootSymbol();
+    StartSymbol startSymbol = new StartSymbol();
+
+    public SymbolicExpressionImporter() {
+    }
+
+    internal SymbolicExpressionTree Import(string str) {
+      str = str.Replace("(", " ( ").Replace(")", " ) ");
+      SymbolicExpressionTreeNode root = programRootSymbol.CreateTreeNode();
+      SymbolicExpressionTreeNode start = startSymbol.CreateTreeNode();
+      SymbolicExpressionTreeNode mainBranch = ParseSexp(new Queue<Token>(GetTokenStream(str)));
+      if (mainBranch.Symbol is ProgramRootSymbol) {
+        // when a root symbol was parsed => use main branch as root
+        root = mainBranch;
+      } else {
+        // only a main branch was given => insert the main branch into the default tree template
+        root.AddSubTree(start);
+        start.AddSubTree(mainBranch);
+      }
+      return new SymbolicExpressionTree(root);
+    }
+
+    private IEnumerable<Token> GetTokenStream(string str) {
+      return
+             from strToken in str.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries).AsEnumerable()
+             let t = Token.Parse(strToken)
+             where t != null
+             select t;
+    }
+
+    private SymbolicExpressionTreeNode ParseSexp(Queue<Token> tokens) {
+      if (tokens.Peek().Symbol == TokenSymbol.LPAR) {
+        SymbolicExpressionTreeNode tree;
+        Expect(Token.LPAR, tokens);
+        if (tokens.Peek().StringValue.StartsWith(VARSTART)) {
+          tree = ParseVariable(tokens);
+        } else if (tokens.Peek().StringValue.StartsWith(DEFUNSTART)) {
+          tree = ParseDefun(tokens);
+          while (!tokens.Peek().Equals(Token.RPAR)) {
+            tree.AddSubTree(ParseSexp(tokens));
+          }
+        } else if (tokens.Peek().StringValue.StartsWith(ARGSTART)) {
+          tree = ParseArgument(tokens);
+        } else if (tokens.Peek().StringValue.StartsWith(INVOKESTART)) {
+          tree = ParseInvoke(tokens);
+          while (!tokens.Peek().Equals(Token.RPAR)) {
+            tree.AddSubTree(ParseSexp(tokens));
+          }
+        } else {
+          Token curToken = tokens.Dequeue();
+          tree = CreateTree(curToken);
+          while (!tokens.Peek().Equals(Token.RPAR)) {
+            tree.AddSubTree(ParseSexp(tokens));
+          }
+        }
+        Expect(Token.RPAR, tokens);
+        return tree;
+      } else if (tokens.Peek().Symbol == TokenSymbol.NUMBER) {
+        ConstantTreeNode t = (ConstantTreeNode)constant.CreateTreeNode();
+        t.Value = tokens.Dequeue().DoubleValue;
+        return t;
+      } else throw new FormatException("Expected function or constant symbol");
+    }
+
+    private SymbolicExpressionTreeNode ParseInvoke(Queue<Token> tokens) {
+      Token invokeTok = tokens.Dequeue();
+      Debug.Assert(invokeTok.StringValue == "CALL");
+      InvokeFunction invokeSym = new InvokeFunction(tokens.Dequeue().StringValue);
+      SymbolicExpressionTreeNode invokeNode = invokeSym.CreateTreeNode();
+      return invokeNode;
+    }
+
+    private SymbolicExpressionTreeNode ParseArgument(Queue<Token> tokens) {
+      Token argTok = tokens.Dequeue();
+      Debug.Assert(argTok.StringValue == "ARG");
+      Argument argument = new Argument((int)tokens.Dequeue().DoubleValue);
+      SymbolicExpressionTreeNode argNode = argument.CreateTreeNode();
+      return argNode;
+    }
+
+    private SymbolicExpressionTreeNode ParseDefun(Queue<Token> tokens) {
+      Token defTok = tokens.Dequeue();
+      Debug.Assert(defTok.StringValue == "DEFUN");
+      DefunTreeNode t = (DefunTreeNode)defun.CreateTreeNode();
+      t.FunctionName = tokens.Dequeue().StringValue;
+      return t;
+    }
+
+    private SymbolicExpressionTreeNode ParseVariable(Queue<Token> tokens) {
+      Token varTok = tokens.Dequeue();
+      Debug.Assert(varTok.StringValue == "VARIABLE");
+      VariableTreeNode t = (VariableTreeNode)variable.CreateTreeNode();
+      t.Weight = tokens.Dequeue().DoubleValue;
+      t.VariableName = tokens.Dequeue().StringValue;
+      return t;
+    }
+
+    private SymbolicExpressionTreeNode CreateTree(Token token) {
+      if (token.Symbol != TokenSymbol.SYMB) throw new FormatException("Expected function symbol, but got: " + token.StringValue);
+      return knownSymbols[token.StringValue].CreateTreeNode();
+    }
+
+    private void Expect(Token token, Queue<Token> tokens) {
+      Token cur = tokens.Dequeue();
+      if (!token.Equals(cur)) throw new FormatException("Expected: " + token.StringValue + ", but got: " + cur.StringValue);
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicSimplifierTest.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicSimplifierTest.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicSimplifierTest.cs	(revision 4858)
@@ -0,0 +1,108 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+  [TestClass()]
+  public class SymbolicSimplifierTest {
+    [DeploymentItem(@"RegressionSolution01.hl")]
+    [DeploymentItem(@"RegressionSolution02.hl")]
+    [DeploymentItem(@"RegressionSolution03.hl")]
+    [DeploymentItem(@"RegressionSolution04.hl")]
+    [DeploymentItem(@"RegressionSolution05.hl")]
+    [DeploymentItem(@"RegressionSolution06.hl")]
+    [TestMethod]
+    public void SimplifyRegressionSolutionsTest() {
+      ContentManager.Initialize(new PersistenceContentManager());
+
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution01.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution02.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution03.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution04.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution05.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution06.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+    }
+
+    private SymbolicRegressionSolution LoadSolution(string fileName) {
+      var doc = ContentManager.Load(fileName);
+      Result result = doc as Result;
+      if (result != null) {
+        return (SymbolicRegressionSolution)result.Value;
+      }
+      SymbolicRegressionSolution solution = doc as SymbolicRegressionSolution;
+      if (solution != null) {
+        return solution;
+      }
+      Assert.Fail("Cannot load file " + fileName);
+      throw new AssertFailedException();
+    }
+
+    private SymbolicRegressionSolution SimplifySolution(SymbolicRegressionSolution original) {
+      SymbolicSimplifier simplifier = new SymbolicSimplifier();
+      SymbolicExpressionTree simplifiedTree = simplifier.Simplify(original.Model.SymbolicExpressionTree);
+      SymbolicRegressionModel simplifiedModel = new SymbolicRegressionModel(original.Model.Interpreter, simplifiedTree);
+      return new SymbolicRegressionSolution(original.ProblemData, simplifiedModel, original.LowerEstimationLimit, original.UpperEstimationLimit);
+    }
+
+    private void AssertEqualEnumerations(IEnumerable<double> expected, IEnumerable<double> actual) {
+      var expectedEnumerator = expected.GetEnumerator();
+      var actualEnumerator = actual.GetEnumerator();
+      while (expectedEnumerator.MoveNext() & actualEnumerator.MoveNext()) {
+        Assert.AreEqual(expectedEnumerator.Current, actualEnumerator.Current, Math.Abs(1E-6 * expectedEnumerator.Current));
+      }
+      if (expectedEnumerator.MoveNext() | actualEnumerator.MoveNext())
+        Assert.Fail("Number of elements in enumerations do not match");
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Token.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Token.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Token.cs	(revision 4858)
@@ -0,0 +1,67 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Globalization;
+
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+  internal enum TokenSymbol { LPAR, RPAR, SYMB, NUMBER };
+  internal class Token {
+    public static readonly Token LPAR = Token.Parse("(");
+    public static readonly Token RPAR = Token.Parse(")");
+
+    public TokenSymbol Symbol { get; set; }
+    public string StringValue { get; set; }
+    public double DoubleValue { get; set; }
+    public Token() { }
+
+    public override bool Equals(object obj) {
+      Token other = (obj as Token);
+      if (other == null) return false;
+      if (other.Symbol != Symbol) return false;
+      return other.StringValue == this.StringValue;
+    }
+
+    public override int GetHashCode() {
+      return Symbol.GetHashCode() & StringValue.GetHashCode();
+    }
+
+    public static Token Parse(string strToken) {
+      strToken = strToken.Trim();
+      Token t = new Token();
+      t.StringValue = strToken.Trim();
+      double temp;
+      if (strToken == "") {
+        t = null;
+      } else if (strToken == "(") {
+        t.Symbol = TokenSymbol.LPAR;
+      } else if (strToken == ")") {
+        t.Symbol = TokenSymbol.RPAR;
+      } else if (double.TryParse(strToken, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out temp)) {
+        t.Symbol = TokenSymbol.NUMBER;
+        t.DoubleValue = double.Parse(strToken, CultureInfo.InvariantCulture.NumberFormat);
+      } else {
+        t.Symbol = TokenSymbol.SYMB;
+        t.StringValue = t.StringValue.ToUpper();
+      }
+      return t;
+    }
+  }
+}
Index: branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Util.cs
===================================================================
--- branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Util.cs	(revision 4858)
+++ branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Util.cs	(revision 4858)
@@ -0,0 +1,104 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+  internal class Util {
+
+    public static void InitTree(SymbolicExpressionTree tree, MersenneTwister twister, List<string> varNames) {
+      foreach (var node in tree.IterateNodesPostfix()) {
+        if (node is VariableTreeNode) {
+          var varNode = node as VariableTreeNode;
+          varNode.Weight = twister.NextDouble() * 20.0 - 10.0;
+          varNode.VariableName = varNames[twister.Next(varNames.Count)];
+        } else if (node is ConstantTreeNode) {
+          var constantNode = node as ConstantTreeNode;
+          constantNode.Value = twister.NextDouble() * 20.0 - 10.0;
+        }
+      }
+    }
+
+
+    public static SymbolicExpressionTree[] CreateRandomTrees(MersenneTwister twister, Dataset dataset, ISymbolicExpressionGrammar grammar, int popSize) {
+      return CreateRandomTrees(twister, dataset, grammar, popSize, 1, 200, 3, 3);
+    }
+
+    public static SymbolicExpressionTree[] CreateRandomTrees(MersenneTwister twister, Dataset dataset, ISymbolicExpressionGrammar grammar,
+      int popSize, int minSize, int maxSize,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
+      foreach (Variable variableSymbol in grammar.Symbols.OfType<Variable>()) {
+        variableSymbol.VariableNames = dataset.VariableNames.Skip(1);
+      }
+      SymbolicExpressionTree[] randomTrees = new SymbolicExpressionTree[popSize];
+      for (int i = 0; i < randomTrees.Length; i++) {
+        randomTrees[i] = ProbabilisticTreeCreator.Create(twister, grammar, maxSize, 10, maxFunctionDefinitions, maxFunctionArguments);
+      }
+      return randomTrees;
+    }
+
+
+    public static Dataset CreateRandomDataset(MersenneTwister twister, int rows, int columns) {
+      double[,] data = new double[rows, columns];
+      for (int i = 0; i < rows; i++) {
+        for (int j = 0; j < columns; j++) {
+          data[i, j] = twister.NextDouble() * 2.0 - 1.0;
+        }
+      }
+      IEnumerable<string> variableNames = new string[] { "y" }.Concat(Enumerable.Range(0, columns - 1).Select(x => "x" + x.ToString()));
+      Dataset ds = new Dataset(variableNames, data);
+      return ds;
+    }
+
+    public static double NodesPerSecond(long nNodes, Stopwatch watch) {
+      return nNodes / (watch.ElapsedMilliseconds / 1000.0);
+    }
+
+    public static void EvaluateTrees(SymbolicExpressionTree[] trees, ISymbolicExpressionTreeInterpreter interpreter, Dataset dataset, int repetitions) {
+      double[] estimation = new double[dataset.Rows];
+      // warm up
+      for (int i = 0; i < trees.Length; i++) {
+        estimation = interpreter.GetSymbolicExpressionTreeValues(trees[i], dataset, Enumerable.Range(0, dataset.Rows)).ToArray();
+      }
+
+      Stopwatch watch = new Stopwatch();
+      long nNodes = 0;
+      for (int rep = 0; rep < repetitions; rep++) {
+        watch.Start();
+        for (int i = 0; i < trees.Length; i++) {
+          nNodes += trees[i].Size * (dataset.Rows - 1);
+          estimation = interpreter.GetSymbolicExpressionTreeValues(trees[i], dataset, Enumerable.Range(0, dataset.Rows)).ToArray();
+        }
+        watch.Stop();
+      }
+      Assert.Inconclusive("Random tree evaluation performance of " + interpreter.GetType() + ":" +
+        watch.ElapsedMilliseconds + "ms " +
+        Util.NodesPerSecond(nNodes, watch) + " nodes/sec");
+    }
+  }
+}
