Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableCondition.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableCondition.cs	(revision 5474)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableCondition.cs	(revision 5484)
@@ -144,6 +144,6 @@
     #region persistence and cloning
     [StorableConstructor]
-    protected VariableCondition(bool deserializing) : base(deserializing) { }
-    protected VariableCondition(VariableCondition original, Cloner cloner)
+    private VariableCondition(bool deserializing) : base(deserializing) { }
+    private VariableCondition(VariableCondition original, Cloner cloner)
       : base(original, cloner) {
       thresholdInitializerMu = original.thresholdInitializerMu;
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblem.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblem.cs	(revision 5474)
+++ 	(revision )
@@ -1,153 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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.VSImageLibrary.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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblemData.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblemData.cs	(revision 5474)
+++ 	(revision )
@@ -1,420 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 TableFileParser();
-      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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisSolution.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisSolution.cs	(revision 5474)
+++ 	(revision )
@@ -1,164 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataFormatException.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataFormatException.cs	(revision 5474)
+++ 	(revision )
@@ -1,44 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 5474)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 5484)
@@ -108,35 +108,24 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Dataset.cs" />
+    <Compile Include="Interfaces\IDataAnalysisEvaluator.cs" />
+    <Compile Include="Interfaces\IDataAnalysisProblemData.cs" />
+    <Compile Include="Interfaces\IDataAnalysisSolution.cs" />
+    <Compile Include="Interfaces\IDataAnalysisSolutionCreator.cs" />
     <Compile Include="TableFileParser.cs" />
     <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="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="Online Evaluators\OnlineCovarianceEvaluator.cs" />
+    <Compile Include="Online Evaluators\OnlineMeanAndVarianceCalculator.cs" />
+    <Compile Include="Online Evaluators\OnlineNormalizedMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="Online Evaluators\OnlineMeanAbsolutePercentageErrorEvaluator.cs" />
+    <Compile Include="Online Evaluators\OnlineMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="Online Evaluators\OnlinePearsonsRSquaredEvaluator.cs" />
     <Compile Include="HeuristicLabProblemsDataAnalysisPlugin.cs" />
-    <Compile Include="Interfaces\ILaggedTreeNode.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="Online Evaluators\IOnlineEvaluator.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="RandomEnumerable.cs" />
   </ItemGroup>
   <ItemGroup>
@@ -160,8 +149,4 @@
       <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\3.1.0\ALGLIB-3.1.0\ALGLIB-3.1.0.csproj">
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisEvaluator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisEvaluator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisEvaluator.cs	(revision 5484)
@@ -0,0 +1,27 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 IDataAnalysisEvaluator : IEvaluator {
+  }
+}
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisModel.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisModel.cs	(revision 5474)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisModel.cs	(revision 5484)
@@ -25,5 +25,5 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IDataAnalysisModel : INamedItem {
-    IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end);
+    IEnumerable<double> GetEstimatedValues(IDataAnalysisProblemData problemData, int start, int end);
   }
 }
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs	(revision 5474)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs	(revision 5484)
@@ -24,5 +24,7 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IDataAnalysisProblem : IProblem {
-    DataAnalysisProblemData DataAnalysisProblemData { get; }
+    IDataAnalysisProblemData DataAnalysisProblemData { get; }
+    new IDataAnalysisEvaluator Evaluator { get; }
+    new IDataAnalysisSolutionCreator SolutionCreator { get; }
   }
 }
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs	(revision 5484)
@@ -0,0 +1,29 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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;
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDataAnalysisProblemData {
+    Dataset Dataset { get; }
+    IEnumerable<string> InputVariables { get; }
+  }
+}
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolution.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolution.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolution.cs	(revision 5484)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 IDataAnalysisSolution {
+    IDataAnalysisModel Model { get; }
+    IDataAnalysisProblemData Problem { get; }
+  }
+}
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolutionCreator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolutionCreator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolutionCreator.cs	(revision 5484)
@@ -0,0 +1,27 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 IDataAnalysisSolutionCreator : ISolutionCreator {
+  }
+}
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/ILaggedTreeNode.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/ILaggedTreeNode.cs	(revision 5474)
+++ 	(revision )
@@ -1,28 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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.Encodings.SymbolicExpressionTreeEncoding;
-namespace HeuristicLab.Problems.DataAnalysis {
-  public interface ILaggedTreeNode : ISymbolicExpressionTreeNode {
-    int Lag { get; set; }
-  }
-}
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IOnlineEvaluator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IOnlineEvaluator.cs	(revision 5474)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/ISingleObjectiveDataAnalysisProblem.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/ISingleObjectiveDataAnalysisProblem.cs	(revision 5474)
+++ 	(revision )
@@ -1,26 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/MatrixExtensions.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/MatrixExtensions.cs	(revision 5474)
+++ 	(revision )
@@ -1,46 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/IOnlineEvaluator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/IOnlineEvaluator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/IOnlineEvaluator.cs	(revision 5484)
@@ -0,0 +1,29 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineCovarianceEvaluator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineCovarianceEvaluator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineCovarianceEvaluator.cs	(revision 5484)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs	(revision 5484)
@@ -0,0 +1,66 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanAndVarianceCalculator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanAndVarianceCalculator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanAndVarianceCalculator.cs	(revision 5484)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanSquaredErrorEvaluator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanSquaredErrorEvaluator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineMeanSquaredErrorEvaluator.cs	(revision 5484)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs	(revision 5484)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlinePearsonsRSquaredEvaluator.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlinePearsonsRSquaredEvaluator.cs	(revision 5484)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Online Evaluators/OnlinePearsonsRSquaredEvaluator.cs	(revision 5484)
@@ -0,0 +1,71 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RandomEnumerable.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RandomEnumerable.cs	(revision 5474)
+++ 	(revision )
@@ -1,52 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/TableFileParser.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/TableFileParser.cs	(revision 5474)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/TableFileParser.cs	(revision 5484)
@@ -25,4 +25,5 @@
 using System.IO;
 using System.Linq;
+using System.Runtime.Serialization;
 using System.Text;
 
@@ -366,4 +367,23 @@
     }
     #endregion
+
+    [Serializable]
+    private 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) { }
+    }
   }
 }
