Changeset 8024
- Timestamp:
- 06/18/12 10:10:11 (12 years ago)
- Location:
- branches/DataAnalysisService
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/MediumAnalysisPage.Designer.cs
r7912 r8024 25 25 private void InitializeComponent() { 26 26 this.progressBar1 = new System.Windows.Forms.ProgressBar(); 27 this.l abel1= new System.Windows.Forms.Label();27 this.lblProgress = new System.Windows.Forms.Label(); 28 28 this.SuspendLayout(); 29 29 // 30 30 // wizardBanner 31 31 // 32 this.wizardBanner.Size = new System.Drawing.Size(640, 81); 32 33 this.wizardBanner.Subtitle = "Generating experiment ..."; 33 34 this.wizardBanner.Title = "Medium Analysis"; … … 35 36 // progressBar1 36 37 // 37 this.progressBar1.Anchor = System.Windows.Forms.AnchorStyles.None;38 this.progressBar1.Location = new System.Drawing.Point( 0, 143);38 this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); 39 this.progressBar1.Location = new System.Drawing.Point(30, 263); 39 40 this.progressBar1.Name = "progressBar1"; 40 this.progressBar1.Size = new System.Drawing.Size( 320, 23);41 this.progressBar1.Size = new System.Drawing.Size(580, 23); 41 42 this.progressBar1.TabIndex = 2; 42 43 // 43 // l abel144 // lblProgress 44 45 // 45 this.label1.AutoSize = true; 46 this.label1.Location = new System.Drawing.Point(0, 124); 47 this.label1.Name = "label1"; 48 this.label1.Size = new System.Drawing.Size(35, 13); 49 this.label1.TabIndex = 3; 50 this.label1.Text = "label1"; 46 this.lblProgress.Anchor = System.Windows.Forms.AnchorStyles.Left; 47 this.lblProgress.AutoSize = true; 48 this.lblProgress.Location = new System.Drawing.Point(27, 230); 49 this.lblProgress.Name = "lblProgress"; 50 this.lblProgress.Size = new System.Drawing.Size(125, 13); 51 this.lblProgress.TabIndex = 3; 52 this.lblProgress.Text = "Generating experiment ..."; 51 53 // 52 54 // MediumAnalysisPage 53 55 // 54 56 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 55 this.Controls.Add(this.label1);56 57 this.Controls.Add(this.progressBar1); 58 this.Controls.Add(this.lblProgress); 57 59 this.Name = "MediumAnalysisPage"; 60 this.Size = new System.Drawing.Size(640, 480); 58 61 this.SetActive += new System.ComponentModel.CancelEventHandler(this.MediumAnalysisPage_SetActive); 62 this.WizardCancel += new System.ComponentModel.CancelEventHandler(this.MediumAnalysisPage_WizardCancel); 59 63 this.WizardBack += new HeuristicLab.ExperimentGeneration.DataAnalysis.Wizard.WizardPageEventHandler(this.MediumAnalysisPage_WizardBack); 64 this.Controls.SetChildIndex(this.lblProgress, 0); 60 65 this.Controls.SetChildIndex(this.progressBar1, 0); 61 this.Controls.SetChildIndex(this.label1, 0);62 66 this.Controls.SetChildIndex(this.wizardBanner, 0); 63 67 this.ResumeLayout(false); … … 69 73 70 74 private System.Windows.Forms.ProgressBar progressBar1; 71 private System.Windows.Forms.Label l abel1;75 private System.Windows.Forms.Label lblProgress; 72 76 73 77 } -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/MediumAnalysisPage.cs
r7944 r8024 1 1 2 using System; 2 3 using System.ComponentModel; 3 4 using System.Linq; 5 using System.Windows.Forms; 4 6 using HeuristicLab.Algorithms.DataAnalysis; 5 7 using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm; … … 32 34 worker.WorkerReportsProgress = true; 33 35 worker.ProgressChanged += new ProgressChangedEventHandler(WorkerProgressChanged); 34 36 worker.WorkerSupportsCancellation = true; 35 37 } 36 38 … … 38 40 DataAnalysisWizardContext c = e.Argument as DataAnalysisWizardContext; 39 41 IProblem problem = c.Problem; 42 if (worker.CancellationPending) { 43 e.Cancel = true; 44 } else { 45 lblProgress.Invoke(new Action(() => { lblProgress.Text = "Generating Support Vector Regression Experiment ..."; })); 46 } 40 47 41 48 // SVR Experiment ------------------------------------------------------- 42 //SupportVectorRegression svr = new SupportVectorRegression(); 43 //svr.Problem = (IRegressionProblem)problem; 44 //ParameterConfigurationTree vc = new ParameterConfigurationTree(svr, problem); 45 46 //var nuRange = new DoubleValueRange(new DoubleValue(0.1), new DoubleValue(0.9), new DoubleValue(0.1)); 47 //SetParameterRangeContraint(vc, "Nu", nuRange); 48 49 //var costRange = new DoubleValueFactorRange(new DoubleValue(0.03125), new DoubleValue(32768), new DoubleValue(4)); 50 //SetParameterRangeContraint(vc, "Cost", costRange); 51 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); 49 //Experiment svrExperiment = null; 50 //if (!e.Cancel) { 51 // SupportVectorRegression svr = new SupportVectorRegression(); 52 // svr.Problem = (IRegressionProblem)problem; 53 // ParameterConfigurationTree vc = new ParameterConfigurationTree(svr, problem); 54 55 // var nuRange = new DoubleValueRange(new DoubleValue(0.1), new DoubleValue(0.9), new DoubleValue(0.1)); 56 // SetParameterRangeContraint(vc, "Nu", nuRange); 57 58 // var costRange = new DoubleValueFactorRange(new DoubleValue(0.03125), new DoubleValue(32768), new DoubleValue(4)); 59 // SetParameterRangeContraint(vc, "Cost", costRange); 60 61 // var gammaRange = new DoubleValueFactorRange(new DoubleValue(6.10352E-05), new DoubleValue(64), new DoubleValue(4)); 62 // SetParameterRangeContraint(vc, "Gamma", gammaRange); 63 // worker.ReportProgress(5); 64 // svrExperiment = vc.GenerateExperiment(svr); 65 //} 66 // ====================================================================== 67 68 if (worker.CancellationPending) { 69 e.Cancel = true; 70 } else { 71 worker.ReportProgress(20); 72 lblProgress.Invoke(new Action(() => { lblProgress.Text = "Generating Random Forest Regression Experiment ..."; })); 73 } 74 58 75 59 76 // 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); 77 //Experiment rfrExperiment = null; 78 //if (!e.Cancel) { 79 // RandomForestRegression rfr = new RandomForestRegression(); 80 // rfr.Problem = (IRegressionProblem)problem; 81 // ParameterConfigurationTree rfConfig = new ParameterConfigurationTree(rfr, problem); 82 // var rRange = new DoubleValueRange(new DoubleValue(0.1), new DoubleValue(0.7), new DoubleValue(0.1)); 83 // SetParameterRangeContraint(rfConfig, "R", rRange); 84 // var treeRange = new IntValueRange(new IntValue(250), new IntValue(250), new IntValue(250)); 85 // SetParameterRangeContraint(rfConfig, "Number of trees", treeRange); 86 // rfrExperiment = rfConfig.GenerateExperiment(rfr); 87 //} 88 // ====================================================================== 89 90 if (worker.CancellationPending) { 91 e.Cancel = true; 92 } else { 93 worker.ReportProgress(40); 94 lblProgress.Invoke(new Action(() => { lblProgress.Text = "Generating Neural Network Regression Experiment ..."; })); 95 } 96 97 70 98 // 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); 99 //Experiment nnrExperiment = null; 100 //if (!e.Cancel) { 101 // NeuralNetworkRegression nnr = new NeuralNetworkRegression(); 102 // nnr.Problem = (IRegressionProblem)problem; 103 // ParameterConfigurationTree nnrConfig = new ParameterConfigurationTree(nnr, problem); 104 // var decayRange = new DoubleValueFactorRange(new DoubleValue(0.001), new DoubleValue(100), new DoubleValue(10)); 105 // SetParameterRangeContraint(nnrConfig, "Decay", decayRange); 106 // var nodesRange = new IntValueFactorRange(new IntValue(1), new IntValue(100), new IntValue(3)); 107 // SetParameterRangeContraint(nnrConfig, "NodesInFirstHiddenLayer", nodesRange); 108 // nnrExperiment = nnrConfig.GenerateExperiment(nnr); 109 //} 110 // ====================================================================== 111 112 if (worker.CancellationPending) { 113 e.Cancel = true; 114 } else { 115 worker.ReportProgress(60); 116 lblProgress.Invoke(new Action(() => { lblProgress.Text = "Generating Offspring Selection Genetic Algorithm Experiment ..."; })); 117 } 118 81 119 // 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 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); 121 if (!e.Cancel) { 122 OffspringSelectionGeneticAlgorithm osga = new OffspringSelectionGeneticAlgorithm(); 123 var prob = new SymbolicRegressionSingleObjectiveProblem(); 124 prob.ProblemData = ((IRegressionProblem)problem).ProblemData; 125 //prob.SolutionCreator = new MultiSymbolicDataAnalysisExpressionCreator(); 126 osga.Problem = prob; 127 osga.ComparisonFactorLowerBound.Value = 1; 128 osga.Crossover = osga.Problem.Operators.OfType<ICrossover>().FirstOrDefault(x => x.Name == gaCrossover); 129 osga.MaximumEvaluatedSolutions.Value = 500000; 130 osga.MaximumGenerations.Value = 100; 131 osga.MutationProbability = new PercentValue(0.15); 132 osga.Mutator = osga.Problem.Operators.OfType<IManipulator>().FirstOrDefault(x => x.Name == gaMutator); 133 osga.PopulationSize.Value = 500; 134 osga.Selector = osga.SelectorParameter.ValidValues.FirstOrDefault(x => x.Name == gaSelector); 135 136 CrossValidation crossSmall = new CrossValidation(); 137 crossSmall.Algorithm = osga; 138 BatchRun batchSmall = new BatchRun("small"); 139 batchSmall.Repetitions = nrOfRepetitions; 140 batchSmall.Optimizer = crossSmall; 141 142 CrossValidation crossMedium = (CrossValidation)crossSmall.Clone(new Cloner()); 143 var probMedium = (SymbolicRegressionSingleObjectiveProblem)prob.Clone(new Cloner()); 144 probMedium.MaximumSymbolicExpressionTreeDepth.Value = 12; 145 probMedium.MaximumSymbolicExpressionTreeLength.Value = 125; 146 crossMedium.Algorithm.Problem = probMedium; 147 BatchRun batchMedium = new BatchRun("medium"); 148 batchMedium.Repetitions = nrOfRepetitions; 149 batchMedium.Optimizer = crossMedium; 150 151 CrossValidation crossLarge = (CrossValidation)crossSmall.Clone(new Cloner()); 152 var probLarge = (SymbolicRegressionSingleObjectiveProblem)prob.Clone(new Cloner()); 153 probLarge.MaximumSymbolicExpressionTreeDepth.Value = 17; 154 probLarge.MaximumSymbolicExpressionTreeLength.Value = 250; 155 crossLarge.Algorithm.Problem = probLarge; 156 BatchRun batchLarge = new BatchRun("large"); 157 batchLarge.Repetitions = nrOfRepetitions; 158 batchLarge.Optimizer = crossLarge; 159 160 //Experiment gpExperiment = new Experiment(); 161 gpExperiment.Optimizers.Add(batchSmall); 162 gpExperiment.Optimizers.Add(batchMedium); 163 gpExperiment.Optimizers.Add(batchLarge); 164 } 165 // ====================================================================== 166 if (worker.CancellationPending) { 167 e.Cancel = true; 168 } else { 169 worker.ReportProgress(80); 170 lblProgress.Invoke(new Action(() => { lblProgress.Text = "Packing Data Analysis Experiment ..."; })); 171 } 126 172 127 173 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); 174 if (!e.Cancel) { 175 //Experiment experiment = new Experiment("Data Analysis Experiment"); 176 //experiment.Optimizers.Add(svrExperiment); 177 //experiment.Optimizers.Add(rfrExperiment); 178 //experiment.Optimizers.Add(nnrExperiment); 179 experiment.Optimizers.Add(gpExperiment); 180 } 181 182 if (worker.CancellationPending) { 183 e.Cancel = true; 184 } else { 185 worker.ReportProgress(100); 186 lblProgress.Invoke(new Action(() => { lblProgress.Text = "Experiment generation completed"; })); 187 } 134 188 135 189 e.Result = experiment; … … 150 204 151 205 private void WorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 152 SetWizardButton(Wizard.WizardButtons.Next); 153 Experiment experiment = (Experiment)e.Result; 154 context.Experiment = experiment; 206 if (e.Error != null) { 207 SetWizardButton(Wizard.WizardButtons.Back); 208 MessageBox.Show(e.Error.Message, "Error occurred while generating experiments", MessageBoxButtons.OK, MessageBoxIcon.Error); 209 } else if (e.Cancelled) { 210 // nothing to do here ... 211 } else { 212 SetWizardButton(Wizard.WizardButtons.Next); 213 Experiment experiment = (Experiment)e.Result; 214 context.Experiment = experiment; 215 } 155 216 } 156 217 … … 163 224 worker.RunWorkerAsync(context); 164 225 } 226 227 private void MediumAnalysisPage_WizardCancel(object sender, CancelEventArgs e) { 228 worker.CancelAsync(); 229 } 165 230 } 166 231 } -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/Plugin.cs.frame
r7953 r8024 32 32 [PluginDependency("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm", "3.3")] 33 33 [PluginDependency("HeuristicLab.Clients.Hive", "3.3")] 34 [PluginDependency("HeuristicLab.Clients.Hive JobManager", "3.3")]34 [PluginDependency("HeuristicLab.Clients.Hive.JobManager", "3.3")] 35 35 [PluginDependency("HeuristicLab.Collections", "3.3")] 36 36 [PluginDependency("HeuristicLab.Common", "3.3")] … … 54 54 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 55 55 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")] 56 [PluginDependency("HeuristicLab.Problems.DataAnalysis. Regression", "3.4")]56 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")] 57 57 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views", "3.4")] 58 58 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.ExperimentWizard/3.3/TargetVariablePage.Designer.cs
r7953 r8024 32 32 // wizardBanner 33 33 // 34 this.wizardBanner.Size = new System.Drawing.Size( 471, 81);34 this.wizardBanner.Size = new System.Drawing.Size(640, 81); 35 35 this.wizardBanner.Subtitle = "Select the solumn which describes the expected output values."; 36 36 this.wizardBanner.Title = "Target Variable"; … … 48 48 this.stringConvertibleMatrixView.ShowRowsAndColumnsTextBox = true; 49 49 this.stringConvertibleMatrixView.ShowStatisticalInformation = true; 50 this.stringConvertibleMatrixView.Size = new System.Drawing.Size( 462, 168);50 this.stringConvertibleMatrixView.Size = new System.Drawing.Size(631, 337); 51 51 this.stringConvertibleMatrixView.TabIndex = 1; 52 52 // … … 68 68 this.cmbTargetVariable.Location = new System.Drawing.Point(119, 88); 69 69 this.cmbTargetVariable.Name = "cmbTargetVariable"; 70 this.cmbTargetVariable.Size = new System.Drawing.Size( 349, 21);70 this.cmbTargetVariable.Size = new System.Drawing.Size(518, 21); 71 71 this.cmbTargetVariable.TabIndex = 3; 72 72 // … … 80 80 this.label2.Text = "Preview data:"; 81 81 // 82 // ProblemDataViewPage82 // TargetVariablePage 83 83 // 84 84 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); … … 87 87 this.Controls.Add(this.label1); 88 88 this.Controls.Add(this.stringConvertibleMatrixView); 89 this.Name = " ProblemDataViewPage";90 this.Size = new System.Drawing.Size( 471, 311);89 this.Name = "TargetVariablePage"; 90 this.Size = new System.Drawing.Size(640, 480); 91 91 this.SetActive += new System.ComponentModel.CancelEventHandler(this.ProblemDataViewPage_SetActive); 92 92 this.WizardNext += new HeuristicLab.ExperimentGeneration.DataAnalysis.Wizard.WizardPageEventHandler(this.ProblemDataViewPage_WizardNext); -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.Wizard/3.3/WizardBase.cs
r7824 r8024 170 170 171 171 private void btnCancel_Click(object sender, EventArgs e) { 172 DialogResult = DialogResult.Cancel; 173 Close(); 172 CancelEventArgs cea = new CancelEventArgs(); 173 cea.Cancel = true; 174 ActivePage.OnWizardCancel(cea); 175 if (cea.Cancel) { 176 DialogResult = DialogResult.Cancel; 177 Close(); 178 } 174 179 } 175 180 -
branches/DataAnalysisService/HeuristicLab.ExperimentGeneration.DataAnalysis.Wizard/3.3/WizardPage.cs
r7808 r8024 39 39 } 40 40 41 public event CancelEventHandler WizardCancel; 42 public virtual void OnWizardCancel(CancelEventArgs e) { 43 if (WizardCancel != null) 44 WizardCancel(this, e); 45 } 46 41 47 public event WizardPageEventHandler WizardNext; 42 48 public virtual void OnWizardNext(WizardPageEventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.