Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11144


Ignore:
Timestamp:
07/08/14 19:03:36 (10 years ago)
Author:
mkommend
Message:

#1758: Merged r10173:10176 and r10540, r10541, r10543, r10545 and r11031 into stable.

Location:
stable
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.csproj

    r8636 r11144  
    152152      <Private>False</Private>
    153153    </ProjectReference>
     154    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
     155      <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project>
     156      <Name>HeuristicLab.Common.Resources-3.3</Name>
     157      <Private>False</Private>
     158    </ProjectReference>
    154159    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    155160      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/Plugin.cs.frame

    r10032 r11144  
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Common", "3.3")]
     31  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3132  [PluginDependency("HeuristicLab.Core", "3.3")]
    3233  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.Designer.cs

    r9999 r11144  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.exportButton = new System.Windows.Forms.Button();
     48      this.exportFileDialog = new System.Windows.Forms.SaveFileDialog();
    4749      this.btnSimplify = new System.Windows.Forms.Button();
    4850      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
     
    5355      this.detailsGroupBox.SuspendLayout();
    5456      this.SuspendLayout();
    55       exportButton.Visible = false;
    5657      //
    57       // splitContainer
     58      // flowLayoutPanel
    5859      //
    59       //
    60       // splitContainer.Panel1
    61       //
    62       this.splitContainer.Panel1.Controls.Add(this.btnSimplify);
     60      this.flowLayoutPanel.Controls.Add(this.btnSimplify);
     61      this.flowLayoutPanel.Controls.Add(this.exportButton);
    6362      //
    6463      // btnSimplify
    6564      //
    66       this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    67       this.btnSimplify.Location = new System.Drawing.Point(172, 4);
     65      this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
     66      this.btnSimplify.Image = HeuristicLab.Common.Resources.VSImageLibrary.FormulaEvaluator;
     67      this.btnSimplify.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    6868      this.btnSimplify.Name = "btnSimplify";
    69       this.btnSimplify.Size = new System.Drawing.Size(75, 23);
    70       this.btnSimplify.TabIndex = 6;
    71       this.btnSimplify.Text = "Simplify";
     69      this.btnSimplify.Size = new System.Drawing.Size(105, 24);
     70      this.btnSimplify.TabIndex = 7;
     71      this.btnSimplify.Text = "Simplify Model";
     72      this.btnSimplify.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
    7273      this.btnSimplify.UseVisualStyleBackColor = true;
    7374      this.btnSimplify.Click += new System.EventHandler(this.btn_SimplifyModel_Click);
     75      this.toolTip.SetToolTip(this.btnSimplify, "Simplify solution");
    7476      //
    75       // SymbolicDiscriminantFunctionClassificationSolutionView
     77      // exportButton
     78      //
     79      this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
     80      this.exportButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Statistics;
     81      this.exportButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     82      this.exportButton.Name = "exportButton";
     83      this.exportButton.Size = new System.Drawing.Size(105, 24);
     84      this.exportButton.TabIndex = 8;
     85      this.exportButton.Text = "Export to Excel ";
     86      this.exportButton.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     87      this.exportButton.UseVisualStyleBackColor = true;
     88      this.exportButton.Click += new System.EventHandler(this.exportButton_Click);
     89      this.toolTip.SetToolTip(this.exportButton, "Exports the symbolic regression solution to Excel.");
     90      //
     91      // SymbolicClassificationSolutionView
    7692      //
    7793      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    88104    #endregion
    89105
     106    protected System.Windows.Forms.SaveFileDialog exportFileDialog;
     107    protected System.Windows.Forms.Button exportButton;
    90108    protected System.Windows.Forms.Button btnSimplify;
    91109  }
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.cs

    r9456 r11144  
    2121
    2222using System;
     23using System.ComponentModel;
    2324using System.Windows.Forms;
    2425using HeuristicLab.MainForm;
     26using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
    2527using HeuristicLab.Problems.DataAnalysis.Views;
    2628
     
    3840    }
    3941
     42    protected override void SetEnabledStateOfControls() {
     43      base.SetEnabledStateOfControls();
     44      btnSimplify.Enabled = Content != null && !Locked;
     45      exportButton.Enabled = Content != null && !Locked;
     46    }
     47
    4048    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
    4149      var view = new InteractiveSymbolicClassificationSolutionSimplifierView();
     
    4351      view.Show();
    4452    }
     53
     54    private void exportButton_Click(object sender, EventArgs e) {
     55      var exporter = new SymbolicSolutionExcelExporter();
     56      exportFileDialog.Filter = exporter.FileTypeFilter;
     57      if (exportFileDialog.ShowDialog(this) == DialogResult.OK) {
     58
     59        var name = exportFileDialog.FileName;
     60        using (BackgroundWorker bg = new BackgroundWorker()) {
     61          MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exportion solution to " + name + ".");
     62          bg.DoWork += (o, a) => exporter.Export(Content, name);
     63          bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     64          bg.RunWorkerAsync();
     65        }
     66      }
     67    }
    4568  }
    4669}
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.Designer.cs

    r9999 r11144  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SymbolicDiscriminantFunctionClassificationSolutionView));
     47      this.exportButton = new System.Windows.Forms.Button();
     48      this.exportFileDialog = new System.Windows.Forms.SaveFileDialog();
    4849      this.btnSimplify = new System.Windows.Forms.Button();
    4950      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
     
    5455      this.detailsGroupBox.SuspendLayout();
    5556      this.SuspendLayout();
    56       exportButton.Visible = false;
    5757      //
    58       // splitContainer
     58      // flowLayoutPanel
    5959      //
    60       //
    61       // splitContainer.Panel1
    62       //
    63       this.splitContainer.Panel1.Controls.Add(this.btnSimplify);
     60      this.flowLayoutPanel.Controls.Add(this.btnSimplify);
     61      this.flowLayoutPanel.Controls.Add(this.exportButton);
    6462      //
    6563      // btnSimplify
    6664      //
    67       this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    68       this.btnSimplify.Location = new System.Drawing.Point(172, 4);
     65      this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
     66      this.btnSimplify.Image = HeuristicLab.Common.Resources.VSImageLibrary.FormulaEvaluator;
     67      this.btnSimplify.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    6968      this.btnSimplify.Name = "btnSimplify";
    70       this.btnSimplify.Size = new System.Drawing.Size(75, 23);
    71       this.btnSimplify.TabIndex = 6;
    72       this.btnSimplify.Text = "Simplify";
     69      this.btnSimplify.Size = new System.Drawing.Size(105, 24);
     70      this.btnSimplify.TabIndex = 7;
     71      this.btnSimplify.Text = "Simplify Model";
     72      this.btnSimplify.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
    7373      this.btnSimplify.UseVisualStyleBackColor = true;
    7474      this.btnSimplify.Click += new System.EventHandler(this.btn_SimplifyModel_Click);
     75      this.toolTip.SetToolTip(this.btnSimplify, "Simplify solution");
     76      //
     77      // exportButton
     78      //
     79      this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
     80      this.exportButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Statistics;
     81      this.exportButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     82      this.exportButton.Name = "exportButton";
     83      this.exportButton.Size = new System.Drawing.Size(105, 24);
     84      this.exportButton.TabIndex = 8;
     85      this.exportButton.Text = "Export to Excel ";
     86      this.exportButton.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     87      this.exportButton.UseVisualStyleBackColor = true;
     88      this.exportButton.Click += new System.EventHandler(this.exportButton_Click);
     89      this.toolTip.SetToolTip(this.exportButton, "Exports the symbolic regression solution to Excel.");
    7590      //
    7691      // SymbolicDiscriminantFunctionClassificationSolutionView
     
    89104    #endregion
    90105
     106    protected System.Windows.Forms.SaveFileDialog exportFileDialog;
     107    protected System.Windows.Forms.Button exportButton;
    91108    protected System.Windows.Forms.Button btnSimplify;
    92109  }
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.cs

    r9456 r11144  
    2121
    2222using System;
     23using System.ComponentModel;
    2324using System.Windows.Forms;
    2425using HeuristicLab.MainForm;
     26using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
    2527using HeuristicLab.Problems.DataAnalysis.Views;
    2628
     
    3840    }
    3941
     42    protected override void SetEnabledStateOfControls() {
     43      base.SetEnabledStateOfControls();
     44      btnSimplify.Enabled = Content != null && !Locked;
     45      exportButton.Enabled = Content != null && !Locked;
     46    }
     47
    4048    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
    4149      var view = new InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView();
     
    4351      view.Show();
    4452    }
     53
     54    private void exportButton_Click(object sender, EventArgs e) {
     55      var exporter = new SymbolicSolutionExcelExporter();
     56      exportFileDialog.Filter = exporter.FileTypeFilter;
     57      if (exportFileDialog.ShowDialog(this) == DialogResult.OK) {
     58
     59        var name = exportFileDialog.FileName;
     60        using (BackgroundWorker bg = new BackgroundWorker()) {
     61          MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exportion solution to " + name + ".");
     62          bg.DoWork += (o, a) => exporter.Export(Content, name);
     63          bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     64          bg.RunWorkerAsync();
     65        }
     66      }
     67    }
    4568  }
    4669}
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj

    r8600 r11144  
    157157      <Private>False</Private>
    158158    </ProjectReference>
     159    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
     160      <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project>
     161      <Name>HeuristicLab.Common.Resources-3.3</Name>
     162      <Private>False</Private>
     163    </ProjectReference>
    159164    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    160165      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
     
    284289  -->
    285290  <PropertyGroup>
    286    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     291    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    287292set ProjectDir=$(ProjectDir)
    288293set SolutionDir=$(SolutionDir)
     
    291296call PreBuildEvent.cmd
    292297</PreBuildEvent>
    293 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     298    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    294299export ProjectDir=$(ProjectDir)
    295300export SolutionDir=$(SolutionDir)
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Plugin.cs.frame

    r10032 r11144  
    3131  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3232  [PluginDependency("HeuristicLab.Common", "3.3")]
     33  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3334  [PluginDependency("HeuristicLab.Core", "3.3")]
    3435  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.Designer.cs

    r9999 r11144  
    1919 */
    2020#endregion
     21
    2122
    2223namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
     
    4546    /// </summary>
    4647    private void InitializeComponent() {
     48      this.exportButton = new System.Windows.Forms.Button();
     49      this.exportFileDialog = new System.Windows.Forms.SaveFileDialog();
    4750      this.btnSimplify = new System.Windows.Forms.Button();
    4851      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
     
    5457      this.SuspendLayout();
    5558      //
    56       // splitContainer
     59      // flowLayoutPanel
    5760      //
    58       //
    59       // splitContainer.Panel1
    60       //
    61       this.splitContainer.Panel1.Controls.Add(this.btnSimplify);
    62       //
    63       // addButton
    64       //
    65       this.toolTip.SetToolTip(this.addButton, "Add");
    66       //
    67       // removeButton
    68       //
    69       this.toolTip.SetToolTip(this.removeButton, "Remove");
     61      this.flowLayoutPanel.Controls.Add(this.btnSimplify);
     62      this.flowLayoutPanel.Controls.Add(this.exportButton);
    7063      //
    7164      // btnSimplify
    7265      //
    73       this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    74       this.btnSimplify.Location = new System.Drawing.Point(172, 4);
     66      this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
     67      this.btnSimplify.Image = HeuristicLab.Common.Resources.VSImageLibrary.FormulaEvaluator;
     68      this.btnSimplify.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    7569      this.btnSimplify.Name = "btnSimplify";
    76       this.btnSimplify.Size = new System.Drawing.Size(75, 23);
    77       this.btnSimplify.TabIndex = 6;
    78       this.btnSimplify.Text = "Simplify";
     70      this.btnSimplify.TabIndex = 7;
     71      this.btnSimplify.Size = new System.Drawing.Size(105, 24);
     72      this.btnSimplify.Text = "Simplify Model";
     73      this.btnSimplify.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
    7974      this.btnSimplify.UseVisualStyleBackColor = true;
    8075      this.btnSimplify.Click += new System.EventHandler(this.btn_SimplifyModel_Click);
     76      this.toolTip.SetToolTip(this.btnSimplify, "Simplify solution");
     77      //
     78      // exportButton
     79      //
     80      this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
     81      this.exportButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Statistics;
     82      this.exportButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     83      this.exportButton.Name = "exportButton";
     84      this.exportButton.Size = new System.Drawing.Size(105, 24);
     85      this.exportButton.TabIndex = 8;
     86      this.exportButton.Text = "Export to Excel ";
     87      this.exportButton.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     88      this.exportButton.UseVisualStyleBackColor = true;
     89      this.exportButton.Click += new System.EventHandler(this.exportButton_Click);
     90      this.toolTip.SetToolTip(this.exportButton, "Exports the symbolic regression solution to Excel.");
    8191      //
    8292      // SymbolicRegressionSolutionView
     
    95105
    96106    #endregion
    97     private System.Windows.Forms.Button btnSimplify;
     107    protected System.Windows.Forms.SaveFileDialog exportFileDialog;
     108    protected System.Windows.Forms.Button exportButton;
     109    protected System.Windows.Forms.Button btnSimplify;
    98110  }
    99111}
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs

    r10920 r11144  
    2121
    2222using System;
     23using System.ComponentModel;
    2324using System.Windows.Forms;
    2425using HeuristicLab.MainForm;
     26using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
    2527using HeuristicLab.Problems.DataAnalysis.Views;
    2628
     
    3840    }
    3941
     42    protected override void SetEnabledStateOfControls() {
     43      base.SetEnabledStateOfControls();
     44      btnSimplify.Enabled = Content != null && !Locked;
     45      exportButton.Enabled = Content != null && !Locked;
     46    }
     47
    4048    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
    4149      InteractiveSymbolicRegressionSolutionSimplifierView view = new InteractiveSymbolicRegressionSolutionSimplifierView();
     
    4351      view.Show();
    4452    }
     53
     54    private void exportButton_Click(object sender, EventArgs e) {
     55      var exporter = new SymbolicSolutionExcelExporter();
     56      exportFileDialog.Filter = exporter.FileTypeFilter;
     57      if (exportFileDialog.ShowDialog(this) == DialogResult.OK) {
     58
     59        var name = exportFileDialog.FileName;
     60        using (BackgroundWorker bg = new BackgroundWorker()) {
     61          MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exportion solution to " + name + ".");
     62          bg.DoWork += (o, a) => exporter.Export(Content, name);
     63          bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     64          bg.RunWorkerAsync();
     65        }
     66      }
     67    }
    4568  }
    4669}
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views-3.4.csproj

    r8799 r11144  
    151151      <Private>False</Private>
    152152    </ProjectReference>
     153    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
     154      <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project>
     155      <Name>HeuristicLab.Common.Resources-3.3</Name>
     156      <Private>False</Private>
     157    </ProjectReference>
    153158    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    154159      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/Plugin.cs.frame

    r10032 r11144  
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views-3.4.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Common", "3.3")]
     31  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3132  [PluginDependency("HeuristicLab.Core", "3.3")]
    3233  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/SymbolicTimeSeriesPrognosisSolutionView.Designer.cs

    r9999 r11144  
    5454      this.SuspendLayout();
    5555      //
    56       // exportButton
     56      // flowLayoutPanel
    5757      //
    58       this.exportButton.Visible = false;
    59       //
    60       // splitContainer
    61       //
    62       //
    63       // splitContainer.Panel1
    64       //
    65       this.splitContainer.Panel1.Controls.Add(this.btnSimplify);
    66       //
    67       // addButton
    68       //
    69       this.toolTip.SetToolTip(this.addButton, "Add");
    70       //
    71       // removeButton
    72       //
    73       this.toolTip.SetToolTip(this.removeButton, "Remove");
     58      this.flowLayoutPanel.Controls.Add(this.btnSimplify);
    7459      //
    7560      // btnSimplify
    7661      //
    77       this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    78       this.btnSimplify.Location = new System.Drawing.Point(172, 4);
     62      this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
     63      this.btnSimplify.Image = HeuristicLab.Common.Resources.VSImageLibrary.FormulaEvaluator;
     64      this.btnSimplify.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    7965      this.btnSimplify.Name = "btnSimplify";
    80       this.btnSimplify.Size = new System.Drawing.Size(75, 23);
    81       this.btnSimplify.TabIndex = 6;
    82       this.btnSimplify.Text = "Simplify";
     66      this.btnSimplify.TabIndex = 7;
     67      this.btnSimplify.Size = new System.Drawing.Size(105, 24);
     68      this.btnSimplify.Text = "Simplify Model";
     69      this.btnSimplify.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
    8370      this.btnSimplify.UseVisualStyleBackColor = true;
    8471      this.btnSimplify.Click += new System.EventHandler(this.btn_SimplifyModel_Click);
     72      this.toolTip.SetToolTip(this.btnSimplify, "Simplify solution");
    8573      //
    8674      // SymbolicTimeSeriesPrognosisSolutionView
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/SymbolicTimeSeriesPrognosisSolutionView.cs

    r9462 r11144  
    3838    }
    3939
     40    protected override void SetEnabledStateOfControls() {
     41      base.SetEnabledStateOfControls();
     42      btnSimplify.Enabled = Content != null && !Locked;
     43    }
     44
    4045    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
    4146      InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView view = new InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView();
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r9999 r11144  
    207207      <Private>False</Private>
    208208    </ProjectReference>
     209    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
     210      <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project>
     211      <Name>HeuristicLab.Common.Resources-3.3</Name>
     212      <Private>False</Private>
     213    </ProjectReference>
    209214    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    210215      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs

    r9462 r11144  
    1919 */
    2020#endregion
     21
    2122
    2223namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
     
    137138      //
    138139      // btnOptimizeConstants
    139       //
    140       this.btnOptimizeConstants.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     140      //      
     141      this.btnOptimizeConstants.AutoSize = true;
    141142      this.btnOptimizeConstants.Enabled = false;
    142       this.btnOptimizeConstants.Location = new System.Drawing.Point(104, 3);
     143      this.btnOptimizeConstants.Image = HeuristicLab.Common.Resources.VSImageLibrary.Performance;
     144      this.btnOptimizeConstants.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
     145      this.btnOptimizeConstants.Location = new System.Drawing.Point(105, 3);
    143146      this.btnOptimizeConstants.Name = "btnOptimizeConstants";
    144       this.btnOptimizeConstants.Size = new System.Drawing.Size(97, 23);
     147      this.btnOptimizeConstants.Size = new System.Drawing.Size(80, 24);
    145148      this.btnOptimizeConstants.TabIndex = 2;
    146149      this.btnOptimizeConstants.Text = "Optimize";
     150      this.btnOptimizeConstants.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     151      this.btnOptimizeConstants.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
    147152      this.btnOptimizeConstants.UseVisualStyleBackColor = true;
    148153      this.btnOptimizeConstants.Click += new System.EventHandler(this.btnOptimizeConstants_Click);
     
    150155      // btnSimplify
    151156      //
     157      this.btnSimplify.AutoSize = true;
     158      this.btnSimplify.Enabled = true;
     159      this.btnSimplify.Image = HeuristicLab.Common.Resources.VSImageLibrary.FormulaEvaluator;
     160      this.btnSimplify.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
    152161      this.btnSimplify.Location = new System.Drawing.Point(3, 3);
    153162      this.btnSimplify.Name = "btnSimplify";
    154       this.btnSimplify.Size = new System.Drawing.Size(95, 23);
     163      this.btnSimplify.Size = new System.Drawing.Size(80, 24);
    155164      this.btnSimplify.TabIndex = 1;
    156165      this.btnSimplify.Text = "Simplify";
     166      this.btnSimplify.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     167      this.btnSimplify.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
    157168      this.btnSimplify.UseVisualStyleBackColor = true;
    158169      this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame

    r10032 r11144  
    3232  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3333  [PluginDependency("HeuristicLab.Common", "3.3")]
     34  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3435  [PluginDependency("HeuristicLab.Core", "3.3")]
    3536  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
  • stable/HeuristicLab.Problems.DataAnalysis.Trading.Views/3.4/SolutionView.Designer.cs

    r10020 r11144  
    5252      this.detailsGroupBox.SuspendLayout();
    5353      this.SuspendLayout();
    54       this.exportButton.Visible = false;
    5554      //
    56       // splitContainer
    57       //
    58       //
    59       // itemsGroupBox
    60       //
    61       this.itemsGroupBox.Text = "Trading Solution";
    62       //
    63       // addButton
    64       //
    65       this.toolTip.SetToolTip(this.addButton, "Add");
    66       //
    67       // removeButton
    68       //
    69       this.toolTip.SetToolTip(this.removeButton, "Remove");
    70       //
    71       // RegressionSolutionView
     55      // SolutionView
    7256      //
    7357      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    8165      this.detailsGroupBox.ResumeLayout(false);
    8266      this.ResumeLayout(false);
    83 
    8467    }
    85 
    8668    #endregion
    8769  }
  • stable/HeuristicLab.Problems.DataAnalysis.Trading/3.4/ProblemData.cs

    r10020 r11144  
    16501650      OnChanged();
    16511651    }
     1652
     1653    public override void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
     1654      var data = problemData as ProblemData;
     1655      if (data == null) throw new ArgumentException("The problem data is not a problem data set for trading. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     1656
     1657      string errorMessage;
     1658      if (!data.IsProblemDataCompatible(this, out errorMessage)) {
     1659        throw new InvalidOperationException(errorMessage);
     1660      }
     1661
     1662      base.AdjustProblemDataProperties(data);
     1663
     1664      var toDelete = PriceChangeVariableParameter.ValidValues.ToList();
     1665      foreach (var entry in data.PriceChangeVariableParameter.ValidValues) {
     1666        if (toDelete.Any(x => x.Value == entry.Value)) {
     1667          toDelete.RemoveAll(x => x.Value == entry.Value);
     1668        } else {
     1669          PriceChangeVariableParameter.ValidValues.Add(new StringValue(entry.Value));
     1670        }
     1671      }
     1672      PriceChangeVariableParameter.Value =
     1673        PriceChangeVariableParameter.ValidValues.Single(v => v.Value == data.PriceChangeVariable);
     1674
     1675      foreach (var varToDelete in toDelete) PriceChangeVariableParameter.ValidValues.Remove(varToDelete);
     1676
     1677      TransactionCostsParameter.Value.Value = data.TransactionCosts;
     1678
     1679      OnChanged();
     1680    }
    16521681  }
    16531682}
  • stable/HeuristicLab.Problems.DataAnalysis.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Plugin.cs.frame

    r10032 r11144  
    4242  [PluginDependency("HeuristicLab.Optimization.Views","3.3")]
    4343  [PluginDependency("HeuristicLab.Optimizer", "3.3")]
     44  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    4445  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    4546  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")]
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs

    r9456 r11144  
    3737    }
    3838
     39    protected override void SetEnabledStateOfControls() {
     40      base.SetEnabledStateOfControls();
     41      //loading of problemdata is currently not support for ensemble solutions
     42      loadProblemDataButton.Enabled = false;
     43      loadProblemDataButton.Visible = false;
     44    }
     45
    3946    protected override void OnContentChanged() {
    4047      base.OnContentChanged();
     
    4754        var droppedData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    4855        if (droppedData is IValueParameter) droppedData = ((IValueParameter)droppedData).Value;
     56        else if (droppedData is IClassificationProblem) droppedData = ((IClassificationProblem)droppedData).ProblemData;
    4957
    5058        ClassificationEnsembleProblemData ensembleProblemData = droppedData as ClassificationEnsembleProblemData;
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs

    r9456 r11144  
    4343
    4444      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    45       if (dropData is ClassificationProblemData) validDragOperation = true;
     45      if (dropData is IClassificationProblemData) validDragOperation = true;
     46      else if (dropData is IClassificationProblem) validDragOperation = true;
    4647      else if (dropData is IValueParameter) {
    4748        var param = (IValueParameter)dropData;
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs

    r9456 r11144  
    4343
    4444      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    45       if (dropData is ClusteringProblemData) validDragOperation = true;
     45      if (dropData is IClusteringProblemData) validDragOperation = true;
     46      else if (dropData is IClusteringProblem) validDragOperation = true;
    4647      else if (dropData is IValueParameter) {
    4748        var param = (IValueParameter)dropData;
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.Designer.cs

    r9999 r11144  
    1919 */
    2020#endregion
     21
    2122namespace HeuristicLab.Problems.DataAnalysis.Views {
    2223  partial class DataAnalysisSolutionView {
     
    4445    /// </summary>
    4546    private void InitializeComponent() {
    46       this.exportButton = new System.Windows.Forms.Button();
    47       this.exportFileDialog = new System.Windows.Forms.SaveFileDialog();
     47      this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
     48      this.loadProblemDataButton = new System.Windows.Forms.Button();
     49      this.loadProblemDataFileDialog = new System.Windows.Forms.OpenFileDialog();
    4850      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    4951      this.splitContainer.Panel1.SuspendLayout();
     
    5355      this.detailsGroupBox.SuspendLayout();
    5456      this.SuspendLayout();
     57      //
     58      // itemslistView
     59      //
     60      this.itemsListView.Location = new System.Drawing.Point(this.itemsListView.Location.X, this.itemsListView.Location.Y + 3);
     61      //
     62      // detailsGroupBox
     63      //
     64      this.detailsGroupBox.Location = new System.Drawing.Point(this.detailsGroupBox.Location.X, this.detailsGroupBox.Location.Y + 3);
     65      //
    5566      //
    5667      // splitContainer
     
    5970      // splitContainer.Panel2
    6071      //
    61       this.splitContainer.Panel2.Controls.Add(this.exportButton);
     72      this.splitContainer.Panel2.Controls.Add(this.flowLayoutPanel);
    6273      //
    6374      // itemsGroupBox
    6475      //
    6576      this.itemsGroupBox.Text = "Data Analysis Solution";
     77      //
     78      // flowLayoutPanel
     79      //
     80      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
     81      this.flowLayoutPanel.FlowDirection = System.Windows.Forms.FlowDirection.LeftToRight;
     82      this.flowLayoutPanel.Location = new System.Drawing.Point(0, 0);
     83      this.flowLayoutPanel.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
     84      this.flowLayoutPanel.Size = new System.Drawing.Size(266, 30);
     85      this.flowLayoutPanel.Controls.Add(this.loadProblemDataButton);
     86      //
     87      // loadProblemDataButton
     88      //
     89      this.loadProblemDataButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
     90      this.loadProblemDataButton.AutoSize = true;
     91      this.loadProblemDataButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
     92      this.loadProblemDataButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     93      this.loadProblemDataButton.Name = "loadProblemDataButton";
     94      this.loadProblemDataButton.Size = new System.Drawing.Size(105, 24);
     95      this.loadProblemDataButton.TabIndex = 6;
     96      this.loadProblemDataButton.Text = "Load new Data";
     97      this.loadProblemDataButton.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     98      this.loadProblemDataButton.UseVisualStyleBackColor = true;
     99      this.loadProblemDataButton.Click += new System.EventHandler(this.loadProblemDataButton_Click);
     100      this.toolTip.SetToolTip(this.loadProblemDataButton, "Creates a new data analysis solution with the same model and the loaded problem data.");
    66101      //
    67       // addButton
     102      // openFileDialog
    68103      //
    69       this.toolTip.SetToolTip(this.addButton, "Add");
    70       //
    71       // removeButton
    72       //
    73       this.toolTip.SetToolTip(this.removeButton, "Remove");
    74       //
    75       // exportButton
    76       //
    77       this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    78       this.exportButton.Location = new System.Drawing.Point(215, 4);
    79       this.exportButton.Name = "exportButton";
    80       this.exportButton.Size = new System.Drawing.Size(54, 23);
    81       this.exportButton.TabIndex = 6;
    82       this.exportButton.Text = "Export";
    83       this.exportButton.UseVisualStyleBackColor = true;
    84       this.exportButton.Click += new System.EventHandler(this.exportButton_Click);
     104      this.loadProblemDataFileDialog.Filter = "HL files|*.hl";
     105      this.loadProblemDataFileDialog.Title = "Load new ProblemData or Problem...";
    85106      //
    86107      // DataAnalysisSolutionView
     
    100121    #endregion
    101122
    102     private System.Windows.Forms.SaveFileDialog exportFileDialog;
    103     protected System.Windows.Forms.Button exportButton;
     123    protected System.Windows.Forms.Button loadProblemDataButton;
     124    protected System.Windows.Forms.OpenFileDialog loadProblemDataFileDialog;
     125    protected System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
    104126
    105127  }
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs

    r9999 r11144  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.ComponentModel;
    2524using System.Drawing;
    2625using System.Linq;
     
    3130using HeuristicLab.Optimization;
    3231using HeuristicLab.Optimization.Views;
     32using HeuristicLab.Persistence.Default.Xml;
    3333using HeuristicLab.PluginInfrastructure;
    3434
     
    5252      addButton.Enabled = false;
    5353      removeButton.Enabled = false;
    54       if (Content == null) {
    55         exportButton.Enabled = false;
    56       } else {
    57         exportButton.Enabled = !Locked;
    58       }
     54      loadProblemDataButton.Enabled = Content != null && !Locked;
    5955    }
    6056
     
    127123    }
    128124
    129 
    130     private void exportButton_Click(object sender, EventArgs e) {
    131       var exporters = ApplicationManager.Manager.GetInstances<IDataAnalysisSolutionExporter>()
    132         .Where(exporter => exporter.Supports(Content)).ToArray();
    133       exportFileDialog.Filter = exporters.Skip(1)
    134         .Aggregate(exporters.First().FileTypeFilter, (s, exporter) => s + "|" + exporter.FileTypeFilter);
    135       var result = exportFileDialog.ShowDialog();
    136       if (result == DialogResult.OK) {
    137 
    138         var name = exportFileDialog.FileName;
    139         var selectedExporter = exporters.Single(exporter => exporter.FileTypeFilter == exportFileDialog.Filter);
    140 
    141         using (BackgroundWorker bg = new BackgroundWorker()) {
    142           MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exportion solution to " + name + ".");
    143           bg.DoWork += (_, __) => selectedExporter.Export(Content, name);
    144           bg.RunWorkerCompleted += (_, __) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    145           bg.RunWorkerAsync();
     125    protected virtual void loadProblemDataButton_Click(object sender, EventArgs e) {
     126      if (loadProblemDataFileDialog.ShowDialog(this) != DialogResult.OK) return;
     127      try {
     128        object hlFile = XmlParser.Deserialize(loadProblemDataFileDialog.FileName);
     129
     130        IDataAnalysisProblemData problemData = null;
     131        if (hlFile is IDataAnalysisProblemData) {
     132          problemData = (IDataAnalysisProblemData)hlFile;
     133        } else if (hlFile is IDataAnalysisProblem) {
     134          problemData = ((IDataAnalysisProblem)hlFile).ProblemData;
     135        } else if (hlFile is IDataAnalysisSolution) {
     136          problemData = ((IDataAnalysisSolution)hlFile).ProblemData;
    146137        }
     138
     139        if (problemData == null)
     140          throw new InvalidOperationException("The chosen HeuristicLab file does not contain a ProblemData, Problem, or DataAnalysisSolution.");
     141
     142        var solution = (IDataAnalysisSolution)Content.Clone();
     143        problemData.AdjustProblemDataProperties(solution.ProblemData);
     144        solution.ProblemData = problemData;
     145        if (!solution.Name.EndsWith(" with loaded problemData"))
     146          solution.Name += " with loaded problemData";
     147        MainFormManager.MainForm.ShowContent(solution);
     148      }
     149      catch (InvalidOperationException invalidOperationException) {
     150        ErrorHandling.ShowErrorDialog(this, invalidOperationException);
     151      }
     152      catch (ArgumentException argumentException) {
     153        ErrorHandling.ShowErrorDialog(this, argumentException);
    147154      }
    148155    }
     
    194201      validDragOperation = false;
    195202      if (ReadOnly) return;
     203      if (e.Effect != DragDropEffects.Copy) return;
    196204
    197205      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    198       if (dropData is DataAnalysisProblemData) validDragOperation = true;
     206      if (dropData is IDataAnalysisProblemData) validDragOperation = true;
     207      else if (dropData is IDataAnalysisProblem) validDragOperation = true;
    199208      else if (dropData is IValueParameter) {
    200209        var param = (IValueParameter)dropData;
    201         if (param.Value is DataAnalysisProblemData) validDragOperation = true;
     210        if (param.Value is IDataAnalysisProblemData) validDragOperation = true;
    202211      }
    203212    }
    204213
    205214    protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
    206       if (e.Effect != DragDropEffects.None) {
    207         var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    208         if (dropData is DataAnalysisProblemData) {
    209           DataAnalysisProblemData problemData = (DataAnalysisProblemData)dropData;
    210           Content.ProblemData = (DataAnalysisProblemData)problemData.Clone();
    211         } else if (dropData is IValueParameter) {
    212           var param = (IValueParameter)dropData;
    213           DataAnalysisProblemData problemData = param.Value as DataAnalysisProblemData;
    214           if (problemData != null)
    215             Content.ProblemData = (DataAnalysisProblemData)problemData.Clone();
    216         }
     215      if (e.Effect == DragDropEffects.None) return;
     216
     217      IDataAnalysisProblemData problemData = null;
     218      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
     219      if (dropData is IDataAnalysisProblemData)
     220        problemData = (IDataAnalysisProblemData)dropData;
     221      else if (dropData is IDataAnalysisProblem)
     222        problemData = ((IDataAnalysisProblem)dropData).ProblemData;
     223      else if (dropData is IValueParameter) {
     224        var param = (IValueParameter)dropData;
     225        problemData = param.Value as DataAnalysisProblemData;
     226      }
     227      if (problemData == null) return;
     228
     229      try {
     230        problemData.AdjustProblemDataProperties(Content.ProblemData);
     231        Content.ProblemData = problemData;
     232
     233        if (!Content.Name.EndsWith(" with changed problemData"))
     234          Content.Name += " with changed problemData";
     235      }
     236      catch (InvalidOperationException invalidOperationException) {
     237        ErrorHandling.ShowErrorDialog(this, invalidOperationException);
     238      }
     239      catch (ArgumentException argumentException) {
     240        ErrorHandling.ShowErrorDialog(this, argumentException);
    217241      }
    218242    }
    219243    #endregion
     244
    220245  }
    221246}
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs

    r9456 r11144  
    3232    }
    3333
     34    protected override void SetEnabledStateOfControls() {
     35      base.SetEnabledStateOfControls();
     36      //loading of problemdata is currently not support for ensemble solutions
     37      loadProblemDataButton.Enabled = false;
     38      loadProblemDataButton.Visible = false;
     39    }
     40
    3441    public new RegressionEnsembleSolution Content {
    3542      get { return (RegressionEnsembleSolution)base.Content; }
     
    4754        var droppedData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    4855        if (droppedData is IValueParameter) droppedData = ((IValueParameter)droppedData).Value;
     56        if (droppedData is IRegressionProblem) droppedData = ((IRegressionProblem)droppedData).ProblemData;
    4957
    5058        RegressionEnsembleProblemData ensembleProblemData = droppedData as RegressionEnsembleProblemData;
    51         RegressionProblemData problemData = droppedData as RegressionProblemData;
     59        IRegressionProblemData problemData = droppedData as IRegressionProblemData;
    5260        if (ensembleProblemData != null) {
    5361          Content.ProblemData = (RegressionEnsembleProblemData)ensembleProblemData.Clone();
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs

    r9456 r11144  
    4343
    4444      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    45       if (dropData is RegressionProblemData) validDragOperation = true;
     45      if (dropData is IRegressionProblemData) validDragOperation = true;
     46      else if (dropData is IRegressionProblem) validDragOperation = true;
    4647      else if (dropData is IValueParameter) {
    4748        var param = (IValueParameter)dropData;
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.cs

    r9456 r11144  
    4444      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    4545      if (dropData is ITimeSeriesPrognosisProblemData) validDragOperation = true;
     46      else if (dropData is ITimeSeriesPrognosisProblem) validDragOperation = true;
    4647      else if (dropData is IValueParameter) {
    4748        var param = (IValueParameter)dropData;
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r9456 r11144  
    221221    public string TargetVariable {
    222222      get { return TargetVariableParameter.Value.Value; }
     223      set {
     224        if (value == null) throw new ArgumentNullException("targetVariable", "The provided value for the targetVariable is null.");
     225        if (value == TargetVariable) return;
     226
     227
     228        var matchingParameterValue = TargetVariableParameter.ValidValues.FirstOrDefault(v => v.Value == value);
     229        if (matchingParameterValue == null) throw new ArgumentException("The provided value is not valid as the targetVariable.", "targetVariable");
     230        TargetVariableParameter.Value = matchingParameterValue;
     231      }
    223232    }
    224233
     
    408417    }
    409418    #endregion
     419
     420    protected override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
     421      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     422      IClassificationProblemData classificationProblemData = problemData as IClassificationProblemData;
     423      if (classificationProblemData == null)
     424        throw new ArgumentException("The problem data is no classification problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     425
     426      var returnValue = base.IsProblemDataCompatible(classificationProblemData, out errorMessage);
     427      //check targetVariable
     428      if (classificationProblemData.InputVariables.All(var => var.Value != TargetVariable)) {
     429        errorMessage = string.Format("The target variable {0} is not present in the new problem data.", TargetVariable)
     430                       + Environment.NewLine + errorMessage;
     431        return false;
     432      }
     433
     434      var newClassValues = classificationProblemData.Dataset.GetDoubleValues(TargetVariable).Distinct().OrderBy(x => x);
     435      if (!newClassValues.SequenceEqual(ClassValues)) {
     436        errorMessage = errorMessage + string.Format("The class values differ in the provided classification problem data.");
     437        return false;
     438      }
     439
     440      return returnValue;
     441    }
     442
     443    public override void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
     444      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     445      ClassificationProblemData classificationProblemData = problemData as ClassificationProblemData;
     446      if (classificationProblemData == null)
     447        throw new ArgumentException("The problem data is not a classification problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     448
     449      base.AdjustProblemDataProperties(problemData);
     450      TargetVariable = classificationProblemData.TargetVariable;
     451      for (int i = 0; i < classificationProblemData.ClassNames.Count(); i++)
     452        ClassNamesParameter.Value[i, 0] = classificationProblemData.ClassNames.ElementAt(i);
     453
     454      for (int i = 0; i < Classes; i++) {
     455        for (int j = 0; j < Classes; j++) {
     456          ClassificationPenaltiesParameter.Value[i, j] = classificationProblemData.GetClassificationPenalty(ClassValuesCache[i], ClassValuesCache[j]);
     457        }
     458      }
     459    }
    410460  }
    411461}
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r9456 r11144  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using System.Text;
    2526using HeuristicLab.Collections;
    2627using HeuristicLab.Common;
     
    158159      if (listeners != null) listeners(this, EventArgs.Empty);
    159160    }
     161
     162    protected virtual bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
     163      errorMessage = string.Empty;
     164      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     165
     166      //check allowed input variables
     167      StringBuilder message = new StringBuilder();
     168      var variables = new HashSet<string>(problemData.InputVariables.Select(x => x.Value));
     169      foreach (var item in AllowedInputVariables) {
     170        if (!variables.Contains(item))
     171          message.AppendLine("Input variable '" + item + "' is not present in the new problem data.");
     172      }
     173
     174      if (message.Length != 0) {
     175        errorMessage = message.ToString();
     176        return false;
     177      }
     178      return true;
     179
     180    }
     181
     182    public virtual void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
     183      DataAnalysisProblemData data = problemData as DataAnalysisProblemData;
     184      if (data == null) throw new ArgumentException("The problem data is not a data analysis problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     185
     186      string errorMessage;
     187      if (!data.IsProblemDataCompatible(this, out errorMessage)) {
     188        throw new InvalidOperationException(errorMessage);
     189      }
     190
     191      foreach (var inputVariable in InputVariables) {
     192        var variable = data.InputVariables.FirstOrDefault(i => i.Value == inputVariable.Value);
     193        InputVariables.SetItemCheckedState(inputVariable, variable != null && data.InputVariables.ItemChecked(variable));
     194      }
     195
     196      TrainingPartition.Start = TrainingPartition.End = 0;
     197      TestPartition.Start = 0;
     198      TestPartition.End = Dataset.Rows;
     199    }
    160200  }
    161201}
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r9456 r11144  
    100100    public string TargetVariable {
    101101      get { return TargetVariableParameter.Value.Value; }
     102      set {
     103        if (value == null) throw new ArgumentNullException("targetVariable", "The provided value for the targetVariable is null.");
     104        if (value == TargetVariable) return;
     105
     106        var matchingParameterValue = TargetVariableParameter.ValidValues.FirstOrDefault(v => v.Value == value);
     107        if (matchingParameterValue == null) throw new ArgumentException("The provided value is not valid as the targetVariable.", "targetVariable");
     108        TargetVariableParameter.Value = matchingParameterValue;
     109      }
    102110    }
    103111
     
    142150      OnChanged();
    143151    }
     152
     153    protected override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
     154      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     155      IRegressionProblemData regressionProblemData = problemData as IRegressionProblemData;
     156      if (regressionProblemData == null)
     157        throw new ArgumentException("The problem data is not a regression problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     158
     159      var returnValue = base.IsProblemDataCompatible(problemData, out errorMessage);
     160      //check targetVariable
     161      if (problemData.InputVariables.All(var => var.Value != TargetVariable)) {
     162        errorMessage = string.Format("The target variable {0} is not present in the new problem data.", TargetVariable)
     163                       + Environment.NewLine + errorMessage;
     164        return false;
     165      }
     166      return returnValue;
     167    }
     168
     169    public override void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
     170      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     171      RegressionProblemData regressionProblemData = problemData as RegressionProblemData;
     172      if (regressionProblemData == null)
     173        throw new ArgumentException("The problem data is not a regression problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     174
     175      base.AdjustProblemDataProperties(problemData);
     176      TargetVariable = regressionProblemData.TargetVariable;
     177    }
    144178  }
    145179}
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisProblemData.cs

    r9572 r11144  
    16211621    }
    16221622
     1623    protected override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
     1624      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     1625      ITimeSeriesPrognosisProblemData timeseriesProblemData = problemData as ITimeSeriesPrognosisProblemData;
     1626      if (timeseriesProblemData == null)
     1627        throw new ArgumentException("The problem data is not a time-series problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     1628
     1629      var returnValue = base.IsProblemDataCompatible(problemData, out errorMessage);
     1630      //check targetVariable
     1631      if (problemData.InputVariables.All(var => var.Value != TargetVariable)) {
     1632        errorMessage = string.Format("The target variable {0} is not present in the new problem data.", TargetVariable)
     1633                       + Environment.NewLine + errorMessage;
     1634        return false;
     1635      }
     1636      return returnValue;
     1637    }
     1638
     1639    public override void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
     1640      TimeSeriesPrognosisProblemData timeSeriesProblemData = problemData as TimeSeriesPrognosisProblemData;
     1641      if (timeSeriesProblemData == null)
     1642        throw new ArgumentException("The problem data is not a timeseries problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     1643
     1644      var trainingDataStart = TrainingIndices.First();
     1645     
     1646      base.AdjustProblemDataProperties(problemData);
     1647     
     1648      TestPartition.Start = trainingDataStart;
     1649
     1650      TrainingHorizon = timeSeriesProblemData.TrainingHorizon;
     1651      TestHorizon = timeSeriesProblemData.TestHorizon;
     1652    }
     1653
    16231654  }
    16241655}
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisResults.cs

    r9456 r11144  
    369369      OnlineCalculatorError errorState;
    370370      var problemData = Solution.ProblemData;
     371      if (!problemData.TrainingIndices.Any()) return;
    371372      var model = Solution.Model;
    372373      //mean model
     
    415416      OnlineCalculatorError errorState;
    416417      var problemData = Solution.ProblemData;
     418      if (!problemData.TestIndices.Any()) return;
    417419      var model = Solution.Model;
    418       //mean model
    419       double trainingMean = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average();
    420       var meanModel = new ConstantTimeSeriesPrognosisModel(trainingMean);
    421 
    422       //AR1 model
    423       double alpha, beta;
    424       IEnumerable<double> trainingStartValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices.Select(r => r - 1).Where(r => r > 0)).ToList();
    425       OnlineLinearScalingParameterCalculator.Calculate(problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices.Where(x => x > 0)), trainingStartValues, out alpha, out beta, out errorState);
    426       var AR1model = new TimeSeriesPrognosisAutoRegressiveModel(problemData.TargetVariable, new double[] { beta }, alpha);
    427 
    428420      var testHorizions = problemData.TestIndices.Select(r => Math.Min(testHorizon, problemData.TestPartition.End - r)).ToList();
    429421      IEnumerable<IEnumerable<double>> testTargetValues = problemData.TestIndices.Zip(testHorizions, Enumerable.Range).Select(r => problemData.Dataset.GetDoubleValues(problemData.TargetVariable, r)).ToList();
    430422      IEnumerable<IEnumerable<double>> testEstimatedValues = model.GetPrognosedValues(problemData.Dataset, problemData.TestIndices, testHorizions).ToList();
    431423      IEnumerable<double> testStartValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TestIndices.Select(r => r - 1).Where(r => r > 0)).ToList();
    432       IEnumerable<IEnumerable<double>> testMeanModelPredictions = meanModel.GetPrognosedValues(problemData.Dataset, problemData.TestIndices, testHorizions).ToList();
    433       IEnumerable<IEnumerable<double>> testAR1ModelPredictions = AR1model.GetPrognosedValues(problemData.Dataset, problemData.TestIndices, testHorizions).ToList();
    434424
    435425      IEnumerable<double> originalTestValues = testTargetValues.SelectMany(x => x).ToList();
     
    453443      PrognosisTestWeightedDirectionalSymmetry = OnlineWeightedDirectionalSymmetryCalculator.Calculate(testStartValues, testTargetValues, testEstimatedValues, out errorState);
    454444      PrognosisTestWeightedDirectionalSymmetry = errorState == OnlineCalculatorError.None ? PrognosisTestWeightedDirectionalSymmetry : 0.0;
    455       PrognosisTestTheilsUStatisticAR1 = OnlineTheilsUStatisticCalculator.Calculate(testStartValues, testTargetValues, testAR1ModelPredictions, testEstimatedValues, out errorState);
    456       PrognosisTestTheilsUStatisticAR1 = errorState == OnlineCalculatorError.None ? PrognosisTestTheilsUStatisticAR1 : double.PositiveInfinity;
    457       PrognosisTestTheilsUStatisticMean = OnlineTheilsUStatisticCalculator.Calculate(testStartValues, testTargetValues, testMeanModelPredictions, testEstimatedValues, out errorState);
    458       PrognosisTestTheilsUStatisticMean = errorState == OnlineCalculatorError.None ? PrognosisTestTheilsUStatisticMean : double.PositiveInfinity;
     445
     446
     447      if (problemData.TrainingIndices.Any()) {
     448        //mean model
     449        double trainingMean = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average();
     450        var meanModel = new ConstantTimeSeriesPrognosisModel(trainingMean);
     451
     452        //AR1 model
     453        double alpha, beta;
     454        IEnumerable<double> trainingStartValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices.Select(r => r - 1).Where(r => r > 0)).ToList();
     455        OnlineLinearScalingParameterCalculator.Calculate(problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices.Where(x => x > 0)), trainingStartValues, out alpha, out beta, out errorState);
     456        var AR1model = new TimeSeriesPrognosisAutoRegressiveModel(problemData.TargetVariable, new double[] { beta }, alpha);
     457
     458        IEnumerable<IEnumerable<double>> testMeanModelPredictions = meanModel.GetPrognosedValues(problemData.Dataset, problemData.TestIndices, testHorizions).ToList();
     459        IEnumerable<IEnumerable<double>> testAR1ModelPredictions = AR1model.GetPrognosedValues(problemData.Dataset, problemData.TestIndices, testHorizions).ToList();
     460
     461        PrognosisTestTheilsUStatisticAR1 = OnlineTheilsUStatisticCalculator.Calculate(testStartValues, testTargetValues, testAR1ModelPredictions, testEstimatedValues, out errorState);
     462        PrognosisTestTheilsUStatisticAR1 = errorState == OnlineCalculatorError.None ? PrognosisTestTheilsUStatisticAR1 : double.PositiveInfinity;
     463        PrognosisTestTheilsUStatisticMean = OnlineTheilsUStatisticCalculator.Calculate(testStartValues, testTargetValues, testMeanModelPredictions, testEstimatedValues, out errorState);
     464        PrognosisTestTheilsUStatisticMean = errorState == OnlineCalculatorError.None ? PrognosisTestTheilsUStatisticMean : double.PositiveInfinity;
     465      }
    459466    }
    460467  }
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs

    r9462 r11144  
    149149    protected void CalculateTimeSeriesResults() {
    150150      OnlineCalculatorError errorState;
    151       double trainingMean = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average();
     151      double trainingMean = ProblemData.TrainingIndices.Any() ? ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average() : double.NaN;
    152152      var meanModel = new ConstantTimeSeriesPrognosisModel(trainingMean);
    153153
     
    159159
    160160      #region Calculate training quality measures
    161       IEnumerable<double> trainingTargetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).ToList();
    162       IEnumerable<double> trainingEstimatedValues = EstimatedTrainingValues.ToList();
    163       IEnumerable<double> trainingMeanModelPredictions = meanModel.GetEstimatedValues(ProblemData.Dataset, ProblemData.TrainingIndices).ToList();
    164       IEnumerable<double> trainingAR1ModelPredictions = AR1model.GetEstimatedValues(ProblemData.Dataset, ProblemData.TrainingIndices).ToList();
    165 
    166       TrainingDirectionalSymmetry = OnlineDirectionalSymmetryCalculator.Calculate(trainingTargetValues.First(), trainingTargetValues, trainingEstimatedValues, out errorState);
    167       TrainingDirectionalSymmetry = errorState == OnlineCalculatorError.None ? TrainingDirectionalSymmetry : 0.0;
    168       TrainingWeightedDirectionalSymmetry = OnlineWeightedDirectionalSymmetryCalculator.Calculate(trainingTargetValues.First(), trainingTargetValues, trainingEstimatedValues, out errorState);
    169       TrainingWeightedDirectionalSymmetry = errorState == OnlineCalculatorError.None ? TrainingWeightedDirectionalSymmetry : 0.0;
    170       TrainingTheilsUStatisticAR1 = OnlineTheilsUStatisticCalculator.Calculate(trainingTargetValues.First(), trainingTargetValues, trainingAR1ModelPredictions, trainingEstimatedValues, out errorState);
    171       TrainingTheilsUStatisticAR1 = errorState == OnlineCalculatorError.None ? TrainingTheilsUStatisticAR1 : double.PositiveInfinity;
    172       TrainingTheilsUStatisticMean = OnlineTheilsUStatisticCalculator.Calculate(trainingTargetValues.First(), trainingTargetValues, trainingMeanModelPredictions, trainingEstimatedValues, out errorState);
    173       TrainingTheilsUStatisticMean = errorState == OnlineCalculatorError.None ? TrainingTheilsUStatisticMean : double.PositiveInfinity;
     161      if (ProblemData.TrainingIndices.Any()) {
     162        IEnumerable<double> trainingTargetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).ToList();
     163        IEnumerable<double> trainingEstimatedValues = EstimatedTrainingValues.ToList();
     164        IEnumerable<double> trainingMeanModelPredictions = meanModel.GetEstimatedValues(ProblemData.Dataset, ProblemData.TrainingIndices).ToList();
     165        IEnumerable<double> trainingAR1ModelPredictions = AR1model.GetEstimatedValues(ProblemData.Dataset, ProblemData.TrainingIndices).ToList();
     166
     167        TrainingDirectionalSymmetry = OnlineDirectionalSymmetryCalculator.Calculate(trainingTargetValues.First(), trainingTargetValues, trainingEstimatedValues, out errorState);
     168        TrainingDirectionalSymmetry = errorState == OnlineCalculatorError.None ? TrainingDirectionalSymmetry : 0.0;
     169        TrainingWeightedDirectionalSymmetry = OnlineWeightedDirectionalSymmetryCalculator.Calculate(trainingTargetValues.First(), trainingTargetValues, trainingEstimatedValues, out errorState);
     170        TrainingWeightedDirectionalSymmetry = errorState == OnlineCalculatorError.None ? TrainingWeightedDirectionalSymmetry : 0.0;
     171        TrainingTheilsUStatisticAR1 = OnlineTheilsUStatisticCalculator.Calculate(trainingTargetValues.First(), trainingTargetValues, trainingAR1ModelPredictions, trainingEstimatedValues, out errorState);
     172        TrainingTheilsUStatisticAR1 = errorState == OnlineCalculatorError.None ? TrainingTheilsUStatisticAR1 : double.PositiveInfinity;
     173        TrainingTheilsUStatisticMean = OnlineTheilsUStatisticCalculator.Calculate(trainingTargetValues.First(), trainingTargetValues, trainingMeanModelPredictions, trainingEstimatedValues, out errorState);
     174        TrainingTheilsUStatisticMean = errorState == OnlineCalculatorError.None ? TrainingTheilsUStatisticMean : double.PositiveInfinity;
     175      }
    174176      #endregion
    175177
    176178      #region Calculate test quality measures
    177       IEnumerable<double> testTargetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices).ToList();
    178       IEnumerable<double> testEstimatedValues = EstimatedTestValues.ToList();
    179       IEnumerable<double> testMeanModelPredictions = meanModel.GetEstimatedValues(ProblemData.Dataset, ProblemData.TestIndices).ToList();
    180       IEnumerable<double> testAR1ModelPredictions = AR1model.GetEstimatedValues(ProblemData.Dataset, ProblemData.TestIndices).ToList();
    181 
    182       TestDirectionalSymmetry = OnlineDirectionalSymmetryCalculator.Calculate(testTargetValues.First(), testTargetValues, testEstimatedValues, out errorState);
    183       TestDirectionalSymmetry = errorState == OnlineCalculatorError.None ? TestDirectionalSymmetry : 0.0;
    184       TestWeightedDirectionalSymmetry = OnlineWeightedDirectionalSymmetryCalculator.Calculate(testTargetValues.First(), testTargetValues, testEstimatedValues, out errorState);
    185       TestWeightedDirectionalSymmetry = errorState == OnlineCalculatorError.None ? TestWeightedDirectionalSymmetry : 0.0;
    186       TestTheilsUStatisticAR1 = OnlineTheilsUStatisticCalculator.Calculate(testTargetValues.First(), testTargetValues, testAR1ModelPredictions, testEstimatedValues, out errorState);
    187       TestTheilsUStatisticAR1 = errorState == OnlineCalculatorError.None ? TestTheilsUStatisticAR1 : double.PositiveInfinity;
    188       TestTheilsUStatisticMean = OnlineTheilsUStatisticCalculator.Calculate(testTargetValues.First(), testTargetValues, testMeanModelPredictions, testEstimatedValues, out errorState);
    189       TestTheilsUStatisticMean = errorState == OnlineCalculatorError.None ? TestTheilsUStatisticMean : double.PositiveInfinity;
     179      if (ProblemData.TestIndices.Any()) {
     180        IEnumerable<double> testTargetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices).ToList();
     181        IEnumerable<double> testEstimatedValues = EstimatedTestValues.ToList();
     182        IEnumerable<double> testMeanModelPredictions = meanModel.GetEstimatedValues(ProblemData.Dataset, ProblemData.TestIndices).ToList();
     183        IEnumerable<double> testAR1ModelPredictions = AR1model.GetEstimatedValues(ProblemData.Dataset, ProblemData.TestIndices).ToList();
     184
     185        TestDirectionalSymmetry = OnlineDirectionalSymmetryCalculator.Calculate(testTargetValues.First(), testTargetValues, testEstimatedValues, out errorState);
     186        TestDirectionalSymmetry = errorState == OnlineCalculatorError.None ? TestDirectionalSymmetry : 0.0;
     187        TestWeightedDirectionalSymmetry = OnlineWeightedDirectionalSymmetryCalculator.Calculate(testTargetValues.First(), testTargetValues, testEstimatedValues, out errorState);
     188        TestWeightedDirectionalSymmetry = errorState == OnlineCalculatorError.None ? TestWeightedDirectionalSymmetry : 0.0;
     189        TestTheilsUStatisticAR1 = OnlineTheilsUStatisticCalculator.Calculate(testTargetValues.First(), testTargetValues, testAR1ModelPredictions, testEstimatedValues, out errorState);
     190        TestTheilsUStatisticAR1 = errorState == OnlineCalculatorError.None ? TestTheilsUStatisticAR1 : double.PositiveInfinity;
     191        TestTheilsUStatisticMean = OnlineTheilsUStatisticCalculator.Calculate(testTargetValues.First(), testTargetValues, testMeanModelPredictions, testEstimatedValues, out errorState);
     192        TestTheilsUStatisticMean = errorState == OnlineCalculatorError.None ? TestTheilsUStatisticMean : double.PositiveInfinity;
     193      }
    190194      #endregion
    191195    }
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationProblemData.cs

    r9456 r11144  
    2323namespace HeuristicLab.Problems.DataAnalysis {
    2424  public interface IClassificationProblemData : IDataAnalysisProblemData {
    25     string TargetVariable { get; }
     25    string TargetVariable { get; set; }
    2626
    2727    IEnumerable<string> ClassNames { get; }
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs

    r9456 r11144  
    4343
    4444    event EventHandler Changed;
     45
     46    void AdjustProblemDataProperties(IDataAnalysisProblemData problemData);
    4547  }
    4648}
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionProblemData.cs

    r9456 r11144  
    2222namespace HeuristicLab.Problems.DataAnalysis {
    2323  public interface IRegressionProblemData : IDataAnalysisProblemData {
    24     string TargetVariable { get; }
     24    string TargetVariable { get; set; }
    2525  }
    2626}
Note: See TracChangeset for help on using the changeset viewer.