Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/27/16 17:17:00 (8 years ago)
Author:
bburlacu
Message:

#2288: Remove TinySet.cs in favor of a more general method for generating k-combinations. Improve target variation experiment generation. Refactored code and avoided some corner case exceptions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperiment.cs

    r13728 r13806  
    2626using HeuristicLab.Optimization;
    2727using HeuristicLab.Optimizer;
     28using HeuristicLab.Problems.DataAnalysis;
    2829
    2930namespace HeuristicLab.VariableInteractionNetworks {
     
    4748    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    4849      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
    49       ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked;
     50      bool enabled = false;
     51      if (activeView != null && !activeView.Locked && activeView.Content != null) {
     52        var algorithm = activeView.Content as IAlgorithm;
     53        if (algorithm != null) {
     54          var problem = algorithm.Problem;
     55          // make sure the problem data specifies a target variable
     56          enabled = problem is IRegressionProblem || problem is IClassificationProblem;
     57        }
     58      }
     59      ToolStripItem.Enabled = enabled;
    5060    }
    5161
Note: See TracChangeset for help on using the changeset viewer.