Changeset 7939 for branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard
- Timestamp:
- 05/30/12 17:24:16 (13 years ago)
- 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 42 42 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis.Views-3.4.dll</HintPath> 43 43 </Reference> 44 <Reference Include="HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 44 45 <Reference Include="HeuristicLab.Collections-3.3"> 45 46 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath> … … 63 64 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath> 64 65 </Reference> 66 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 65 67 <Reference Include="HeuristicLab.MainForm-3.3"> 66 68 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath> … … 69 71 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 70 72 </Reference> 73 <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 71 74 <Reference Include="HeuristicLab.Optimization-3.3"> 72 75 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath> … … 90 93 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath> 91 94 </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" /> 92 97 <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4"> 93 98 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Views-3.4.dll</HintPath> 94 99 </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" /> 95 103 <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3"> 96 104 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath> -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/MediumAnalysisPage.cs
r7912 r7939 3 3 using System.Linq; 4 4 using HeuristicLab.Algorithms.DataAnalysis; 5 using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm; 6 using HeuristicLab.Common; 5 7 using HeuristicLab.Data; 6 8 using HeuristicLab.Encodings.ParameterConfigurationTreeEncoding; 7 9 using HeuristicLab.Optimization; 8 10 using HeuristicLab.Problems.DataAnalysis; 11 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression; 9 12 namespace HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard { 10 13 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 11 19 private BackgroundWorker worker; 12 20 … … 22 30 worker.DoWork += new DoWorkEventHandler(GenerateExperimentsTask); 23 31 worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkerCompleted); 32 worker.WorkerReportsProgress = true; 33 worker.ProgressChanged += new ProgressChangedEventHandler(WorkerProgressChanged); 24 34 25 35 } … … 28 38 DataAnalysisWizardContext c = e.Argument as DataAnalysisWizardContext; 29 39 IProblem problem = c.Problem; 40 41 // SVR Experiment ------------------------------------------------------- 30 42 SupportVectorRegression svr = new SupportVectorRegression(); 31 43 svr.Problem = (IRegressionProblem)problem; 32 44 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));38 45 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); 44 48 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); 50 51 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 52 135 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; 53 149 } 54 150 -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/Plugin.cs.frame
r7912 r7939 48 48 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 49 49 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views", "3.4")] 50 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 51 [PluginDependency("HeuristicLab.Problems.Instances.DataAnalysis", "3.3")] 50 52 [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")] 51 53 public class HeuristicLabExperimentGenerationDataAnalysisExperimentWizardPlugin : PluginBase { -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/ProblemDataPage.Designer.cs
r7824 r7939 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this. dataAnalysisProblemView = new HeuristicLab.Problems.DataAnalysis.Views.DataAnalysisProblemView();26 this.problemView = new HeuristicLab.Optimization.Views.ProblemView(); 27 27 this.SuspendLayout(); 28 28 // … … 31 31 this.wizardBanner.Size = new System.Drawing.Size(640, 81); 32 32 // 33 // dataAnalysisProblemView33 // problemView 34 34 // 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; 43 43 // 44 44 // ProblemDataPage … … 46 46 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 47 47 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 48 this.Controls.Add(this. dataAnalysisProblemView);48 this.Controls.Add(this.problemView); 49 49 this.Name = "ProblemDataPage"; 50 50 this.Size = new System.Drawing.Size(640, 480); … … 52 52 this.WizardNext += new HeuristicLab.ExperimentGeneration.DataAnalysis.Wizard.WizardPageEventHandler(this.ProblemDataPage_WizardNext); 53 53 this.Controls.SetChildIndex(this.wizardBanner, 0); 54 this.Controls.SetChildIndex(this. dataAnalysisProblemView, 0);54 this.Controls.SetChildIndex(this.problemView, 0); 55 55 this.ResumeLayout(false); 56 56 … … 59 59 #endregion 60 60 61 private Problems.DataAnalysis.Views.DataAnalysisProblemView dataAnalysisProblemView;61 private Optimization.Views.ProblemView problemView; 62 62 63 63 } -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/ProblemDataPage.cs
r7824 r7939 12 12 InitializeComponent(); 13 13 this.context = context; 14 dataAnalysisProblemView.Content = new RegressionProblem();14 problemView.Content = new RegressionProblem(); 15 15 } 16 16 … … 20 20 21 21 private void ProblemDataPage_WizardNext(object sender, Wizard.WizardPageEventArgs e) { 22 context.Problem = dataAnalysisProblemView.Content;22 context.Problem = (IDataAnalysisProblem)problemView.Content; 23 23 } 24 24 }
Note: See TracChangeset
for help on using the changeset viewer.