Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelEvaluationView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelEvaluationView.Designer.cs (revision 15105)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelEvaluationView.Designer.cs (revision 15105)
@@ -0,0 +1,99 @@
+#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 .
+ */
+#endregion
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
+ partial class GradientBoostedTreesModelEvaluationView {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ 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);
+ this.listBox.DoubleClick += new System.EventHandler(this.listBox_DoubleClick);
+ //
+ // GradientBoostedTreesModelEvaluationView
+ //
+ this.AllowDrop = true;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ this.Controls.Add(this.viewHost);
+ this.Controls.Add(this.listBox);
+ this.Name = "GradientBoostedTreesModelEvaluationView";
+ this.Size = new System.Drawing.Size(349, 289);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private MainForm.WindowsForms.ViewHost viewHost;
+ private System.Windows.Forms.ListBox listBox;
+
+
+
+
+ }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelEvaluationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelEvaluationView.cs (revision 15105)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelEvaluationView.cs (revision 15105)
@@ -0,0 +1,87 @@
+#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 .
+ */
+#endregion
+
+using System.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
+ [View("GBT Model Evaluation")]
+ [Content(typeof(GradientBoostedTreesSolution), false)]
+ public partial class GradientBoostedTreesModelEvaluationView : DataAnalysisSolutionEvaluationView {
+ 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 GradientBoostedTreesModelEvaluationView()
+ : 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 {
+ viewHost.Content = ConvertModel(model);
+ }
+ }
+
+ private void listBox_DoubleClick(object sender, System.EventArgs e) {
+ var selectedItem = listBox.SelectedItem;
+ if (selectedItem == null) return;
+ MainFormManager.MainForm.ShowContent(ConvertModel(selectedItem));
+ }
+
+ private IContent ConvertModel(object model) {
+ var treeModel = model as RegressionTreeModel;
+ if (treeModel != null)
+ return treeModel.CreateSymbolicRegressionSolution(Content.ProblemData);
+ else {
+ var regModel = model as IRegressionModel;
+ return regModel;
+ }
+ }
+ }
+}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.Designer.cs (revision 15104)
+++ (revision )
@@ -1,99 +1,0 @@
-#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 .
- */
-#endregion
-
-namespace HeuristicLab.Algorithms.DataAnalysis.Views {
- partial class GradientBoostedTreesModelView {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing) {
- if (disposing && (components != null)) {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- 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);
- this.listBox.DoubleClick += new System.EventHandler(this.listBox_DoubleClick);
- //
- // 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: unk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesModelView.cs (revision 15104)
+++ (revision )
@@ -1,91 +1,0 @@
-#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 .
- */
-#endregion
-
-using System.Drawing;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-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 {
- viewHost.Content = ConvertModel(model);
- }
- }
-
- private void listBox_DoubleClick(object sender, System.EventArgs e) {
- var selectedItem = listBox.SelectedItem;
- if (selectedItem == null) return;
- MainFormManager.MainForm.ShowContent(ConvertModel(selectedItem));
- }
-
- private IContent ConvertModel(object model) {
- var treeModel = model as RegressionTreeModel;
- if (treeModel != null)
- return treeModel.CreateSymbolicRegressionSolution(Content.ProblemData);
- else {
- var regModel = model as IRegressionModel;
- return regModel;
- }
- }
- }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.Designer.cs (revision 15104)
+++ (revision )
@@ -1,53 +1,0 @@
-#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 .
- */
-#endregion
-
-namespace HeuristicLab.Algorithms.DataAnalysis.Views {
- partial class GradientBoostedTreesSolutionView {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing) {
- if (disposing && (components != null)) {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent() {
- components = new System.ComponentModel.Container();
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
- }
-
- #endregion
- }
-}
Index: unk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GradientBoostedTreesSolutionView.cs (revision 15104)
+++ (revision )
@@ -1,43 +1,0 @@
-#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 .
- */
-#endregion
-
-using HeuristicLab.MainForm;
-using HeuristicLab.Problems.DataAnalysis.Views;
-
-namespace HeuristicLab.Algorithms.DataAnalysis.Views {
- [Content(typeof(GradientBoostedTreesSolution), false)]
- [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: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj (revision 15104)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj (revision 15105)
@@ -125,4 +125,16 @@
+
+ UserControl
+
+
+ GradientBoostedTreesModelEvaluationView.cs
+
+
+ UserControl
+
+
+ GradientBoostedTreesModelView.cs
+
UserControl
@@ -149,10 +161,4 @@
RandomForestRegressionSolutionView.cs
-
- UserControl
-
-
- GradientBoostedTreesModelView.cs
-
UserControl
@@ -222,10 +228,4 @@
SupportVectorMachineModelView.cs
-
-
- UserControl
-
-
- GradientBoostedTreesSolutionView.cs
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs (revision 15104)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs (revision 15105)
@@ -31,5 +31,5 @@
namespace HeuristicLab.Algorithms.DataAnalysis {
[StorableClass]
- [Item("Gradient boosted tree model", "")]
+ [Item("Gradient boosted trees model", "")]
// this is essentially a collection of weighted regression models
public sealed class GradientBoostedTreesModel : RegressionModel, IGradientBoostedTreesModel {
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs (revision 15104)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs (revision 15105)
@@ -219,4 +219,12 @@
/// A new symbolic regression solution which matches the tree model
public ISymbolicRegressionSolution CreateSymbolicRegressionSolution(IRegressionProblemData problemData) {
+ return CreateSymbolicRegressionModel().CreateRegressionSolution(problemData);
+ }
+
+ ///
+ /// Transforms the tree model to a symbolic regression model
+ ///
+ /// A new symbolic regression model which matches the tree model
+ public SymbolicRegressionModel CreateSymbolicRegressionModel() {
var rootSy = new ProgramRootSymbol();
var startSy = new StartSymbol();
@@ -228,6 +236,5 @@
var rootNode = rootSy.CreateTreeNode();
rootNode.AddSubtree(startNode);
- var model = new SymbolicRegressionModel(TargetVariable, new SymbolicExpressionTree(rootNode), new SymbolicDataAnalysisExpressionTreeLinearInterpreter());
- return model.CreateRegressionSolution(problemData);
+ return new SymbolicRegressionModel(TargetVariable, new SymbolicExpressionTree(rootNode), new SymbolicDataAnalysisExpressionTreeLinearInterpreter());
}