Index: /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLab.Algorithms.DataAnalysis-3.3.csproj
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLab.Algorithms.DataAnalysis-3.3.csproj	(revision 4471)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLab.Algorithms.DataAnalysis-3.3.csproj	(revision 4471)
@@ -0,0 +1,166 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{A8D5676D-9662-437A-B44D-ECB4046CDE12}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.DataAnalysis</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.DataAnalysis-3.3</AssemblyName>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <StartupObject>
+    </StartupObject>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <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>
+    <DocumentationFile>bin\Release\HeuristicLab.Algorithms.DataAnalysis-3.3.xml</DocumentationFile>
+    <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>
+    <DocumentationFile>bin\x86\Release\HeuristicLab.Algorithms.DataAnalysis-3.3.xml</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <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>
+    <DocumentationFile>bin\x64\Release\HeuristicLab.Algorithms.DataAnalysis-3.3.xml</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-2.5.0, Version=2.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Regression-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="SupportVectorMachine.cs" />
+    <Compile Include="HeuristicLabAlgorithmsDataAnalysisPlugin.cs" />
+    <Compile Include="LinearRegression.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </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>
+  <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>
+  -->
+  <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\HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabAlgorithmsDataAnalysisPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame	(revision 4471)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame	(revision 4471)
@@ -0,0 +1,32 @@
+#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.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  /// <summary>
+  /// Plugin class for HeuristicLab.Algorithms.DataAnalysis plugin.
+  /// </summary>
+  [Plugin("HeuristicLab.Algorithms.DataAnalysis", "3.3.0.$WCREV$")]
+  [PluginFile("HeuristicLab.Algorithms.DataAnalysis-3.3.dll", PluginFileType.Assembly)]
+  public class HeuristicLabAlgorithmsDataAnalysisPlugin : PluginBase {
+  }
+}
Index: /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/LinearRegression.cs
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/LinearRegression.cs	(revision 4471)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/LinearRegression.cs	(revision 4471)
@@ -0,0 +1,180 @@
+#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.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Problems.DataAnalysis.Regression.LinearRegression;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  /// <summary>
+  /// Linear regression data analysis algorithm.
+  /// </summary>
+  [Item("Linear Regression", "Linear regression data analysis algorithm.")]
+  [Creatable("Data Analysis")]
+  [StorableClass]
+  public sealed class LinearRegression : EngineAlgorithm, IStorableContent {
+    private const string TrainingSamplesStartParameterName = "Training start";
+    private const string TrainingSamplesEndParameterName = "Training end";
+    private const string LinearRegressionModelParameterName = "LinearRegressionModel";
+    private const string ModelInterpreterParameterName = "Model interpreter";
+
+    public string Filename { get; set; }
+
+    #region Problem Properties
+    public override Type ProblemType {
+      get { return typeof(DataAnalysisProblem); }
+    }
+    public new DataAnalysisProblem Problem {
+      get { return (DataAnalysisProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    #endregion
+
+    #region parameter properties
+    public IValueParameter<IntValue> TrainingSamplesStartParameter {
+      get { return (IValueParameter<IntValue>)Parameters[TrainingSamplesStartParameterName]; }
+    }
+    public IValueParameter<IntValue> TrainingSamplesEndParameter {
+      get { return (IValueParameter<IntValue>)Parameters[TrainingSamplesEndParameterName]; }
+    }
+    public IValueParameter<ISymbolicExpressionTreeInterpreter> ModelInterpreterParameter {
+      get { return (IValueParameter<ISymbolicExpressionTreeInterpreter>)Parameters[ModelInterpreterParameterName]; }
+    }
+    #endregion
+
+    [Storable]
+    private LinearRegressionSolutionCreator solutionCreator;
+    [Storable]
+    private SimpleSymbolicRegressionEvaluator evaluator;
+    [Storable]
+    private SimpleMSEEvaluator mseEvaluator;
+    [Storable]
+    private BestSymbolicRegressionSolutionAnalyzer analyzer;
+    public LinearRegression()
+      : base() {
+      Parameters.Add(new ValueParameter<IntValue>(TrainingSamplesStartParameterName, "The first index of the data set partition to use for training."));
+      Parameters.Add(new ValueParameter<IntValue>(TrainingSamplesEndParameterName, "The last index of the data set partition to use for training."));
+      Parameters.Add(new ValueParameter<ISymbolicExpressionTreeInterpreter>(ModelInterpreterParameterName, "The interpreter to use for evaluation of the model.", new SimpleArithmeticExpressionInterpreter()));
+
+      solutionCreator = new LinearRegressionSolutionCreator();
+      evaluator = new SimpleSymbolicRegressionEvaluator();
+      mseEvaluator = new SimpleMSEEvaluator();
+      analyzer = new BestSymbolicRegressionSolutionAnalyzer();
+
+      OperatorGraph.InitialOperator = solutionCreator;
+      solutionCreator.Successor = evaluator;
+      evaluator.Successor = mseEvaluator;
+      mseEvaluator.Successor = analyzer;
+
+      Initialize();
+    }
+    [StorableConstructor]
+    private LinearRegression(bool deserializing) : base(deserializing) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      LinearRegression clone = (LinearRegression)base.Clone(cloner);
+      clone.solutionCreator = (LinearRegressionSolutionCreator)cloner.Clone(solutionCreator);
+      clone.evaluator = (SimpleSymbolicRegressionEvaluator)cloner.Clone(evaluator);
+      clone.mseEvaluator = (SimpleMSEEvaluator)cloner.Clone(mseEvaluator);
+      clone.analyzer = (BestSymbolicRegressionSolutionAnalyzer)cloner.Clone(analyzer);
+      clone.Initialize();
+      return clone;
+    }
+
+    public override void Prepare() {
+      if (Problem != null) base.Prepare();
+    }
+
+    protected override void Problem_Reset(object sender, EventArgs e) {
+      UpdateAlgorithmParameterValues();
+      base.Problem_Reset(sender, e);
+    }
+
+    #region Events
+    protected override void OnProblemChanged() {
+      solutionCreator.DataAnalysisProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+      evaluator.RegressionProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+      analyzer.ProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+      UpdateAlgorithmParameterValues();
+      Problem.Reset += new EventHandler(Problem_Reset);
+      base.OnProblemChanged();
+    }
+
+
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() {
+      solutionCreator.SamplesStartParameter.ActualName = TrainingSamplesStartParameter.Name;
+      solutionCreator.SamplesEndParameter.ActualName = TrainingSamplesEndParameter.Name;
+      solutionCreator.SymbolicExpressionTreeParameter.ActualName = LinearRegressionModelParameterName;
+
+      evaluator.SymbolicExpressionTreeParameter.ActualName = solutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      evaluator.SymbolicExpressionTreeInterpreterParameter.ActualName = ModelInterpreterParameter.Name;
+      evaluator.ValuesParameter.ActualName = "Training values";
+      evaluator.SamplesStartParameter.ActualName = TrainingSamplesStartParameterName;
+      evaluator.SamplesEndParameter.ActualName = TrainingSamplesEndParameterName;
+
+      mseEvaluator.ValuesParameter.ActualName = "Training values";
+      mseEvaluator.MeanSquaredErrorParameter.ActualName = "Training MSE";
+
+      analyzer.SymbolicExpressionTreeParameter.ActualName = solutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      analyzer.SymbolicExpressionTreeParameter.Depth = 0;
+      analyzer.QualityParameter.ActualName = mseEvaluator.MeanSquaredErrorParameter.ActualName;
+      analyzer.QualityParameter.Depth = 0;
+      analyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = ModelInterpreterParameter.Name;
+
+      if (Problem != null) {
+        solutionCreator.DataAnalysisProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+        evaluator.RegressionProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+        analyzer.ProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+        Problem.Reset += new EventHandler(Problem_Reset);
+      }
+    }
+
+    private void UpdateAlgorithmParameterValues() {
+      TrainingSamplesStartParameter.ActualValue = Problem.DataAnalysisProblemData.TrainingSamplesStart;
+      TrainingSamplesEndParameter.ActualValue = Problem.DataAnalysisProblemData.TrainingSamplesEnd;
+      //var targetValues =
+      //  Problem.DataAnalysisProblemData.Dataset.GetVariableValues(Problem.DataAnalysisProblemData.TargetVariable.Value,
+      //  TrainingSamplesStartParameter.Value.Value, TrainingSamplesEndParameter.Value.Value);
+      //double range = targetValues.Max() - targetValues.Min();
+      //double lowerEstimationLimit = targetValues.Average() - 10.0 * range;
+      //double upperEstimationLimit = targetValues.Average() + 10.0 * range;
+      //evaluator.LowerEstimationLimitParameter.Value = new DoubleValue(lowerEstimationLimit);
+      //evaluator.UpperEstimationLimitParameter.Value = new DoubleValue(upperEstimationLimit);
+      //analyzer.LowerEstimationLimitParameter.Value = new DoubleValue(lowerEstimationLimit);
+      //analyzer.UpperEstimationLimitParameter.Value = new DoubleValue(upperEstimationLimit);
+    }
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/Properties/AssemblyInfo.frame	(revision 4471)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/Properties/AssemblyInfo.frame	(revision 4471)
@@ -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.Algorithms.DataAnalysis")]
+[assembly: AssemblyDescription("HeuristicLab data-analysis algorithms")]
+[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("E32D1796-011F-402c-8E97-8A13DFB6B4DC")]
+
+// 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.0.$WCREV$")]
Index: /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/SupportVectorMachine.cs
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/SupportVectorMachine.cs	(revision 4471)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/SupportVectorMachine.cs	(revision 4471)
@@ -0,0 +1,217 @@
+#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.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Problems.DataAnalysis.Regression.SupportVectorRegression;
+using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  /// <summary>
+  /// A support vector machine.
+  /// </summary>
+  [Item("Support Vector Machine", "Support vector machine data analysis algorithm.")]
+  [Creatable("Data Analysis")]
+  [StorableClass]
+  public sealed class SupportVectorMachine : EngineAlgorithm, IStorableContent {
+    private const string TrainingSamplesStartParameterName = "Training start";
+    private const string TrainingSamplesEndParameterName = "Training end";
+    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 ModelParameterName = "SupportVectorMachineModel";
+
+    public string Filename { get; set; }
+
+    #region Problem Properties
+    public override Type ProblemType {
+      get { return typeof(DataAnalysisProblem); }
+    }
+    public new DataAnalysisProblem Problem {
+      get { return (DataAnalysisProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    #endregion
+
+    #region parameter properties
+    public IValueParameter<IntValue> TrainingSamplesStartParameter {
+      get { return (IValueParameter<IntValue>)Parameters[TrainingSamplesStartParameterName]; }
+    }
+    public IValueParameter<IntValue> TrainingSamplesEndParameter {
+      get { return (IValueParameter<IntValue>)Parameters[TrainingSamplesEndParameterName]; }
+    }
+    public IValueParameter<StringValue> SvmTypeParameter {
+      get { return (IValueParameter<StringValue>)Parameters[SvmTypeParameterName]; }
+    }
+    public IValueParameter<StringValue> KernelTypeParameter {
+      get { return (IValueParameter<StringValue>)Parameters[KernelTypeParameterName]; }
+    }
+    public IValueParameter<DoubleValue> NuParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[NuParameterName]; }
+    }
+    public IValueParameter<DoubleValue> CostParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[CostParameterName]; }
+    }
+    public IValueParameter<DoubleValue> GammaParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[GammaParameterName]; }
+    }
+    public IValueParameter<DoubleValue> EpsilonParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[EpsilonParameterName]; }
+    }
+    #endregion
+
+    [Storable]
+    private SupportVectorMachineModelCreator solutionCreator;
+    [Storable]
+    private SupportVectorMachineModelEvaluator evaluator;
+    [Storable]
+    private SimpleMSEEvaluator mseEvaluator;
+    [Storable]
+    private BestSupportVectorRegressionSolutionAnalyzer analyzer;
+    public SupportVectorMachine()
+      : base() {
+      #region svm types
+      StringValue cSvcType = new StringValue("C_SVC").AsReadOnly();
+      StringValue nuSvcType = new StringValue("NU_SVC").AsReadOnly();
+      StringValue eSvrType = new StringValue("EPSILON_SVR").AsReadOnly();
+      StringValue nuSvrType = new StringValue("NU_SVR").AsReadOnly();
+      ItemSet<StringValue> allowedSvmTypes = new ItemSet<StringValue>();
+      allowedSvmTypes.Add(cSvcType);
+      allowedSvmTypes.Add(nuSvcType);
+      allowedSvmTypes.Add(eSvrType);
+      allowedSvmTypes.Add(nuSvrType);
+      #endregion
+      #region kernel types
+      StringValue rbfKernelType = new StringValue("RBF").AsReadOnly();
+      StringValue linearKernelType = new StringValue("LINEAR").AsReadOnly();
+      StringValue polynomialKernelType = new StringValue("POLY").AsReadOnly();
+      StringValue sigmoidKernelType = new StringValue("SIGMOID").AsReadOnly();
+      ItemSet<StringValue> allowedKernelTypes = new ItemSet<StringValue>();
+      allowedKernelTypes.Add(rbfKernelType);
+      allowedKernelTypes.Add(linearKernelType);
+      allowedKernelTypes.Add(polynomialKernelType);
+      allowedKernelTypes.Add(sigmoidKernelType);
+      #endregion
+      Parameters.Add(new ValueParameter<IntValue>(TrainingSamplesStartParameterName, "The first index of the data set partition to use for training."));
+      Parameters.Add(new ValueParameter<IntValue>(TrainingSamplesEndParameterName, "The last index of the data set partition to use for training."));
+      Parameters.Add(new ConstrainedValueParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", allowedSvmTypes, nuSvrType));
+      Parameters.Add(new ConstrainedValueParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", allowedKernelTypes, rbfKernelType));
+      Parameters.Add(new ValueParameter<DoubleValue>(NuParameterName, "The value of the nu parameter nu-SVC, one-class SVM and nu-SVR.", new DoubleValue(0.5)));
+      Parameters.Add(new ValueParameter<DoubleValue>(CostParameterName, "The value of the C (cost) parameter of C-SVC, epsilon-SVR and nu-SVR.", new DoubleValue(1.0)));
+      Parameters.Add(new ValueParameter<DoubleValue>(GammaParameterName, "The value of the gamma parameter in the kernel function.", new DoubleValue(1.0)));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(EpsilonParameterName, "The value of the epsilon parameter (only for epsilon-SVR).", new DoubleValue(1.0)));
+
+      solutionCreator = new SupportVectorMachineModelCreator();
+      evaluator = new SupportVectorMachineModelEvaluator();
+      mseEvaluator = new SimpleMSEEvaluator();
+      analyzer = new BestSupportVectorRegressionSolutionAnalyzer();
+
+      OperatorGraph.InitialOperator = solutionCreator;
+      solutionCreator.Successor = evaluator;
+      evaluator.Successor = mseEvaluator;
+      mseEvaluator.Successor = analyzer;
+
+      Initialize();
+    }
+    [StorableConstructor]
+    private SupportVectorMachine(bool deserializing) : base(deserializing) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      SupportVectorMachine clone = (SupportVectorMachine)base.Clone(cloner);
+      clone.solutionCreator = (SupportVectorMachineModelCreator)cloner.Clone(solutionCreator);
+      clone.evaluator = (SupportVectorMachineModelEvaluator)cloner.Clone(evaluator);
+      clone.mseEvaluator = (SimpleMSEEvaluator)cloner.Clone(mseEvaluator);
+      clone.analyzer = (BestSupportVectorRegressionSolutionAnalyzer)cloner.Clone(analyzer);
+      clone.Initialize();
+      return clone;
+    }
+
+    public override void Prepare() {
+      if (Problem != null) base.Prepare();
+    }
+
+    protected override void Problem_Reset(object sender, EventArgs e) {
+      UpdateAlgorithmParameters();
+      base.Problem_Reset(sender, e);
+    }
+
+    #region Events
+    protected override void OnProblemChanged() {
+      solutionCreator.DataAnalysisProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+      evaluator.DataAnalysisProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+      analyzer.ProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+      UpdateAlgorithmParameters();
+      Problem.Reset += new EventHandler(Problem_Reset);
+      base.OnProblemChanged();
+    }
+
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() {
+      solutionCreator.SvmTypeParameter.ActualName = SvmTypeParameter.Name;
+      solutionCreator.KernelTypeParameter.ActualName = KernelTypeParameter.Name;
+      solutionCreator.CostParameter.ActualName = CostParameter.Name;
+      solutionCreator.GammaParameter.ActualName = GammaParameter.Name;
+      solutionCreator.NuParameter.ActualName = NuParameter.Name;
+      solutionCreator.SamplesStartParameter.ActualName = TrainingSamplesStartParameter.Name;
+      solutionCreator.SamplesEndParameter.ActualName = TrainingSamplesEndParameter.Name;
+
+      evaluator.SamplesStartParameter.ActualName = TrainingSamplesStartParameter.Name;
+      evaluator.SamplesEndParameter.ActualName = TrainingSamplesEndParameter.Name;
+      evaluator.SupportVectorMachineModelParameter.ActualName = solutionCreator.SupportVectorMachineModelParameter.ActualName;
+      evaluator.ValuesParameter.ActualName = "Training values";
+
+      mseEvaluator.ValuesParameter.ActualName = "Training values";
+      mseEvaluator.MeanSquaredErrorParameter.ActualName = "Training MSE";
+
+      analyzer.SupportVectorRegressionModelParameter.ActualName = solutionCreator.SupportVectorMachineModelParameter.ActualName;
+      analyzer.SupportVectorRegressionModelParameter.Depth = 0;
+      analyzer.QualityParameter.ActualName = mseEvaluator.MeanSquaredErrorParameter.ActualName;
+      analyzer.QualityParameter.Depth = 0;
+
+      if (Problem != null) {
+        solutionCreator.DataAnalysisProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+        evaluator.DataAnalysisProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+        analyzer.ProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+        Problem.Reset += new EventHandler(Problem_Reset);
+      }
+    }
+
+    private void UpdateAlgorithmParameters() {
+      TrainingSamplesStartParameter.ActualValue = Problem.DataAnalysisProblemData.TrainingSamplesStart;
+      TrainingSamplesEndParameter.ActualValue = Problem.DataAnalysisProblemData.TrainingSamplesEnd;
+    }
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.Classification/HeuristicLab.Classification.sln
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Classification.sln	(revision 4470)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Classification.sln	(revision 4471)
@@ -14,7 +14,5 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3", "HeuristicLab.Problems.DataAnalysis.Classification.Views\3.3\HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3.csproj", "{7F038E9A-B91E-4F49-8C27-D47BC86F1220}"
 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.Problems.DataAnalysis.Views-3.3", "HeuristicLab.Problems.DataAnalysis.Views\3.3\HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj", "{799B0B38-E384-4A17-A73C-F211EB854592}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.DataAnalysis-3.3", "HeuristicLab.Algorithms.DataAnalysis\3.3\HeuristicLab.Algorithms.DataAnalysis-3.3.csproj", "{A8D5676D-9662-437A-B44D-ECB4046CDE12}"
 EndProject
 Global
@@ -68,28 +66,16 @@
 		{7F038E9A-B91E-4F49-8C27-D47BC86F1220}.Release|x86.ActiveCfg = Release|x86
 		{7F038E9A-B91E-4F49-8C27-D47BC86F1220}.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
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|x64.ActiveCfg = Debug|x64
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|x64.Build.0 = Debug|x64
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|x86.ActiveCfg = Debug|x86
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|x86.Build.0 = Debug|x86
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|Any CPU.Build.0 = Release|Any CPU
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|x64.ActiveCfg = Release|x64
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|x64.Build.0 = Release|x64
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|x86.ActiveCfg = Release|x86
-		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|x86.Build.0 = Release|x86
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Debug|x64.ActiveCfg = Debug|x64
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Debug|x64.Build.0 = Debug|x64
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Debug|x86.ActiveCfg = Debug|x86
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Debug|x86.Build.0 = Debug|x86
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Release|x64.ActiveCfg = Release|x64
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Release|x64.Build.0 = Release|x64
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Release|x86.ActiveCfg = Release|x86
+		{A8D5676D-9662-437A-B44D-ECB4046CDE12}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: /branches/HeuristicLab.Classification/HeuristicLab.Classification/UpdateLocalInstallation.cmd
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Classification/UpdateLocalInstallation.cmd	(revision 4470)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Classification/UpdateLocalInstallation.cmd	(revision 4471)
@@ -1,6 +1,5 @@
 set target=C:\Program Files\HeuristicLab 3.3\
 
-copy "%SolutionDir%\HeuristicLab.Problems.DataAnalysis\3.3\%Outdir%\HeuristicLab.Problems.DataAnalysis-3.3.dll" "%target%"
+copy "%SolutionDir%\HeuristicLab.Algorithms.DataAnalysis\3.3\%Outdir%\HeuristicLab.Algorithms.DataAnalysis-3.3.dll" "%target%"
 copy "%SolutionDir%\HeuristicLab.Problems.DataAnalysis.Classification\3.3\%Outdir%\HeuristicLab.Problems.DataAnalysis.Classification-3.3.dll" "%target%"
 copy "%SolutionDir%\HeuristicLab.Problems.DataAnalysis.Classification.Views\3.3\%Outdir%\HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3.dll" "%target%"
-copy "%SolutionDir%\HeuristicLab.Problems.DataAnalysis.Views\3.3\%Outdir%\HeuristicLab.Problems.DataAnalysis.Views-3.3.dll" "%target%"
