Changeset 7939


Ignore:
Timestamp:
05/30/12 17:24:16 (9 years ago)
Author:
spimming
Message:

#1807:

  • wizard page to view generated experiments
  • generate experiments according to example
  • plugin frame adapted
  • new version of problem view dialog included
Location:
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard.csproj

    r7912 r7939  
    4242      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis.Views-3.4.dll</HintPath>
    4343    </Reference>
     44    <Reference Include="HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    4445    <Reference Include="HeuristicLab.Collections-3.3">
    4546      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     
    6364      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
    6465    </Reference>
     66    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    6567    <Reference Include="HeuristicLab.MainForm-3.3">
    6668      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
     
    6971      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
    7072    </Reference>
     73    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    7174    <Reference Include="HeuristicLab.Optimization-3.3">
    7275      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     
    9093      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
    9194    </Reference>
     95    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     96    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    9297    <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4">
    9398      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Views-3.4.dll</HintPath>
    9499    </Reference>
     100    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     101    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     102    <Reference Include="HeuristicLab.Selection-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    95103    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3">
    96104      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
  • branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/MediumAnalysisPage.cs

    r7912 r7939  
    33using System.Linq;
    44using HeuristicLab.Algorithms.DataAnalysis;
     5using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm;
     6using HeuristicLab.Common;
    57using HeuristicLab.Data;
    68using HeuristicLab.Encodings.ParameterConfigurationTreeEncoding;
    79using HeuristicLab.Optimization;
    810using HeuristicLab.Problems.DataAnalysis;
     11using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
    912namespace HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard {
    1013  public partial class MediumAnalysisPage : HeuristicLab.ExperimentGeneration.DataAnalysis.Wizard.WizardPage {
     14    private const int nrOfRepetitions = 10;
     15    private const string gaCrossover = "SubtreeSwappingCrossover";
     16    private const string gaMutator = "MultiSymbolicExpressionTreeManipulator";
     17    private const string gaSelector = "GenderSpecificSelection";
     18
    1119    private BackgroundWorker worker;
    1220
     
    2230      worker.DoWork += new DoWorkEventHandler(GenerateExperimentsTask);
    2331      worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkerCompleted);
     32      worker.WorkerReportsProgress = true;
     33      worker.ProgressChanged += new ProgressChangedEventHandler(WorkerProgressChanged);
    2434
    2535    }
     
    2838      DataAnalysisWizardContext c = e.Argument as DataAnalysisWizardContext;
    2939      IProblem problem = c.Problem;
     40
     41      // SVR Experiment -------------------------------------------------------
    3042      SupportVectorRegression svr = new SupportVectorRegression();
    3143      svr.Problem = (IRegressionProblem)problem;
    3244      ParameterConfigurationTree vc = new ParameterConfigurationTree(svr, problem);
    33       var nuPc = vc.AlgorithmConfiguration.ParameterConfigurations.Where(x => x.ParameterName == "Nu").SingleOrDefault();
    34       nuPc.Optimize = true;
    35       var nuVc = (RangeValueConfiguration)nuPc.ValueConfigurations.First();
    36       nuVc.Optimize = true;
    37       nuVc.RangeConstraint = new DoubleValueRange(new DoubleValue(0.1), new DoubleValue(0.9), new DoubleValue(0.1));
    3845
    39       var costPc = vc.AlgorithmConfiguration.ParameterConfigurations.Where(x => x.ParameterName == "Cost").SingleOrDefault();
    40       costPc.Optimize = true;
    41       var costVc = (RangeValueConfiguration)costPc.ValueConfigurations.First();
    42       costVc.Optimize = true;
    43       costVc.RangeConstraint = new DoubleValueFactorRange(new DoubleValue(0.03125), new DoubleValue(32768), new DoubleValue(4));
     46      var nuRange = new DoubleValueRange(new DoubleValue(0.1), new DoubleValue(0.9), new DoubleValue(0.1));
     47      SetParameterRangeContraint(vc, "Nu", nuRange);
    4448
    45       var gammaPc = vc.AlgorithmConfiguration.ParameterConfigurations.Where(x => x.ParameterName == "Gamma").SingleOrDefault();
    46       gammaPc.Optimize = true;
    47       var gammaVc = (RangeValueConfiguration)gammaPc.ValueConfigurations.First();
    48       gammaVc.Optimize = true;
    49       gammaVc.RangeConstraint = new DoubleValueFactorRange(new DoubleValue(6.10352E-05), new DoubleValue(64), new DoubleValue(4));
     49      var costRange = new DoubleValueFactorRange(new DoubleValue(0.03125), new DoubleValue(32768), new DoubleValue(4));
     50      SetParameterRangeContraint(vc, "Cost", costRange);
    5051
    51       Experiment experiment = vc.GenerateExperiment(svr);
     52      var gammaRange = new DoubleValueFactorRange(new DoubleValue(6.10352E-05), new DoubleValue(64), new DoubleValue(4));
     53      SetParameterRangeContraint(vc, "Gamma", gammaRange);
     54      worker.ReportProgress(5);
     55      Experiment svrExperiment = vc.GenerateExperiment(svr);
     56      // ======================================================================
     57      worker.ReportProgress(20);
     58
     59      // RF Experiment --------------------------------------------------------
     60      RandomForestRegression rfr = new RandomForestRegression();
     61      rfr.Problem = (IRegressionProblem)problem;
     62      ParameterConfigurationTree rfConfig = new ParameterConfigurationTree(rfr, problem);
     63      var rRange = new DoubleValueRange(new DoubleValue(0.1), new DoubleValue(0.7), new DoubleValue(0.1));
     64      SetParameterRangeContraint(rfConfig, "R", rRange);
     65      var treeRange = new IntValueRange(new IntValue(250), new IntValue(250), new IntValue(250));
     66      SetParameterRangeContraint(rfConfig, "Number of trees", treeRange);
     67      Experiment rfrExperiment = rfConfig.GenerateExperiment(rfr);
     68      // ======================================================================
     69      worker.ReportProgress(40);
     70      // NN Experiment --------------------------------------------------------
     71      NeuralNetworkRegression nnr = new NeuralNetworkRegression();
     72      nnr.Problem = (IRegressionProblem)problem;
     73      ParameterConfigurationTree nnrConfig = new ParameterConfigurationTree(nnr, problem);
     74      var decayRange = new DoubleValueFactorRange(new DoubleValue(0.001), new DoubleValue(100), new DoubleValue(10));
     75      SetParameterRangeContraint(nnrConfig, "Decay", decayRange);
     76      var nodesRange = new IntValueFactorRange(new IntValue(1), new IntValue(100), new IntValue(3));
     77      SetParameterRangeContraint(nnrConfig, "NodesInFirstHiddenLayer", nodesRange);
     78      Experiment nnrExperiment = nnrConfig.GenerateExperiment(nnr);
     79      // ======================================================================
     80      worker.ReportProgress(60);
     81      // GP Experiment --------------------------------------------------------
     82      OffspringSelectionGeneticAlgorithm osga = new OffspringSelectionGeneticAlgorithm();
     83      var prob = new SymbolicRegressionSingleObjectiveProblem();
     84      prob.ProblemData = ((IRegressionProblem)problem).ProblemData;
     85      //prob.SolutionCreator = new MultiSymbolicDataAnalysisExpressionCreator();
     86      osga.Problem = prob;
     87      osga.ComparisonFactorLowerBound.Value = 1;
     88      osga.Crossover = osga.Problem.Operators.OfType<ICrossover>().FirstOrDefault(x => x.Name == gaCrossover);
     89      osga.MaximumEvaluatedSolutions.Value = 500000;
     90      osga.MaximumGenerations.Value = 100;
     91      osga.MutationProbability = new PercentValue(0.15);
     92      osga.Mutator = osga.Problem.Operators.OfType<IManipulator>().FirstOrDefault(x => x.Name == gaMutator);
     93      osga.PopulationSize.Value = 500;
     94      osga.Selector = osga.SelectorParameter.ValidValues.FirstOrDefault(x => x.Name == gaSelector);
     95
     96      CrossValidation crossSmall = new CrossValidation();
     97      crossSmall.Algorithm = osga;
     98      BatchRun batchSmall = new BatchRun("small");
     99      batchSmall.Repetitions = nrOfRepetitions;
     100      batchSmall.Optimizer = crossSmall;
     101
     102      CrossValidation crossMedium = (CrossValidation)crossSmall.Clone(new Cloner());
     103      var probMedium = (SymbolicRegressionSingleObjectiveProblem)prob.Clone(new Cloner());
     104      probMedium.MaximumSymbolicExpressionTreeDepth.Value = 12;
     105      probMedium.MaximumSymbolicExpressionTreeLength.Value = 125;
     106      crossMedium.Algorithm.Problem = probMedium;
     107      BatchRun batchMedium = new BatchRun("medium");
     108      batchMedium.Repetitions = nrOfRepetitions;
     109      batchMedium.Optimizer = crossMedium;
     110
     111      CrossValidation crossLarge = (CrossValidation)crossSmall.Clone(new Cloner());
     112      var probLarge = (SymbolicRegressionSingleObjectiveProblem)prob.Clone(new Cloner());
     113      probLarge.MaximumSymbolicExpressionTreeDepth.Value = 17;
     114      probLarge.MaximumSymbolicExpressionTreeLength.Value = 250;
     115      crossLarge.Algorithm.Problem = probLarge;
     116      BatchRun batchLarge = new BatchRun("large");
     117      batchLarge.Repetitions = nrOfRepetitions;
     118      batchLarge.Optimizer = crossLarge;
     119
     120      Experiment gpExperiment = new Experiment();
     121      gpExperiment.Optimizers.Add(batchSmall);
     122      gpExperiment.Optimizers.Add(batchMedium);
     123      gpExperiment.Optimizers.Add(batchLarge);
     124      // ======================================================================
     125      worker.ReportProgress(80);
     126
     127      Experiment experiment = new Experiment("Data Analysis Experiment");
     128      experiment.Optimizers.Add(svrExperiment);
     129      experiment.Optimizers.Add(rfrExperiment);
     130      experiment.Optimizers.Add(nnrExperiment);
     131      experiment.Optimizers.Add(gpExperiment);
     132
     133      worker.ReportProgress(100);
     134
    52135      e.Result = experiment;
     136    }
     137
     138    private void SetParameterRangeContraint(ParameterConfigurationTree pct, string parameterName, IRange rangeContraint) {
     139      var pc = pct.AlgorithmConfiguration.ParameterConfigurations.Where(x => x.ParameterName == parameterName).SingleOrDefault();
     140      pc.Optimize = true;
     141      var vc = (RangeValueConfiguration)pc.ValueConfigurations.First();
     142      vc.Optimize = true;
     143      vc.RangeConstraint = rangeContraint;
     144
     145    }
     146
     147    private void WorkerProgressChanged(object sender, ProgressChangedEventArgs e) {
     148      progressBar1.Value = e.ProgressPercentage;
    53149    }
    54150
  • branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/Plugin.cs.frame

    r7912 r7939  
    4848  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    4949  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views", "3.4")]
     50  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
     51  [PluginDependency("HeuristicLab.Problems.Instances.DataAnalysis", "3.3")]
    5052  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")]
    5153  public class HeuristicLabExperimentGenerationDataAnalysisExperimentWizardPlugin : PluginBase {
  • branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/ProblemDataPage.Designer.cs

    r7824 r7939  
    2424    /// </summary>
    2525    private void InitializeComponent() {
    26       this.dataAnalysisProblemView = new HeuristicLab.Problems.DataAnalysis.Views.DataAnalysisProblemView();
     26      this.problemView = new HeuristicLab.Optimization.Views.ProblemView();
    2727      this.SuspendLayout();
    2828      //
     
    3131      this.wizardBanner.Size = new System.Drawing.Size(640, 81);
    3232      //
    33       // dataAnalysisProblemView
     33      // problemView
    3434      //
    35       this.dataAnalysisProblemView.Caption = "DataAnalysisProblem View";
    36       this.dataAnalysisProblemView.Content = null;
    37       this.dataAnalysisProblemView.Dock = System.Windows.Forms.DockStyle.Fill;
    38       this.dataAnalysisProblemView.Location = new System.Drawing.Point(0, 81);
    39       this.dataAnalysisProblemView.Name = "dataAnalysisProblemView";
    40       this.dataAnalysisProblemView.ReadOnly = false;
    41       this.dataAnalysisProblemView.Size = new System.Drawing.Size(640, 399);
    42       this.dataAnalysisProblemView.TabIndex = 1;
     35      this.problemView.Caption = "Problem View";
     36      this.problemView.Content = null;
     37      this.problemView.Dock = System.Windows.Forms.DockStyle.Fill;
     38      this.problemView.Location = new System.Drawing.Point(0, 81);
     39      this.problemView.Name = "problemView";
     40      this.problemView.ReadOnly = false;
     41      this.problemView.Size = new System.Drawing.Size(640, 399);
     42      this.problemView.TabIndex = 1;
    4343      //
    4444      // ProblemDataPage
     
    4646      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    4747      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    48       this.Controls.Add(this.dataAnalysisProblemView);
     48      this.Controls.Add(this.problemView);
    4949      this.Name = "ProblemDataPage";
    5050      this.Size = new System.Drawing.Size(640, 480);
     
    5252      this.WizardNext += new HeuristicLab.ExperimentGeneration.DataAnalysis.Wizard.WizardPageEventHandler(this.ProblemDataPage_WizardNext);
    5353      this.Controls.SetChildIndex(this.wizardBanner, 0);
    54       this.Controls.SetChildIndex(this.dataAnalysisProblemView, 0);
     54      this.Controls.SetChildIndex(this.problemView, 0);
    5555      this.ResumeLayout(false);
    5656
     
    5959    #endregion
    6060
    61     private Problems.DataAnalysis.Views.DataAnalysisProblemView dataAnalysisProblemView;
     61    private Optimization.Views.ProblemView problemView;
    6262
    6363  }
  • branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/ProblemDataPage.cs

    r7824 r7939  
    1212      InitializeComponent();
    1313      this.context = context;
    14       dataAnalysisProblemView.Content = new RegressionProblem();
     14      problemView.Content = new RegressionProblem();
    1515    }
    1616
     
    2020
    2121    private void ProblemDataPage_WizardNext(object sender, Wizard.WizardPageEventArgs e) {
    22       context.Problem = dataAnalysisProblemView.Content;
     22      context.Problem = (IDataAnalysisProblem)problemView.Content;
    2323    }
    2424  }
Note: See TracChangeset for help on using the changeset viewer.