Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.Designer.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.Designer.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.Designer.cs	(revision 15127)
@@ -0,0 +1,98 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
+  partial class GradientBoostedTreesModelView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.listBox = new System.Windows.Forms.ListBox();
+      this.SuspendLayout();
+      // 
+      // viewHost
+      // 
+      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.viewHost.Caption = "View";
+      this.viewHost.Content = null;
+      this.viewHost.Enabled = false;
+      this.viewHost.Location = new System.Drawing.Point(126, 3);
+      this.viewHost.Name = "viewHost";
+      this.viewHost.ReadOnly = false;
+      this.viewHost.Size = new System.Drawing.Size(220, 277);
+      this.viewHost.TabIndex = 0;
+      this.viewHost.ViewsLabelVisible = true;
+      this.viewHost.ViewType = null;
+      // 
+      // listBox
+      // 
+      this.listBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+      this.listBox.Location = new System.Drawing.Point(3, 3);
+      this.listBox.Name = "listBox";
+      this.listBox.Size = new System.Drawing.Size(117, 277);
+      this.listBox.TabIndex = 1;
+      this.listBox.SelectedIndexChanged += new System.EventHandler(this.listBox_SelectedIndexChanged);
+      // 
+      // GradientBoostedTreesModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.viewHost);
+      this.Controls.Add(this.listBox);
+      this.Name = "GradientBoostedTreesModelView";
+      this.Size = new System.Drawing.Size(349, 289);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private MainForm.WindowsForms.ViewHost viewHost;
+    private System.Windows.Forms.ListBox listBox;
+
+
+
+
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.cs	(revision 15127)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Drawing;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
+  [View("Gradient boosted tree model")]
+  [Content(typeof(GradientBoostedTreesSolution), false)]
+  public partial class GradientBoostedTreesModelView : DataAnalysisSolutionEvaluationView {
+    public override Image ViewImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
+    }
+
+    public new GradientBoostedTreesSolution Content {
+      get { return (GradientBoostedTreesSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      listBox.Enabled = Content != null;
+      viewHost.Enabled = Content != null;
+    }
+
+    public GradientBoostedTreesModelView()
+      : base() {
+      InitializeComponent();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        viewHost.Content = null;
+        listBox.Items.Clear();
+      } else {
+        viewHost.Content = null;
+        listBox.Items.Clear();
+        foreach (var e in Content.Model.Models) {
+          listBox.Items.Add(e);
+        }
+      }
+    }
+
+    private void listBox_SelectedIndexChanged(object sender, System.EventArgs e) {
+      var model = listBox.SelectedItem;
+      if (model == null) viewHost.Content = null;
+      else {
+        var treeModel = model as RegressionTreeModel;
+        if (treeModel != null)
+          viewHost.Content = treeModel.CreateSymbolicRegressionSolution(Content.ProblemData);
+        else {
+          var regModel = model as IRegressionModel;
+          viewHost.Content = regModel;
+        }
+      }
+    }
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.Designer.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.Designer.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.Designer.cs	(revision 15127)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
+  partial class GradientBoostedTreesSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+    }
+
+    #endregion
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.cs	(revision 15127)
@@ -0,0 +1,43 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
+  [Content(typeof(GradientBoostedTreesSolution), true)]
+  [View("GradientBoostedTreesSolution View")]
+  public partial class GradientBoostedTreesSolutionView : RegressionSolutionView {
+    public GradientBoostedTreesSolutionView() {
+      InitializeComponent();
+    }
+
+    protected new GradientBoostedTreesSolution Content {
+      get { return (GradientBoostedTreesSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      itemsListView.Items.Remove(itemsListView.FindItemWithText("Model: Gradient boosted tree model"));
+    }
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj	(revision 15127)
@@ -125,4 +125,28 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="RandomForestClassificationSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RandomForestClassificationSolutionView.Designer.cs">
+      <DependentUpon>RandomForestClassificationSolutionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RandomForestModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RandomForestModelView.Designer.cs">
+      <DependentUpon>RandomForestModelView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RandomForestRegressionSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RandomForestRegressionSolutionView.Designer.cs">
+      <DependentUpon>RandomForestRegressionSolutionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="GradientBoostedTreesModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="GradientBoostedTreesModelView.Designer.cs">
+      <DependentUpon>GradientBoostedTreesModelView.cs</DependentUpon>
+    </Compile>
     <Compile Include="MeanProdView.cs">
       <SubType>UserControl</SubType>
@@ -192,4 +216,10 @@
     <Compile Include="SupportVectorMachineModelView.Designer.cs">
       <DependentUpon>SupportVectorMachineModelView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="GradientBoostedTreesSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="GradientBoostedTreesSolutionView.Designer.cs">
+      <DependentUpon>GradientBoostedTreesSolutionView.cs</DependentUpon>
     </Compile>
   </ItemGroup>
@@ -245,4 +275,8 @@
       <Private>False</Private>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">
       <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
@@ -269,4 +303,20 @@
       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
       <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj">
+      <Project>{05BAE4E1-A9FA-4644-AA77-42558720159E}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj">
+      <Project>{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj">
+      <Project>{7a2531ce-3f7c-4f13-bcca-ed6dc27a7086}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
+      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Views\3.4\HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj">
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/KMeansClusteringModelView.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/KMeansClusteringModelView.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/KMeansClusteringModelView.cs	(revision 15127)
@@ -19,8 +19,5 @@
  */
 #endregion
-using System;
 using System.Linq;
-using System.IO;
-using System.Windows.Forms;
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/Plugin.cs.frame
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/Plugin.cs.frame	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/Plugin.cs.frame	(revision 15127)
@@ -37,4 +37,5 @@
   [PluginDependency("HeuristicLab.Data", "3.3")]
   [PluginDependency("HeuristicLab.Data.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
   [PluginDependency("HeuristicLab.LibSVM", "3.12")]
   [PluginDependency("HeuristicLab.MainForm", "3.3")]
@@ -44,4 +45,7 @@
   [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
   [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification", "3.4")]
   public class HeuristicLabAlgorithmsDataAnalysisViewsPlugin : PluginBase {
   }
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestClassificationSolutionView.Designer.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestClassificationSolutionView.Designer.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestClassificationSolutionView.Designer.cs	(revision 15127)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
+  partial class RandomForestClassificationSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+    }
+
+    #endregion
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestClassificationSolutionView.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestClassificationSolutionView.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestClassificationSolutionView.cs	(revision 15127)
@@ -0,0 +1,43 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
+  [Content(typeof(RandomForestClassificationSolution), true)]
+  [View("RandomForestClassificationSolution View")]
+  public partial class RandomForestClassificationSolutionView : ClassificationSolutionView {
+    public RandomForestClassificationSolutionView() {
+      InitializeComponent();
+    }
+
+    protected new RandomForestClassificationSolution Content {
+      get { return (RandomForestClassificationSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      itemsListView.Items.Remove(itemsListView.FindItemWithText("Model: RandomForestModel"));
+    }
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestModelView.Designer.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestModelView.Designer.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestModelView.Designer.cs	(revision 15127)
@@ -0,0 +1,103 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
+  partial class RandomForestModelView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.listBox = new System.Windows.Forms.ListBox();
+      this.SuspendLayout();
+      // 
+      // viewHost
+      // 
+      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.viewHost.Caption = "View";
+      this.viewHost.Content = null;
+      this.viewHost.Enabled = false;
+      this.viewHost.Location = new System.Drawing.Point(126, 3);
+      this.viewHost.Name = "viewHost";
+      this.viewHost.ReadOnly = false;
+      this.viewHost.Size = new System.Drawing.Size(220, 277);
+      this.viewHost.TabIndex = 0;
+      this.viewHost.ViewsLabelVisible = true;
+      this.viewHost.ViewType = null;
+      // 
+      // listBox
+      // 
+      this.listBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+      this.listBox.FormatString = "Tree {0}";
+      this.listBox.Items.AddRange(new object[] {
+            "1",
+            "2",
+            "3"});
+      this.listBox.Location = new System.Drawing.Point(3, 3);
+      this.listBox.Name = "listBox";
+      this.listBox.Size = new System.Drawing.Size(117, 277);
+      this.listBox.TabIndex = 1;
+      this.listBox.SelectedIndexChanged += new System.EventHandler(this.listBox_SelectedIndexChanged);
+      // 
+      // RandomForestModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.viewHost);
+      this.Controls.Add(this.listBox);
+      this.Name = "RandomForestModelView";
+      this.Size = new System.Drawing.Size(349, 289);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private MainForm.WindowsForms.ViewHost viewHost;
+    private System.Windows.Forms.ListBox listBox;
+
+
+
+
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestModelView.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestModelView.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestModelView.cs	(revision 15127)
@@ -0,0 +1,91 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Drawing;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Classification;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
+  [View("Random forest model")]
+  [Content(typeof(IRandomForestRegressionSolution), false)]
+  [Content(typeof(IRandomForestClassificationSolution), false)]
+  public partial class RandomForestModelView : DataAnalysisSolutionEvaluationView {
+    public override Image ViewImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      listBox.Enabled = Content != null;
+      viewHost.Enabled = Content != null;
+    }
+
+    public RandomForestModelView()
+      : base() {
+      InitializeComponent();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        viewHost.Content = null;
+        listBox.Items.Clear();
+      } else {
+        viewHost.Content = null;
+        listBox.Items.Clear();
+        var classSol = Content as IRandomForestClassificationSolution;
+        var regSol = Content as IRandomForestRegressionSolution;
+        var numTrees = classSol != null ? classSol.NumberOfTrees : regSol != null ? regSol.NumberOfTrees : 0;
+        for (int i = 0; i < numTrees; i++) {
+          listBox.Items.Add(i + 1);
+        }
+      }
+    }
+
+    private void listBox_SelectedIndexChanged(object sender, System.EventArgs e) {
+      if (listBox.SelectedItem == null) viewHost.Content = null;
+      else {
+        var idx = (int)listBox.SelectedItem;
+        idx -= 1;
+        var rfModel = Content.Model as RandomForestModel;
+        var regProblemData = Content.ProblemData as IRegressionProblemData;
+        var classProblemData = Content.ProblemData as IClassificationProblemData;
+        if (rfModel != null) {
+          if (idx < 0 || idx >= rfModel.NumberOfTrees) return;
+          if (regProblemData != null) {
+            var syModel = new SymbolicRegressionModel(regProblemData.TargetVariable, rfModel.ExtractTree(idx),
+              new SymbolicDataAnalysisExpressionTreeLinearInterpreter());
+            viewHost.Content = syModel.CreateRegressionSolution(regProblemData);
+          } else if (classProblemData != null) {
+            var syModel = new SymbolicDiscriminantFunctionClassificationModel(classProblemData.TargetVariable, rfModel.ExtractTree(idx),
+              new SymbolicDataAnalysisExpressionTreeLinearInterpreter(), new NormalDistributionCutPointsThresholdCalculator());
+            syModel.RecalculateModelParameters(classProblemData, classProblemData.TrainingIndices);
+            viewHost.Content = syModel.CreateClassificationSolution(classProblemData);
+          }
+        }
+      }
+    }
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestRegressionSolutionView.Designer.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestRegressionSolutionView.Designer.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestRegressionSolutionView.Designer.cs	(revision 15127)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
+  partial class RandomForestRegressionSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+    }
+
+    #endregion
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestRegressionSolutionView.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestRegressionSolutionView.cs	(revision 15127)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/RandomForestRegressionSolutionView.cs	(revision 15127)
@@ -0,0 +1,43 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
+  [Content(typeof(RandomForestRegressionSolution), true)]
+  [View("RandomForestRegressionSolution View")]
+  public partial class RandomForestRegressionSolutionView : RegressionSolutionView {
+    public RandomForestRegressionSolutionView() {
+      InitializeComponent();
+    }
+
+    protected new RandomForestRegressionSolution Content {
+      get { return (RandomForestRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      itemsListView.Items.Remove(itemsListView.FindItemWithText("Model: RandomForestModel"));
+    }
+  }
+}
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs	(revision 15127)
@@ -270,5 +270,5 @@
         } else {
           // otherwise we produce a regression solution
-          Results.Add(new Result("Solution", new RegressionSolution(model, problemData)));
+          Results.Add(new Result("Solution", new GradientBoostedTreesSolution(model, problemData)));
         }
       }
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesSolution.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesSolution.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesSolution.cs	(revision 15127)
@@ -20,6 +20,4 @@
 #endregion
 
-using System.Collections.Generic;
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs	(revision 15127)
@@ -28,6 +28,9 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
@@ -210,4 +213,43 @@
     }
 
+    /// <summary>
+    /// Transforms the tree model to a symbolic regression solution
+    /// </summary>
+    /// <param name="problemData"></param>
+    /// <returns>A new symbolic regression solution which matches the tree model</returns>
+    public ISymbolicRegressionSolution CreateSymbolicRegressionSolution(IRegressionProblemData problemData) {
+      var rootSy = new ProgramRootSymbol();
+      var startSy = new StartSymbol();
+      var varCondSy = new VariableCondition() { IgnoreSlope = true };
+      var constSy = new Constant();
+
+      var startNode = startSy.CreateTreeNode();
+      startNode.AddSubtree(CreateSymbolicRegressionTreeRecursive(tree, 0, varCondSy, constSy));
+      var rootNode = rootSy.CreateTreeNode();
+      rootNode.AddSubtree(startNode);
+      var model = new SymbolicRegressionModel(TargetVariable, new SymbolicExpressionTree(rootNode), new SymbolicDataAnalysisExpressionTreeLinearInterpreter());
+      return model.CreateRegressionSolution(problemData);
+    }
+
+    private ISymbolicExpressionTreeNode CreateSymbolicRegressionTreeRecursive(TreeNode[] treeNodes, int nodeIdx, VariableCondition varCondSy, Constant constSy) {
+      var curNode = treeNodes[nodeIdx];
+      if (curNode.VarName == TreeNode.NO_VARIABLE) {
+        var node = (ConstantTreeNode)constSy.CreateTreeNode();
+        node.Value = curNode.Val;
+        return node;
+      } else {
+        var node = (VariableConditionTreeNode)varCondSy.CreateTreeNode();
+        node.VariableName = curNode.VarName;
+        node.Threshold = curNode.Val;
+
+        var left = CreateSymbolicRegressionTreeRecursive(treeNodes, curNode.LeftIdx, varCondSy, constSy);
+        var right = CreateSymbolicRegressionTreeRecursive(treeNodes, curNode.RightIdx, varCondSy, constSy);
+        node.AddSubtree(left);
+        node.AddSubtree(right);
+        return node;
+      }
+    }
+
+
     private string TreeToString(int idx, string part) {
       var n = tree[idx];
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestClassificationSolution.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestClassificationSolution.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestClassificationSolution.cs	(revision 15127)
@@ -30,4 +30,5 @@
   public interface IRandomForestClassificationSolution : IClassificationSolution {
     new IRandomForestModel Model { get; }
+    int NumberOfTrees { get; }
   }
 }
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestModel.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestModel.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestModel.cs	(revision 15127)
@@ -20,8 +20,7 @@
 #endregion
 
-using HeuristicLab.Optimization;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Problems.DataAnalysis;
-using HeuristicLab.Core;
-using System.Collections.Generic;
+
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
@@ -30,4 +29,6 @@
   /// </summary>
   public interface IRandomForestModel : IConfidenceRegressionModel, IClassificationModel {
+    int NumberOfTrees { get; }
+    ISymbolicExpressionTree ExtractTree(int treeIdx); // returns a specific tree from the random forest as a ISymbolicRegressionModel
   }
 }
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestRegressionSolution.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestRegressionSolution.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestRegressionSolution.cs	(revision 15127)
@@ -20,7 +20,6 @@
 #endregion
 
-using HeuristicLab.Optimization;
 using HeuristicLab.Problems.DataAnalysis;
-using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
@@ -30,4 +29,5 @@
   public interface IRandomForestRegressionSolution : IConfidenceRegressionSolution {
     new IRandomForestModel Model { get; }
+    int NumberOfTrees { get; }
   }
 }
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassificationSolution.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassificationSolution.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassificationSolution.cs	(revision 15127)
@@ -38,4 +38,8 @@
     }
 
+    public int NumberOfTrees {
+      get { return Model.NumberOfTrees; }
+    }
+
     [StorableConstructor]
     private RandomForestClassificationSolution(bool deserializing) : base(deserializing) { }
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs	(revision 15127)
@@ -25,6 +25,8 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
@@ -49,4 +51,7 @@
     }
 
+    public int NumberOfTrees {
+      get { return nTrees; }
+    }
 
     // instead of storing the data of the model itself
@@ -64,5 +69,4 @@
     [Storable]
     private double m;
-
 
     [StorableConstructor]
@@ -197,4 +201,81 @@
     }
 
+    public ISymbolicExpressionTree ExtractTree(int treeIdx) {
+      var rf = RandomForest;
+      // hoping that the internal representation of alglib is stable
+
+      // TREE FORMAT
+      // W[Offs]      -   size of sub-array (for the tree)
+      //     node info:
+      // W[K+0]       -   variable number        (-1 for leaf mode)
+      // W[K+1]       -   threshold              (class/value for leaf node)
+      // W[K+2]       -   ">=" branch index      (absent for leaf node)
+
+      // skip irrelevant trees
+      int offset = 0;
+      for (int i = 0; i < treeIdx - 1; i++) {
+        offset = offset + (int)Math.Round(rf.innerobj.trees[offset]);
+      }
+
+      var constSy = new Constant();
+      var varCondSy = new VariableCondition() { IgnoreSlope = true };
+
+      var node = CreateRegressionTreeRec(rf.innerobj.trees, offset, offset + 1, constSy, varCondSy);
+
+      var startNode = new StartSymbol().CreateTreeNode();
+      startNode.AddSubtree(node);
+      var root = new ProgramRootSymbol().CreateTreeNode();
+      root.AddSubtree(startNode);
+      return new SymbolicExpressionTree(root);
+    }
+
+    private ISymbolicExpressionTreeNode CreateRegressionTreeRec(double[] trees, int offset, int k, Constant constSy, VariableCondition varCondSy) {
+
+      // alglib source for evaluation of one tree (dfprocessinternal)
+      // offs = 0
+      //
+      // Set pointer to the root
+      //
+      // k = offs + 1;
+      // 
+      // //
+      // // Navigate through the tree
+      // //
+      // while (true) {
+      //   if ((double)(df.trees[k]) == (double)(-1)) {
+      //     if (df.nclasses == 1) {
+      //       y[0] = y[0] + df.trees[k + 1];
+      //     } else {
+      //       idx = (int)Math.Round(df.trees[k + 1]);
+      //       y[idx] = y[idx] + 1;
+      //     }
+      //     break;
+      //   }
+      //   if ((double)(x[(int)Math.Round(df.trees[k])]) < (double)(df.trees[k + 1])) {
+      //     k = k + innernodewidth;
+      //   } else {
+      //     k = offs + (int)Math.Round(df.trees[k + 2]);
+      //   }
+      // }
+
+      if ((double)(trees[k]) == (double)(-1)) {
+        var constNode = (ConstantTreeNode)constSy.CreateTreeNode();
+        constNode.Value = trees[k + 1];
+        return constNode;
+      } else {
+        var condNode = (VariableConditionTreeNode)varCondSy.CreateTreeNode();
+        condNode.VariableName = AllowedInputVariables[(int)Math.Round(trees[k])];
+        condNode.Threshold = trees[k + 1];
+        condNode.Slope = double.PositiveInfinity;
+
+        var left = CreateRegressionTreeRec(trees, offset, k + 3, constSy, varCondSy);
+        var right = CreateRegressionTreeRec(trees, offset, offset + (int)Math.Round(trees[k + 2]), constSy, varCondSy);
+
+        condNode.AddSubtree(left); // not 100% correct because interpreter uses: if(x <= thres) left() else right() and RF uses if(x < thres) left() else right() (see above)
+        condNode.AddSubtree(right);
+        return condNode;
+      }
+    }
+
 
     public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
Index: /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegressionSolution.cs
===================================================================
--- /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegressionSolution.cs	(revision 15126)
+++ /stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegressionSolution.cs	(revision 15127)
@@ -20,8 +20,10 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
@@ -36,4 +38,8 @@
       get { return (IRandomForestModel)base.Model; }
       set { base.Model = value; }
+    }
+
+    public int NumberOfTrees {
+      get { return Model.NumberOfTrees; }
     }
 
Index: /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs
===================================================================
--- /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 15126)
+++ /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 15127)
@@ -614,4 +614,5 @@
         case OpCodes.VariableCondition: {
             var variableConditionTreeNode = (VariableConditionTreeNode)node;
+            if (variableConditionTreeNode.Symbol.IgnoreSlope) throw new NotSupportedException("Strict variable conditionals are not supported");
             var variableName = variableConditionTreeNode.VariableName;
             var indexExpr = Expression.Constant(variableIndices[variableName]);
Index: /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 15126)
+++ /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 15127)
@@ -471,12 +471,25 @@
             if (row < 0 || row >= dataset.Rows) return double.NaN;
             var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode;
-            double variableValue = ((IList<double>)currentInstr.data)[row];
-            double x = variableValue - variableConditionTreeNode.Threshold;
-            double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
-
-            double trueBranch = Evaluate(dataset, ref row, state);
-            double falseBranch = Evaluate(dataset, ref row, state);
-
-            return trueBranch * p + falseBranch * (1 - p);
+            if (!variableConditionTreeNode.Symbol.IgnoreSlope) {
+              double variableValue = ((IList<double>)currentInstr.data)[row];
+              double x = variableValue - variableConditionTreeNode.Threshold;
+              double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
+
+              double trueBranch = Evaluate(dataset, ref row, state);
+              double falseBranch = Evaluate(dataset, ref row, state);
+
+              return trueBranch * p + falseBranch * (1 - p);
+            } else {
+              // strict threshold
+              double variableValue = ((IList<double>)currentInstr.data)[row];
+              if (variableValue <= variableConditionTreeNode.Threshold) {
+                var left = Evaluate(dataset, ref row, state);
+                state.SkipInstructions();
+                return left;
+              } else {
+                state.SkipInstructions();
+                return Evaluate(dataset, ref row, state);
+              }
+            }
           }
         default:
Index: /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
===================================================================
--- /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs	(revision 15126)
+++ /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs	(revision 15127)
@@ -126,4 +126,5 @@
     private readonly object syncRoot = new object();
     public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
+      if (!rows.Any()) return Enumerable.Empty<double>();
       if (CheckExpressionsWithIntervalArithmetic)
         throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
@@ -159,12 +160,21 @@
           if (row < 0 || row >= dataset.Rows) instr.value = double.NaN;
           var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
-          double variableValue = ((IList<double>)instr.data)[row];
-          double x = variableValue - variableConditionTreeNode.Threshold;
-          double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
-
-          double trueBranch = code[instr.childIndex].value;
-          double falseBranch = code[instr.childIndex + 1].value;
-
-          instr.value = trueBranch * p + falseBranch * (1 - p);
+          if (!variableConditionTreeNode.Symbol.IgnoreSlope) {
+            double variableValue = ((IList<double>)instr.data)[row];
+            double x = variableValue - variableConditionTreeNode.Threshold;
+            double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
+
+            double trueBranch = code[instr.childIndex].value;
+            double falseBranch = code[instr.childIndex + 1].value;
+
+            instr.value = trueBranch * p + falseBranch * (1 - p);
+          } else {
+            double variableValue = ((IList<double>)instr.data)[row];
+            if (variableValue <= variableConditionTreeNode.Threshold) {
+              instr.value = code[instr.childIndex].value;
+            } else {
+              instr.value = code[instr.childIndex + 1].value;
+            }
+          }
         } else if (instr.opCode == OpCodes.Add) {
           double s = code[instr.childIndex].value;
@@ -411,6 +421,6 @@
               for (int j = 1; j != seq.Length; ++j)
                 seq[j].skip = true;
-            }
-            break;
+              break;
+            }
         }
         #endregion
Index: /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs
===================================================================
--- /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs	(revision 15126)
+++ /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs	(revision 15127)
@@ -149,4 +149,14 @@
         }
       }
+    }
+
+    /// <summary>
+    /// Flag to indicate if the interpreter should ignore the slope parameter (introduced for representation of expression trees)
+    /// </summary>
+    [Storable]
+    private bool ignoreSlope;
+    public bool IgnoreSlope {
+      get { return ignoreSlope; }
+      set { ignoreSlope = value; }
     }
 
Index: /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs
===================================================================
--- /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs	(revision 15126)
+++ /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs	(revision 15127)
@@ -96,9 +96,10 @@
 
     public override string ToString() {
-      if (slope.IsAlmost(0.0))
+      if (slope.IsAlmost(0.0) || Symbol.IgnoreSlope) {
+        return variableName + " < " + threshold.ToString("E4");
+      } else {
         return variableName + " > " + threshold.ToString("E4") + Environment.NewLine +
-          "slope: " + slope.ToString("E4");
-      else
-        return variableName + " > " + threshold.ToString("E4");
+               "slope: " + slope.ToString("E4");
+      }
     }
   }
